示例#1
0
 private MotionClass.DIALOG_MAIN Get_Motion_DialogMain(string DM_ID, MotionClass.DIALOG_DETAIL.REPLY data_detail)
 {
     MotionClass.DIALOG_MAIN data_main = new MotionClass.DIALOG_MAIN();
     data_main.DM_Motion_Total = data_detail.DD_Motion;
     data_main.DM_EndTime      = data_detail.DD_UpdateTime;
     data_main.DM_ID           = DM_ID;
     return(data_main);
 }
示例#2
0
 public static MotionClass.DIALOG_MAIN Get_DIALOG_MAIN(string DM_UID, string DM_Motion_Total, string DM_StartTime)
 {
     MotionClass.DIALOG_MAIN data = new MotionClass.DIALOG_MAIN();
     data.DM_UID          = DM_UID;
     data.DM_Motion_Total = DM_Motion_Total;
     data.DM_StartTime    = DM_StartTime;
     return(data);
 }
示例#3
0
    public static void Upd_DIALOG_MAIN(MotionClass.DIALOG_MAIN data)
    {
        var cmd = new SqlCommand();

        cmd.CommandText = "Update Dialog_Main set DM_Motion_Total=DM_Motion_Total+@DM_Motion_Total, DM_EndTime=@DM_EndTime where DM_ID=@DM_ID";
        cmd.Parameters.Add("DM_Motion_Total", SqlDbType.Float).Value = data.DM_Motion_Total;
        cmd.Parameters.Add("DM_EndTime", SqlDbType.DateTime).Value   = data.DM_EndTime;
        cmd.Parameters.Add("DM_ID", SqlDbType.Int).Value             = data.DM_ID;
        Persister.ExecuteNonQuery(cmd);
    }
示例#4
0
    public static string Add_DIALOG_MAIN(MotionClass.DIALOG_MAIN data)
    {
        var cmd = new SqlCommand();

        cmd.CommandText = "Insert into Dialog_Main (DM_UID, DM_Motion_Total, DM_StartTime) values (@DM_UID, @DM_Motion_Total, @DM_StartTime)";
        cmd.Parameters.Add("DM_UID", SqlDbType.Int).Value            = data.DM_UID;
        cmd.Parameters.Add("DM_Motion_Total", SqlDbType.Float).Value = data.DM_Motion_Total;
        cmd.Parameters.Add("DM_StartTime", SqlDbType.DateTime).Value = data.DM_StartTime;
        cmd.CommandText += "select @@IDENTITY ";
        DataTable dt = Persister.Execute(cmd);
        string    id = dt.Rows[0][0].ToString();

        return(id);
    }
示例#5
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);
            }
        }
    }