Esempio n. 1
0
    public static DataTable Get_Sort_Bad()
    {
        var cmd = new SqlCommand();

        cmd.CommandText = "Select * from Sort_Bad";
        DataTable dt = Persister.Execute(cmd);

        return(dt);
    }
Esempio n. 2
0
    public static DataTable Get_DIALOG_MAIN(string DM_ID)
    {
        var cmd = new SqlCommand();

        cmd.CommandText = "Select * from Dialog_Main where DM_ID=@DM_ID";
        cmd.Parameters.Add("DM_ID", SqlDbType.Int).Value = DM_ID;
        DataTable dt = Persister.Execute(cmd);

        return(dt);
    }
Esempio n. 3
0
    public static DataTable Get_DIALOG_FEEDBACK(string DF_DDID)
    {
        var cmd = new SqlCommand();

        cmd.CommandText = "Select * from Dialog_Feedback where DF_DDID=@DF_DDID";
        cmd.Parameters.Add("DF_DDID", SqlDbType.Int).Value = DF_DDID;
        DataTable dt = Persister.Execute(cmd);

        return(dt);
    }
Esempio n. 4
0
    public static DataTable Get_DIALOG_USER(string U_IP)
    {
        var cmd = new SqlCommand();

        cmd.CommandText = "Select * from DIALOG_USER where U_IP=@U_IP";
        cmd.Parameters.Add("U_IP", SqlDbType.NVarChar).Value = U_IP;
        DataTable dt = Persister.Execute(cmd);

        return(dt);
    }
Esempio n. 5
0
    public static DataTable Get_DIALOG_DETAIL_By_DD_Type(string DD_Type)
    {
        var cmd = new SqlCommand();

        cmd.CommandText = "Select * from Dialog_Detail where DD_Type=@DD_Type";
        cmd.Parameters.Add("DD_Type", SqlDbType.Int).Value = DD_Type;
        DataTable dt = Persister.Execute(cmd);

        return(dt);
    }
Esempio n. 6
0
    public static DataTable Get_DIALOG_DETAIL(string DD_DMID)
    {
        var cmd = new SqlCommand();

        cmd.CommandText = "Select * from Dialog_Detail where DD_DMID=@DD_DMID order by DD_CreateTime desc";
        cmd.Parameters.Add("DD_DMID", SqlDbType.Int).Value = DD_DMID;
        DataTable dt = Persister.Execute(cmd);

        return(dt);
    }
Esempio n. 7
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);
    }
Esempio n. 8
0
    public static string Add_DIALOG_USER(MotionClass.DIALOG_USER data)
    {
        var cmd = new SqlCommand();

        cmd.CommandText = "Insert into DIALOG_USER (U_IP, U_Name, U_CreateTime) values (@U_IP, @U_Name, @U_CreateTime) ";
        cmd.Parameters.Add("U_IP", SqlDbType.NVarChar).Value         = data.U_IP;
        cmd.Parameters.Add("U_Name", SqlDbType.NVarChar).Value       = data.U_Name;
        cmd.Parameters.Add("U_CreateTime", SqlDbType.NVarChar).Value = data.U_CreateTime;
        cmd.CommandText += "select @@IDENTITY ";
        DataTable dt = Persister.Execute(cmd);
        string    id = dt.Rows[0][0].ToString();

        return(id);
    }
Esempio n. 9
0
    public static DataTable Get_DIALOG_DETAIL_List(string DD_DMID)
    {
        DataTable dt = new DataTable();

        if (string.IsNullOrEmpty(DD_DMID))
        {
            var cmd = new SqlCommand();
            cmd.CommandText = @"select Dialog_Detail.* from Dialog_Detail
            LEFT JOIN Dialog_Feedback on DD_ID=DF_DDID
            where DF_ID is null";
            dt = Persister.Execute(cmd);
        }
        else
        {
            dt = Get_DIALOG_DETAIL(DD_DMID);
        }

        dt.Columns.Add("DF_ID");
        dt.Columns.Add("DF_Type");

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            string    DD_ID = dt.Rows[i]["DD_ID"].ToString();
            DataTable dt_DF = Get_DIALOG_FEEDBACK(DD_ID);

            if (dt_DF.Rows.Count > 0)
            {
                dt.Rows[i]["DF_ID"]   = dt_DF.Rows[0]["DF_ID"];
                dt.Rows[i]["DF_Type"] = dt_DF.Rows[0]["DF_Type"];
            }
            else
            {
                dt.Rows[i]["DF_ID"]   = "";
                dt.Rows[i]["DF_Type"] = "";
            }
        }

        return(dt);
    }