Esempio n. 1
0
        //-----------------------------------------------------------总成零件现场是否显示维护----------------------------------------------------
        //修改
        protected void ASPxGridView2_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            ASPxComboBox ljdm       = ASPxGridView2.FindEditFormTemplateControl("comboLJDM2") as ASPxComboBox;
            ASPxCheckBox chZCXSFlag = ASPxGridView2.FindEditFormTemplateControl("chZCFlag") as ASPxCheckBox;
            string       xsFlag     = "";

            if (chZCXSFlag.Checked == true)
            {
                xsFlag = "1";
            }
            else
            {
                xsFlag = "0";
            }
            string Sql = "UPDATE ATPUBOMKZB SET SFXS='" + xsFlag + "' "
                         + " WHERE abom_comp = '" + ljdm.Value.ToString() + "'";

            dc.ExeSql(Sql);

            //记录操作start
            string logSql = "insert into atpubomkzb_log(abom_comp,zdrq,rqbegin,rqend,rqsj,yhmc,czms) "
                            + " select abom_comp,zdrq,rqbegin,rqend,sysdate,'" + theUserName + "','修改了该零件的显示属性' "
                            + " from  atpubomkzb where abom_comp='" + ljdm.Value.ToString() + "' ";

            dc.ExeSql(logSql);
            //记录操作end

            e.Cancel = true;
            ASPxGridView2.CancelEdit();
            setCondition2();
        }
Esempio n. 2
0
 protected void ASPxGridView2_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
 {
     if (!ASPxGridView2.IsNewRowEditing && ASPxGridView2.IsEditing)
     {
         ///主键不可以修改
         (ASPxGridView2.FindEditFormTemplateControl("txtSO2") as ASPxGridLookup).ClientEnabled = false;
         (ASPxGridView2.FindEditFormTemplateControl("txtJX") as ASPxTextBox).Enabled           = false;
     }
 }
Esempio n. 3
0
 protected void ASPxGridView2_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
 {
     if (!ASPxGridView2.IsNewRowEditing && ASPxGridView2.IsEditing)
     {
         //主键不可以修改
         (ASPxGridView2.FindEditFormTemplateControl("txtAlineCode") as ASPxTextBox).Enabled = false;
         ////按照之前开发的样子,生产线也不可以修改
         (ASPxGridView2.FindEditFormTemplateControl("ASPxComboBox1") as ASPxComboBox).Enabled = false;
     }
 }
Esempio n. 4
0
    //修改


    //创建EDITFORM前
    protected void ASPxGridView2_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
    {
        string    Sql = "select  distinct ljlb  as showtext from dmfjbzb";
        DataTable dt  = dc.GetTable(Sql);

        ASPxComboBox uPCode = ASPxGridView2.FindEditFormTemplateControl("ComboLJLB") as ASPxComboBox;

        uPCode.DataSource = dt;
        uPCode.TextField  = dt.Columns[0].ToString();
    }
Esempio n. 5
0
        protected void ASPxGridView2_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
        {
            string       PSql   = "select PLINE_CODE,PLINE_NAME from CODE_PRODUCT_LINE where pline_code in (select pline_code from vw_user_role_program where user_id='" + theUserId + "' and program_code='" + theProgramCode + "' and company_code='" + theCompanyCode + "')";
            DataTable    Pdt    = dc.GetTable(PSql);
            ASPxComboBox uPcode = ASPxGridView2.FindEditFormTemplateControl("txtPCode") as ASPxComboBox;

            uPcode.DataSource = Pdt;
            uPcode.TextField  = Pdt.Columns[1].ToString();
            uPcode.ValueField = Pdt.Columns[0].ToString();
        }
Esempio n. 6
0
        protected void ASPxGridView2_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            ASPxTextBox  aCode   = ASPxGridView2.FindEditFormTemplateControl("txtAlineCode") as ASPxTextBox;
            ASPxTextBox  aName   = ASPxGridView2.FindEditFormTemplateControl("txtAlineName") as ASPxTextBox;
            ASPxComboBox PlineId = ASPxGridView2.FindEditFormTemplateControl("ASPxComboBox1") as ASPxComboBox;

            string    plineCode = "";
            string    plineName = "";
            string    chSql     = "select pline_code,pline_name from code_product_line where rmes_id='" + PlineId.Value.ToString() + "'";
            dataConn  dc1       = new dataConn(chSql);
            DataTable dt1       = dc1.GetTable();

            if (dt1.Rows.Count > 0)
            {
                plineCode = dt1.Rows[0]["pline_code"].ToString();
                plineName = dt1.Rows[0]["pline_name"].ToString();
            }
            //插入到日志表
            try
            {
                string Sql2 = "INSERT INTO ATPU_ACROSSLINE_LOG (COMPANY_CODE,ALINE_CODE,ALINE_NAME,PLINE_ID,PLINE_CODE,PLINE_NAME,user_code,flag,rqsj)"
                              + " SELECT COMPANY_CODE,ALINE_CODE,ALINE_NAME,PLINE_ID,PLINE_CODE,PLINE_NAME,'"
                              + theUserCode + "' , 'BEFOREEDIT', SYSDATE FROM ATPU_ACROSSLINE WHERE COMPANY_CODE='" + theCompanyCode + "' and ALINE_CODE='"
                              + aCode.Text.Trim() + "'";
                dc.ExeSql(Sql2);
            }
            catch
            {
                return;
            }

            string upSql = "UPDATE ATPU_ACROSSLINE SET ALINE_NAME='" + aName.Text.Trim() + "',input_person='" + theUserId + "',input_time=sysdate "
                           + "  WHERE  COMPANY_CODE = '" + theCompanyCode + "' and  ALINE_CODE='" + aCode.Text.Trim() + "' and PLINE_ID='" + PlineId.Value.ToString() + "'";

            dc.ExeSql(upSql);

            //插入到日志表
            try
            {
                string Sql2 = "INSERT INTO ATPU_ACROSSLINE_LOG (COMPANY_CODE,ALINE_CODE,ALINE_NAME,PLINE_ID,PLINE_CODE,PLINE_NAME,user_code,flag,rqsj)"
                              + " SELECT COMPANY_CODE,ALINE_CODE,ALINE_NAME,PLINE_ID,PLINE_CODE,PLINE_NAME,'"
                              + theUserCode + "' , 'AFTEREDIT', SYSDATE FROM ATPU_ACROSSLINE WHERE COMPANY_CODE='" + theCompanyCode + "' and ALINE_CODE='"
                              + aCode.Text.Trim() + "'";
                dc.ExeSql(Sql2);
            }
            catch
            {
                return;
            }

            e.Cancel = true;
            ASPxGridView2.CancelEdit();
            queryFunction();
        }
Esempio n. 7
0
    //修改
    protected void ASPxGridView2_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
    {
        ASPxGridLookup uSO     = ASPxGridView2.FindEditFormTemplateControl("txtSO2") as ASPxGridLookup;
        ASPxTextBox    uJX     = ASPxGridView2.FindEditFormTemplateControl("txtJX") as ASPxTextBox;
        ASPxTextBox    uPQBAK  = ASPxGridView2.FindEditFormTemplateControl("txtPQBAK") as ASPxTextBox;
        ASPxTextBox    uREMARK = ASPxGridView2.FindEditFormTemplateControl("txtREMARK") as ASPxTextBox;

        string strSO     = uSO.Value.ToString();
        string strJX     = uJX.Text.Trim();
        string strPQBAK  = uPQBAK.Text.Trim();
        string strREMARK = uREMARK.Text.Trim();


        //插入到日志表
        try
        {
            string Sql2 = "INSERT INTO PAINT_SO_LOG (SO,TYPE_PQ,TYPE_PQBAK,REMARK,JX,user_code,flag,rqsj)"
                          + " SELECT SO,TYPE_PQ,TYPE_PQBAK,REMARK,JX,'" + theUserCode + "' , 'BEFOREEDIT', SYSDATE FROM PAINT_SO WHERE SO = '" + strSO + "' and JX= '" + strJX + "'";
            dc.ExeSql(Sql2);
        }
        catch
        {
            return;
        }

        string Sql = "UPDATE PAINT_SO SET TYPE_PQ='" + strPQBAK + "',TYPE_PQBAK='" + strPQBAK + "',REMARK='" + strREMARK + "',input_person='" + theUserId + "',input_time=sysdate"
                     + " WHERE SO = '" + strSO + "'and JX= '" + strJX + "' ";

        dc.ExeSql(Sql);

        //插入到日志表
        try
        {
            string Sql2 = "INSERT INTO PAINT_SO_LOG (SO,TYPE_PQ,TYPE_PQBAK,REMARK,JX,user_code,flag,rqsj)"
                          + " SELECT SO,TYPE_PQ,TYPE_PQBAK,REMARK,JX,'" + theUserCode + "' , 'AFTEREDIT', SYSDATE FROM PAINT_SO WHERE SO = '" + strSO + "' and JX= '" + strJX + "'";
            dc.ExeSql(Sql2);
        }
        catch
        {
            return;
        }

        e.Cancel = true;
        ASPxGridView2.CancelEdit();
        setCondition();
    }
Esempio n. 8
0
        protected void ASPxGridView2_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
        {
            string Sql = "select a.process_code  from rel_location_process a ,rel_station_location b,code_station c where c.station_code=b.station_code "
                         + " and b.location_code=a.location_code and c.station_name='" + ASPxTextSation.Text.ToUpper().Trim() + "'";
            DataTable    dt    = dc.GetTable(Sql);
            ASPxComboBox Ugxdm = ASPxGridView2.FindEditFormTemplateControl("txtGxdm") as ASPxComboBox;

            Ugxdm.DataSource = dt;
            Ugxdm.TextField  = dt.Columns[0].ToString();
            Ugxdm.ValueField = dt.Columns[0].ToString();
            //Ugxdm.SelectedIndex = Ugxdm.Items.Count >= 0 ? 0 : -1;

            if (!ASPxGridView2.IsNewRowEditing && ASPxGridView2.IsEditing)
            {
                ///主键不可以修改
                (ASPxGridView2.FindEditFormTemplateControl("txtGxdm") as ASPxComboBox).Enabled = false;
            }
        }
Esempio n. 9
0
        //创建EDITFORM前
        protected void ASPxGridView2_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
        {
            if (!ASPxGridView2.IsNewRowEditing && ASPxGridView2.IsEditing)
            {
                ///主键不可以修改
                (ASPxGridView2.FindEditFormTemplateControl("comboLJDM2") as ASPxComboBox).Enabled = false;

                //处理ASPxCheckBox
                if (ASPxGridView2.GetRowValues(ASPxGridView2.FocusedRowIndex, "SFXS").ToString() == "1")
                {
                    (ASPxGridView2.FindEditFormTemplateControl("chZCFlag") as ASPxCheckBox).Checked = true;
                }
                else
                {
                    (ASPxGridView2.FindEditFormTemplateControl("chZCFlag") as ASPxCheckBox).Checked = false;
                }
            }
        }
Esempio n. 10
0
    //修改
    protected void ASPxGridView2_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
    {
        ASPxComboBox uPCode  = ASPxGridView2.FindEditFormTemplateControl("txtPCode") as ASPxComboBox;
        ASPxTextBox  uSN     = ASPxGridView2.FindEditFormTemplateControl("txtSN") as ASPxTextBox;
        ASPxComboBox uSNflag = ASPxGridView2.FindEditFormTemplateControl("ASPxComboBox3") as ASPxComboBox;


        string strPCode  = uPCode.Value.ToString();
        string strSN     = uSN.Text.Trim();
        string strSNflag = uSNflag.Value.ToString();

        //插入到日志表
        try
        {
            string Sql2 = "INSERT INTO CODE_SN_RESERVE_LOG (RMES_ID,COMPANY_CODE,PLINE_CODE,SN,SN_FLAG,user_code,flag,rqsj)"
                          + "select RMES_ID,COMPANY_CODE,PLINE_CODE,SN,SN_FLAG,'" + theUserCode + "','DEL',SYSDATE from CODE_SN_RESERVE WHERE COMPANY_CODE = '" + theCompanyCode + "' and SN = '" + strSN + "')";
            dc.ExeSql(Sql2);
        }
        catch
        {
            return;
        }

        string Sql = "UPDATE CODE_SN_RESERVE SET PLINE_CODE='" + strPCode + "',SN='" + strSN + "',SN_FLAG='" + strSNflag + "',input_person='" + theUserId + "',input_time=sysdate "
                     + " WHERE COMPANY_CODE = '" + theCompanyCode + "' and SN = '" + strSN + "'";

        dc.ExeSql(Sql);

        //插入到日志表
        try
        {
            string Sql2 = "INSERT INTO CODE_SN_RESERVE_LOG (RMES_ID,COMPANY_CODE,PLINE_CODE,SN,SN_FLAG,user_code,flag,rqsj)"
                          + "select RMES_ID,COMPANY_CODE,PLINE_CODE,SN,SN_FLAG,'" + theUserCode + "','DEL',SYSDATE from CODE_SN_RESERVE WHERE COMPANY_CODE = '" + theCompanyCode + "' and SN = '" + strSN + "')";
            dc.ExeSql(Sql2);
        }
        catch
        {
            return;
        }

        e.Cancel = true;
        ASPxGridView2.CancelEdit();
        setCondition();
    }
Esempio n. 11
0
    //修改
    protected void ASPxGridView2_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
    {
        ASPxComboBox uJX = ASPxGridView2.FindEditFormTemplateControl("txtJX") as ASPxComboBox;

        ASPxComboBox uPD = ASPxGridView2.FindEditFormTemplateControl("txtPD") as ASPxComboBox;


        string strJX = uJX.Value.ToString();

        string strPD = uPD.Value.ToString();

        //插入到日志表
        try
        {
            string Sql2 = "INSERT INTO JWYF_LOG (JXREMARK,PANDUAN,user_code,flag,rqsj)"
                          + " SELECT JXREMARK,PANDUAN,'" + theUserCode + "' , 'BEFOREEDIT', SYSDATE FROM JWYF WHERE PANDUAN = '" + strPD + "'";
            dc.ExeSql(Sql2);
        }
        catch
        {
            return;
        }
        string Sql = "UPDATE JWYF SET PANDUAN='" + strPD + "',INPUT_PERSON='" + theUserId + "',INPUT_TIME=SYSDATE"
                     + " WHERE JXREMARK='" + strJX + "'";

        dc.ExeSql(Sql);

        //插入到日志表
        try
        {
            string Sql2 = "INSERT INTO JWYF_LOG (JXREMARK,PANDUAN,user_code,flag,rqsj)"
                          + " SELECT JXREMARK,PANDUAN,'" + theUserCode + "' , 'AFTEREDIT', SYSDATE FROM JWYF WHERE PANDUAN = '" + strPD + "'";
            dc.ExeSql(Sql2);
        }
        catch
        {
            return;
        }

        e.Cancel = true;
        ASPxGridView2.CancelEdit();
        setCondition();
    }
Esempio n. 12
0
    //修改
    protected void ASPxGridView2_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
    {
        ASPxComboBox uPCode  = ASPxGridView2.FindEditFormTemplateControl("txtPCode") as ASPxComboBox;
        ASPxTextBox  uSN     = ASPxGridView2.FindEditFormTemplateControl("txtSN") as ASPxTextBox;
        ASPxComboBox uSNflag = ASPxGridView2.FindEditFormTemplateControl("ASPxComboBox3") as ASPxComboBox;


        string strPCode  = uPCode.Value.ToString();
        string strSN     = uSN.Text.Trim();
        string strSNflag = uSNflag.Value.ToString();

        string Sql = "UPDATE CODE_SN_RESERVE SET PLINE_CODE='" + strPCode + "',SN='" + strSN + "',SN_FLAG='" + strSNflag + "' "
                     + " WHERE COMPANY_CODE = '" + theCompanyCode + "' and SN = '" + strSN + "'";

        dc.ExeSql(Sql);

        e.Cancel = true;
        ASPxGridView2.CancelEdit();
        setCondition();
    }
Esempio n. 13
0
    //创建EDITFORM前
    protected void ASPxGridView2_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
    {
        string    Sql = "select distinct a.pline_code,b.pline_name from vw_user_role_program a left join code_product_line b on a.pline_code=b.pline_code where a.user_id='" + theUserId + "' and a.program_code='" + theProgramCode + "' and a.company_code='" + theCompanyCode + "' ";
        DataTable dt  = dc.GetTable(Sql);

        ASPxComboBox uPCode = ASPxGridView2.FindEditFormTemplateControl("txtPCode") as ASPxComboBox;

        uPCode.DataSource    = dt;
        uPCode.TextField     = dt.Columns[1].ToString();
        uPCode.ValueField    = dt.Columns[0].ToString();
        uPCode.SelectedIndex = uPCode.Items.Count >= 0 ? 0 : -1;
        if (!ASPxGridView2.IsNewRowEditing && ASPxGridView2.IsEditing)
        {
            ///主键不可以修改
            (ASPxGridView2.FindEditFormTemplateControl("txtSN") as ASPxTextBox).Enabled = false;
        }
        else
        {
            //uTcode.SelectedIndex = 0;
        }
    }
Esempio n. 14
0
    protected void ASPxGridView2_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
    {
        ASPxComboBox uPCode  = ASPxGridView2.FindEditFormTemplateControl("txtPCode") as ASPxComboBox;
        ASPxTextBox  uSN     = ASPxGridView2.FindEditFormTemplateControl("txtSN") as ASPxTextBox;
        ASPxComboBox uSNflag = ASPxGridView2.FindEditFormTemplateControl("ASPxComboBox3") as ASPxComboBox;


        string strPCode  = uPCode.Value.ToString();
        string strSN     = uSN.Text.Trim();
        string strSNflag = uSNflag.Value.ToString();


        string Sql = "INSERT INTO CODE_SN_RESERVE (RMES_ID,COMPANY_CODE,PLINE_CODE,SN,SN_FLAG) "
                     + "VALUES(SEQ_RMES_ID.NextVal, '" + theCompanyCode + "','" + strPCode + "','" + strSN + "','" + strSNflag + "')";

        dc.ExeSql(Sql);

        e.Cancel = true;
        ASPxGridView2.CancelEdit();
        setCondition();
    }
Esempio n. 15
0
    //创建EDITFORM前
    protected void ASPxGridView2_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
    {
        string    Sql = "select JXREMARK,JXREMARK as showtext from JWYF";
        DataTable dt  = dc.GetTable(Sql);

        ASPxComboBox uPCode = ASPxGridView2.FindEditFormTemplateControl("txtJX") as ASPxComboBox;

        uPCode.DataSource = dt;
        uPCode.TextField  = dt.Columns[1].ToString();
        uPCode.ValueField = dt.Columns[0].ToString();

        if (!ASPxGridView2.IsNewRowEditing && ASPxGridView2.IsEditing)
        {
            ///主键不可以修改
            (ASPxGridView2.FindEditFormTemplateControl("txtJX") as ASPxComboBox).Enabled = false;
        }
        else
        {
            //uTcode.SelectedIndex = 0;
        }
    }
Esempio n. 16
0
        //新增
        protected void ASPxGridView2_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            ASPxTextBox  zcdm  = ASPxGridView2.FindEditFormTemplateControl("txtZCDM") as ASPxTextBox;
            ASPxComboBox scxdm = ASPxGridView2.FindEditFormTemplateControl("comboSCXDM") as ASPxComboBox;
            ASPxTextBox  fdjxl = ASPxGridView2.FindEditFormTemplateControl("txtFDJXL") as ASPxTextBox;

            string Sql = "INSERT INTO ATPUFZZCB (ZCDM,SCXDM,FDJXL,INPUT_PERSON,INPUT_TIME) "
                         + " VALUES ( UPPER('" + zcdm.Value.ToString() + "'),UPPER('" + scxdm.Value.ToString() + "'),UPPER('" + fdjxl.Value.ToString() + "'),'" + theUserId + "',SYSDATE) ";

            dc.ExeSql(Sql);

            //插入日志表161103
            string sql2 = "insert into ATPUFZZCB_LOG(ZCDM,SCXDM,FDJXL,USER_CODE,FLAG_LOG,RQSJ) "
                          + "VALUES(UPPER('" + zcdm.Value.ToString() + "'),UPPER('" + scxdm.Value.ToString() + "'),UPPER('" + fdjxl.Value.ToString() + "'),"
                          + "'" + theUserId + "','ADD',SYSDATE)";

            dc.ExeSql(sql2);

            e.Cancel = true;
            ASPxGridView2.CancelEdit();
            setCondition2();
        }
Esempio n. 17
0
        protected void ASPxGridView2_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            ASPxComboBox uGxdm = ASPxGridView2.FindEditFormTemplateControl("txtGxdm") as ASPxComboBox;
            ASPxTextBox  uPath = ASPxGridView2.FindEditFormTemplateControl("txtPath") as ASPxTextBox;
            ASPxTextBox  uCzts = ASPxGridView2.FindEditFormTemplateControl("txtCzts") as ASPxTextBox;
            string       gxdm  = uGxdm.Text.Trim();
            string       path  = uPath.Text.Trim();
            string       czts  = uCzts.Text.Trim();

            string    Gsql = "select plan_so,pline_code from data_plan where plan_code='" + ASPxTextPlanCode.Text.Trim() + "'";
            DataTable Gdt = dc.GetTable(Gsql);
            string    so = "", gzdd = "";

            if (Gdt.Rows.Count > 0)
            {
                so   = Gdt.Rows[0][0].ToString();
                gzdd = Gdt.Rows[0][1].ToString();
            }
            //插入到日志表
            string Lsql = "insert into RST_ATPU_ZJTS_LOG(PART,CZTS,GXDM,GZDD,JHDM,JHSO,TSTYPE,RQSJ,WJPATH,NOTE_COLOR,NOTE_FONT,EDIT_USER,EDIT_FLAG,EDIT_DATE) "
                          + "VALUES( 'LSCS', '" + czts + "','" + gxdm + "','" + gzdd + "','" + ASPxTextPlanCode.Text.Trim() + "','" + so + "','C',sysdate,'" + path + "','','','" + theUserName + "','ADD',sysdate)";

            dc.ExeSql(Lsql);
            //到正式表
            string Sql = "INSERT INTO RST_ATPU_ZJTS (PART,CZTS,GXDM,GZDD,JHDM,JHSO,TSTYPE,RQSJ,WJPATH,NOTE_COLOR,NOTE_FONT) "
                         + "VALUES( 'LSCS', '" + czts + "','" + gxdm + "','" + gzdd + "','" + ASPxTextPlanCode.Text.Trim() + "','" + so + "','C',sysdate,'" + path + "','','')";

            dc.ExeSql(Sql);

            e.Cancel = true;
            ASPxGridView2.CancelEdit();
            //if (Session["inv9501sql"] as string != "")
            //{
            //    DataTable dt2 = dc.GetTable(Session["inv9501sql"] as string);
            //    ASPxGridView2.DataSource = dt2;
            //    ASPxGridView2.DataBind();
            //}
            SetCondition();
        }
Esempio n. 18
0
    protected void ASPxGridView2_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
    {
        ASPxComboBox uPCode  = ASPxGridView2.FindEditFormTemplateControl("txtPCode") as ASPxComboBox;
        ASPxTextBox  uSN     = ASPxGridView2.FindEditFormTemplateControl("txtSN") as ASPxTextBox;
        ASPxComboBox uSNflag = ASPxGridView2.FindEditFormTemplateControl("ASPxComboBox3") as ASPxComboBox;


        string strPCode  = uPCode.Value.ToString();
        string strSN     = uSN.Text.Trim();
        string strSNflag = uSNflag.Value.ToString();

        //取RMES_ID的值
        string sql_rmes_id = "SELECT SEQ_RMES_ID.NEXTVAL FROM DUAL ";

        dc.setTheSql(sql_rmes_id);
        string rmes_id = dc.GetTable().Rows[0][0].ToString();

        string Sql = "INSERT INTO CODE_SN_RESERVE (RMES_ID,COMPANY_CODE,PLINE_CODE,SN,SN_FLAG,input_person,input_time) "
                     + "VALUES('" + rmes_id + "', '" + theCompanyCode + "','" + strPCode + "','" + strSN + "','" + strSNflag + "','" + theUserId + "',sysdate)";

        dc.ExeSql(Sql);

        //插入到日志表
        try
        {
            string Sql2 = "INSERT INTO CODE_SN_RESERVE_LOG (RMES_ID,COMPANY_CODE,PLINE_CODE,SN,SN_FLAG,user_code,flag,rqsj)"
                          + "select RMES_ID,COMPANY_CODE,PLINE_CODE,SN,SN_FLAG,'" + theUserCode + "','ADD',SYSDATE from CODE_SN_RESERVE where rmes_id='" + rmes_id + "')";
            dc.ExeSql(Sql2);
        }
        catch
        {
            return;
        }

        e.Cancel = true;
        ASPxGridView2.CancelEdit();
        setCondition();
    }
Esempio n. 19
0
    protected void ASPxGridView2_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
    {
        ASPxComboBox uLJLB = ASPxGridView2.FindEditFormTemplateControl("ComboLJLB") as ASPxComboBox;
        ASPxTextBox  uLJDM = ASPxGridView2.FindEditFormTemplateControl("TextLJDM") as ASPxTextBox;
        ASPxTextBox  uLJMC = ASPxGridView2.FindEditFormTemplateControl("TextLJMC") as ASPxTextBox;
        ASPxTextBox  uLJJC = ASPxGridView2.FindEditFormTemplateControl("TextLJJC") as ASPxTextBox;
        ASPxTextBox  uLJGG = ASPxGridView2.FindEditFormTemplateControl("TextLJGG") as ASPxTextBox;
        ASPxTextBox  uLJDW = ASPxGridView2.FindEditFormTemplateControl("TextLJDW") as ASPxTextBox;

        string strLJLB = uLJLB.Value.ToString();
        string strLJDM = uLJDM.Text.Trim();
        string strLJMC = uLJMC.Text.Trim();
        string strLJJC = uLJJC.Text.Trim();
        string strLJGG = uLJGG.Text.Trim();
        string strLJDW = uLJDW.Text.Trim();

        string Sql = "INSERT INTO DMFJBZB (LJDM,LJMC,LJJC,LJGG,LJDW,LJLB,INPUT_PERSON,INPUT_TIME) "
                     + "VALUES('" + strLJDM + "', '" + strLJMC + "','" + strLJJC + "','" + strLJGG + "','" + strLJDW + "','" + strLJLB + "','" + theUserCode + "',sysdate)";

        dc.ExeSql(Sql);

        //插入到日志表
        try
        {
            string Sql2 = "INSERT INTO DMFJBZB_LOG (LJDM,LJMC,LJJC,LJGG,LJDW,LJLB,user_code,flag,rqsj)"
                          + " SELECT LJDM,LJMC,LJJC,LJGG,LJDW,LJLB,'" + theUserCode + "' , 'ADD', SYSDATE FROM DMFJBZB WHERE LJDM = '" + strLJDM + "'";
            dc.ExeSql(Sql2);
        }
        catch
        {
            return;
        }

        e.Cancel = true;
        ASPxGridView2.CancelEdit();
        setCondition();
    }