예제 #1
0
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        MotionClass.DIALOG_USER data = null;
        string now_date = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
        string name     = txt_Name.Text;

        if (string.IsNullOrEmpty(name))
        {
            Alert_msg("交出名字,饒你一命");
        }
        else
        {
            if (name == "gis@5200")
            {
                data = SQLFunc.Get_DIALOG_USER("", "Manager", lb_IP.Text, now_date);
                Session["DIALOG_USER"] = data;

                Response.Redirect("~/Page/Summary.aspx");
            }
            else
            {
                if (Session["DIALOG_USER"] == null)
                {
                    data = SQLFunc.Get_DIALOG_USER("", name, lb_IP.Text, now_date);
                    string U_ID = SQLFunc.Add_DIALOG_USER(data);
                    data = SQLFunc.Get_DIALOG_USER(U_ID, name, lb_IP.Text, now_date);
                    Session["DIALOG_USER"] = data;
                }

                MotionClass.DIALOG_USER data_USER = (MotionClass.DIALOG_USER)Session["DIALOG_USER"];
                MotionClass.DIALOG_MAIN data_Main = SQLFunc.Get_DIALOG_MAIN(data_USER.U_ID, "0", now_date);
                string DM_ID = SQLFunc.Add_DIALOG_MAIN(data_Main);
                //string DM_ID = "1";
                Response.Redirect("Page/Dialog.aspx?DM_ID=" + DM_ID);
            }
        }
    }