⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.aspx.cs

📁 javascript实现的一个实时在线谈判模块
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using System.Data.SqlClient;



public partial class Main : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
       
        Response.ContentType = "text/html;charset=UTF-8";
        //Response.Headers.Add("Cache-Control", "no-cache");
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        string u=Request.QueryString.Get("name");
        string c = Request.QueryString.Get("content");
        string u2 = Request.QueryString.Get("name2");
        string isjia = Request.QueryString.Get("isjia");
        List<string> values=new List<string>();
        List<string> keys=new List<string>();

        if (Request.QueryString.Get("agree") == "agree")
        {   
            string keyval=Request.QueryString.Get("newid");
            if (keyval == "" || keyval == null)
            {
                Response.End();
            }
            if(isjia=="1")
            {
                bianliang.UpdateColum("astate", "同意", "合同洽谈表", "contractID", keyval);
                Response.Write(isjia);
                Response.End();
            }
            
        
        }
        if (Request.QueryString.Get("type") == "ins")
        {
            for (int i = 0; i < Request.QueryString.Count; i++)
            {
                string k = Request.QueryString.Keys[i];
                if (k != "name" && k != "randnum" && k != "type"&&k!="newid"&&k!="isjia"&&k!="name2")
                {
                    keys.Add(k);
                    values.Add(Request.QueryString.Get(k));
                }
                
            }
            if (isjia == "1")
            {
                keys.Add("auname");
                values.Add(u);
                keys.Add("buname");
                values.Add(u2);
            }
            else
            {
                keys.Add("auname");
                values.Add(u2);
                keys.Add("buname");
                values.Add(u);
            }
            try
            {
                bianliang.AddRow(keys.ToArray(), values.ToArray(), "合同洽谈表", "contractID");
                DataTable cid = bianliang.GetDataTable("select top 1 [contractID] from [合同洽谈表] where [auname]='"+u+"' and [buname]='"+u2+"' ORDER BY [contractID] DESC");
                Response.Write(cid.Rows[0][0]);
                Response.End();
            }
            catch (Exception ex)
            {
                throw ex;
            }


        }
        else if (Request.QueryString.Get("type") == "upt")
        {
            for (int i = 0; i < Request.QueryString.Count; i++)
            {
                string k = Request.QueryString.Keys[i];
                if (k != "name"&& k != "randnum" && k != "type" && k != "newid"&&k!="isjia"&&k!="name2")
                {
                    keys.Add(k);
                    values.Add(Request.QueryString.Get(k));
                }
              
            }
            if (isjia == "1")
            {
                keys.Add("auname");
                values.Add(u);
                keys.Add("buname");
                values.Add(u2);
            }
            else
            {
                keys.Add("auname");
                values.Add(u2);
                keys.Add("buname");
                values.Add(u);
            }
            try
            {
                bianliang.updateRow(keys.ToArray(),values.ToArray(), "合同洽谈表", "contractID", Request.QueryString.Get("newid"));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            Response.End();
        }
        else if (Request.QueryString.Get("type") == "fresh")
        {   
            string conid=Request.QueryString.Get("contractID");
            if (conid == "" || conid == null)
            {
                conid = Convert.ToString(bianliang.GetDataTable("select top 1 [contractID] from [合同洽谈表] where [auname]='" + Request.QueryString.Get("jia") + "' and [buname]='" + Request.QueryString.Get("yi") + "' ORDER BY [contractID] DESC").Rows[0][0]);
                if(conid==""||conid==null)
                {
                    Response.End();
                }
            }
            DataTable tbl = bianliang.GetDataTable("Select aname,bname,atel,btel,num,traprice,traAddress,carmode,carmoney,Format(agrdate,\"yyyy\\-mm\\-dd\"),responsibility,other,Format(contrdate,\"yyyy\\-mm\\-dd\"),contractID from [合同洽谈表] where [contractID]=" + conid);
            object[] oldArray = tbl.Rows[0].ItemArray;
            string[] newArray = new string[oldArray.Length];
            for( int i=0;i<oldArray.Length;i++ )
            newArray[i] = oldArray[i].ToString();
            string res=string.Join(",",newArray);
            Response.Write(res);
            Response.End();
        }
        
        if (u != null && u != "")
        {
            if (c == null || c == "")
            {

                if (isjia == "1")
                {

                    if (bianliang.ht.ContainsKey(u2) && bianliang.ht[u2].ContainsKey(u) && bianliang.ht[u2][u].Count!=0)
                    {
                        Queue<string> temp=bianliang.ht[u2][u][1];
                        
                        //    Queue temp = (Queue)bianliang.ht[u];

                        while (temp.Count != 0)
                        {
                            Response.Write(bianliang.chudui(temp) + "<br/>");
                            bianliang.yichu(temp);
                        }
                        Response.End();

                    }
                    else
                    {
                        Response.End();

                    }
                }
                else
                {
                    if (bianliang.ht.ContainsKey(u) && bianliang.ht[u].ContainsKey(u2)&&bianliang.ht[u][u2].Count!=0)
                    {
                        Queue<string> temp = bianliang.ht[u][u2][0];
                        while (temp.Count != 0)
                        {
                            Response.Write(bianliang.chudui(temp) + "<br/>");
                            bianliang.yichu(temp);
                        }
                        Response.End();
                    }
                    else 
                    {
                        Response.End();
                    }
                }
            }
            else
            {
                c = c.Replace("\r\n", "<br/>").Replace(" ", "&nbsp;");
                if (isjia == "1")
                {

                    if (bianliang.ht.ContainsKey(u)==false)
                    {
                        bianliang.ht.Add(u, new Dictionary<string, List<Queue<string>>>());
                        bianliang.ht[u].Add(u2, (new List<Queue<string>>()));
                        bianliang.ht[u][u2].Add(new Queue<string>());
                        bianliang.ht[u][u2].Add(new Queue<string>());
                        Queue<string> temp = bianliang.ht[u][u2][0];
                        bianliang.jindui(temp, c);
                        Response.End();

                       
                    }
                    else if(bianliang.ht[u].ContainsKey(u2)==false)
                    {  
                        bianliang.ht[u].Add(u2, (new List<Queue<string>>()));
                        bianliang.ht[u][u2].Add(new Queue<string>());
                        bianliang.ht[u][u2].Add(new Queue<string>());
                        Queue<string> temp = bianliang.ht[u][u2][0];
                        bianliang.jindui(temp, c);
                        Response.End();
                    }
                    else if (bianliang.ht[u][u2].Count == 0)
                    {
                        bianliang.ht[u][u2].Add(new Queue<string>());
                        bianliang.ht[u][u2].Add(new Queue<string>());
                        Queue<string> temp = bianliang.ht[u][u2][0];
                        bianliang.jindui(temp, c);
                        Response.End();
                    }
                    else
                    { 
                        Queue<string> temp = bianliang.ht[u][u2][0];
                        bianliang.jindui(temp, c);
                        Response.End();
                    }
                }
                else
                {
                    if (bianliang.ht.ContainsKey(u2) == false)
                    {
                        bianliang.ht.Add(u2, new Dictionary<string, List<Queue<string>>>());
                        bianliang.ht[u2].Add(u, (new List<Queue<string>>()));
                        bianliang.ht[u2][u].Add(new Queue<string>());
                        bianliang.ht[u2][u].Add(new Queue<string>());
                        Queue<string> temp = bianliang.ht[u2][u][1];
                        bianliang.jindui(temp, c);
                        Response.End();


                    }
                    else if (bianliang.ht[u2].ContainsKey(u) == false)
                    {
                        bianliang.ht[u2].Add(u, (new List<Queue<string>>()));
                        bianliang.ht[u2][u].Add(new Queue<string>());
                        bianliang.ht[u2][u].Add(new Queue<string>());
                        Queue<string> temp = bianliang.ht[u2][u][1];
                        bianliang.jindui(temp, c);
                        Response.End();
                    }
                    else if (bianliang.ht[u2][u].Count == 0)
                    {
                        bianliang.ht[u2][u].Add(new Queue<string>());
                        bianliang.ht[u2][u].Add(new Queue<string>());
                        Queue<string> temp = bianliang.ht[u2][u][1];
                        bianliang.jindui(temp, c);
                        Response.End();
                    }
                    else
                    {
                        Queue<string> temp = bianliang.ht[u2][u][1];
                        bianliang.jindui(temp, c);
                        Response.End();
                    }
                
                }
            }

        }
       
        
      
        Response.End();
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -