示例#1
0
        //删除
        protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            //判断当前记录是否可以删除
            string   strPART      = e.Values["PART"].ToString();
            string   strPCode     = e.Values["GZDD"].ToString();
            string   strTableName = "atpubkflpart";
            dataConn theDataConn  = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strPART + "') from dual");

            theDataConn.OpenConn();
            string theRet = theDataConn.GetValue();

            if (theRet != "Y")
            {
                ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete");
                ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet);
                theDataConn.CloseConn();
            }
            else
            {
                //确认删除
                string Sql = "delete from atpubkflpart where part='" + strPART + "' and gzdd='" + strPCode + "' ";
                dc.ExeSql(Sql);
            }
            setCondition();
            e.Cancel = true;
        }
示例#2
0
        //删除
        protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            //判断当前记录是否可以删除
            string strCode      = e.Values["SO"].ToString();
            string strTableName = "ATPUSOTJB";

            dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strCode + "') from dual");

            theDataConn.OpenConn();
            string theRet = theDataConn.GetValue();

            if (theRet != "Y")
            {
                ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete");
                ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet);
                theDataConn.CloseConn();
            }
            else
            {
                //插入日志表
                string logSql = "INSERT INTO ATPUSOTJLOG (SO,TJLX,YHMC,RQSJ,CZSM) "
                                + "VALUES( '" + e.Values["SO"].ToString() + "','" + e.Values["TJLX"].ToString() + "','" + theUserName + "',sysdate,'DEL')";
                dc.ExeSql(logSql);
                //确认删除
                string Sql = "delete from ATPUSOTJB WHERE  SO =  '" + strCode + "'";
                dc.ExeSql(Sql);
            }

            e.Cancel = true;
            setCondition();
        }
示例#3
0
    //删除
    protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
    {
        //判断当前记录是否可以删除
        string strCode      = e.Values["RMES_ID"].ToString();
        string strSSeq      = e.Values["STATION_SEQ"].ToString();
        string strPCode     = e.Values["PLINE_CODE"].ToString();
        string strTableName = "CODE_STATION";

        dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strCode + "') from dual");

        theDataConn.OpenConn();
        string theRet = theDataConn.GetValue();

        if (theRet != "Y")
        {
            ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete");
            ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet);
            theDataConn.CloseConn();
        }
        else
        {
            //确认删除
            string Sql = "delete from CODE_STATION WHERE  COMPANY_CODE = '" + theCompanyCode + "' and RMES_ID = '" + strCode + "' AND PLINE_CODE='" + strPCode + "' ";
            dc.ExeSql(Sql);
            string UpSql = "UPDATE CODE_STATION SET STATION_SEQ = STATION_SEQ-1 WHERE COMPANY_CODE = '" + theCompanyCode + "'and STATION_SEQ >= '" + strSSeq + "' AND PLINE_CODE='" + strPCode + "' ";
            dc.ExeSql(UpSql);
        }


        setCondition();
        e.Cancel = true;
    }
示例#4
0
        //删除
        protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            //判断当前记录是否可以删除
            string   strMCode     = e.Values["MATERIAL_CODE"].ToString();
            string   strPCode     = e.Values["GZDD"].ToString();
            string   strOLocation = e.Values["ONLINE_LOCATION"].ToString();
            string   strQadsite   = e.Values["QADSITE"].ToString();
            string   strTableName = "ms_single_mat_inner";
            string   flag         = e.Values["FLAG"].ToString();
            dataConn theDataConn  = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strMCode + "') from dual");

            theDataConn.OpenConn();
            string theRet = theDataConn.GetValue();

            //弹框提示已经计算的不能删除
            if (flag == "Y")
            {
                ASPxGridView1.JSProperties.Add("cpCallbackName", "Fail");
                ASPxGridView1.JSProperties.Add("cpCallbackRet", "已经计算的不能删除!");
            }
            else if (theRet != "Y")
            {
                ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete");
                ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet);
                theDataConn.CloseConn();
            }
            else
            {
                //确认删除
                string Sql = "delete from ms_single_mat_inner where material_code='" + strMCode + "' and ONLINE_LOCATION='" + strOLocation + "' and flag='N' and gzdd='" + strPCode + "' and qadsite='" + strQadsite + "'";
                dc.ExeSql(Sql);
            }
            setCondition();
            e.Cancel = true;
        }
示例#5
0
        protected void BtnUpdate1_Click(object sender, EventArgs e)
        {
            try
            {
                int count1 = ASPxGridView1.Selection.Count;
                if (count1 != 1)
                {
                    showAlert(this, "请选择单条处理!");
                    return;
                }
                List <object> aa  = ASPxGridView1.GetSelectedFieldValues("RMES_ID");
                string        sql = "select count(1) from data_process_note where rmes_id='" + aa[0] + "' and (note_type='C' or note_type='D' or note_type='E')";
                if (dc.GetValue(sql) == "0")
                {
                    showAlert(this, "待处理数据类型错误,只能选择so、组件相关装机提示!");
                    return;
                }

                dataConn theDataConn = new dataConn();
                theDataConn.theComd.CommandType = CommandType.StoredProcedure;
                theDataConn.theComd.CommandText = "MW_UPDATE_ZJTS";
                theDataConn.theComd.Parameters.Add("TYPE1", OracleDbType.Varchar2).Value   = "ONE";
                theDataConn.theComd.Parameters.Add("RMESID1", OracleDbType.Varchar2).Value = aa[0];
                theDataConn.OpenConn();
                theDataConn.theComd.ExecuteNonQuery();
                theDataConn.CloseConn();
                showAlert(this, "处理成功!");
            }
            catch (Exception e1)
            {
                showAlert(this, e1.Message.ToString());
            }
        }
示例#6
0
    protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
    {
        //判断当前记录是否可以删除
        string strDelCode   = e.Values["VENDOR_CODE"].ToString();
        string strTableName = "CODE_VENDOR";

        dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strDelCode + "') from dual");

        theDataConn.OpenConn();
        string theRet = theDataConn.GetValue();

        if (theRet != "Y")
        {
            ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete");
            ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet);
            theDataConn.CloseConn();
        }
        else
        {
            //删除操作
            string Sql = "delete from CODE_VENDOR WHERE  COMPANY_CODE = '" + theCompanyCode + "' and VENDOR_CODE = '" + strDelCode + "'";
            dc.ExeSql(Sql);
        }


        setCondition();
        e.Cancel = true;
    }
示例#7
0
        protected void cmdReplaceByPlan_Click(object sender, EventArgs e)
        {
            //按计划替换
            userManager theUserManager = (userManager)Session["theUserManager"];
            string      userName       = theUserManager.getUserName();

            dataConn theDataConn = new dataConn();

            theDataConn.theComd.CommandType = CommandType.StoredProcedure;
            theDataConn.theComd.CommandText = "MW_HANDLE_LJTH";

            theDataConn.theComd.Parameters.Add("JHRQ1", OracleDbType.Varchar2).Value           = dtRq.Text;
            theDataConn.theComd.Parameters.Add("JHDM1", OracleDbType.Varchar2).Value           = Session["planCode"].ToString();
            theDataConn.theComd.Parameters.Add("JHSO1", OracleDbType.Varchar2).Value           = Session["so"].ToString();
            theDataConn.theComd.Parameters.Add("GZDD1", OracleDbType.Varchar2).Value           = cmbPline.Value.ToString();
            theDataConn.theComd.Parameters.Add("USER1", OracleDbType.Varchar2).Value           = userName;
            theDataConn.theComd.Parameters.Add("THRQBS1", OracleDbType.Varchar2).Value         = "0";
            theDataConn.theComd.Parameters.Add("THLXBS1", OracleDbType.Varchar2).Value         = "0";
            theDataConn.theComd.Parameters.Add("OUTSTR1", OracleDbType.Varchar2, 50).Direction = ParameterDirection.Output;
            theDataConn.OpenConn();
            theDataConn.theComd.ExecuteNonQuery();

            string retVal = theDataConn.theComd.Parameters["OUTSTR1"].Value.ToString();

            theDataConn.CloseConn();

            if (retVal == "0")
            {
                showAlert(this, "处理完毕,请到手工处理界面检查需手工处理部分!");
            }
            else
            {
                showAlert(this, retVal);
            }
        }
示例#8
0
        protected void cmdReplaceByPlan_Click(object sender, EventArgs e)
        {
            //按计划替换
            userManager theUserManager = (userManager)Session["theUserManager"];
            string      userName       = theUserManager.getUserName();

            dataConn theDataConn = new dataConn();

            theDataConn.theComd.CommandType = CommandType.StoredProcedure;
            theDataConn.theComd.CommandText = "MW_HANDLE_LJTH";

            theDataConn.theComd.Parameters.Add("JHRQ1", OracleDbType.Varchar2).Value           = dtRq.Text;
            theDataConn.theComd.Parameters.Add("JHDM1", OracleDbType.Varchar2).Value           = gridPlan.SelectedItem.GetValue("PLAN_CODE");
            theDataConn.theComd.Parameters.Add("JHSO1", OracleDbType.Varchar2).Value           = gridPlan.SelectedItem.GetValue("PLAN_SO");
            theDataConn.theComd.Parameters.Add("GZDD1", OracleDbType.Varchar2).Value           = cmbPline.Value.ToString();
            theDataConn.theComd.Parameters.Add("USER1", OracleDbType.Varchar2).Value           = userName;
            theDataConn.theComd.Parameters.Add("THRQBS1", OracleDbType.Varchar2).Value         = "0";
            theDataConn.theComd.Parameters.Add("THLXBS1", OracleDbType.Varchar2).Value         = "0";
            theDataConn.theComd.Parameters.Add("OUTSTR1", OracleDbType.Varchar2, 50).Direction = ParameterDirection.Output;
            theDataConn.OpenConn();
            theDataConn.theComd.ExecuteNonQuery();

            string retVal = theDataConn.theComd.Parameters["OUTSTR1"].Value.ToString();

            theDataConn.CloseConn();

            if (retVal == "0")
            {
                Response.Write("<script>alert('处理完毕,请到手工处理界面检查需手工处理部分!');</script>");
            }
            else
            {
                Response.Write("<script>alert('" + retVal + "');</script>");
            }
        }
示例#9
0
        //删除
        protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            //判断当前记录是否可以删除
            string strD = e.Values["ABOM_COMP"].ToString();

            string strTableName = "ATPUBOMKZB";

            dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','MES','MES','MES','MES','" + strD + "') from dual");

            theDataConn.OpenConn();
            string theRet = theDataConn.GetValue();

            if (theRet != "Y")
            {
                ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete");
                ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet);
                theDataConn.CloseConn();
            }
            else
            {
                //记录操作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='" + strD + "'";
                dc.ExeSql(logSql);
                //记录操作end

                //确认删除
                string Sql = "delete from ATPUBOMKZB WHERE  ABOM_COMP =  '" + strD + "' ";
                dc.ExeSql(Sql);
            }
            e.Cancel = true;
            setCondition1();
        }
示例#10
0
    protected void ASPxTreeList1_VirtualModeCreateChildren(object sender, DevExpress.Web.ASPxTreeList.TreeListVirtualModeCreateChildrenEventArgs e)
    {
        string ids = "";
        int    n   = 0;

        if (e.NodeObject == null)
        {
            this.thesql = "select distinct t.fault_group_code as id,a.fault_group_name as name from rmes_rel_station_faultgroup t left join code_fault_group a on a.fault_group_code = t.fault_group_code where t.company_code='01' order by a.fault_group_name";
        }
        else
        {
            ids = ((string[])e.NodeObject)[0];
            char[]   sep1 = { '_' };
            string[] arr  = ids.Split(sep1);
            n = arr.Length;
            switch (n)
            {
            case 1:
                this.thesql = "select t.fault_place_code as id,a.fault_place_name as name from rmes_rel_group_faultplace t left join code_fault_place a on a.fault_place_code = t.fault_place_code where t.company_code='01' and t.fault_group_code='" + arr[0] + "' order by a.fault_place_name";
                break;

            case 2:
                this.thesql = "select t.fault_part_code as id,a.fault_part_name as name from rmes_rel_faultplace_faultpart t left join code_fault_part a on a.fault_part_code = t.fault_part_code where t.company_code='01' and t.pline_type_code in (select x.pline_type_code from code_fault_group x where x.fault_group_code='" + arr[0] + "') and t.fault_group_code='" + arr[0] + "' and t.fault_place_code='" + arr[1] + "' order by a.fault_part_name";
                break;

            case 3:
                this.thesql = "select t.fault_code as id,a.fault_name as name from rmes_rel_faultpart_fault t left join code_fault a on a.fault_code = t.fault_code where t.company_code='01' and t.pline_type_code in (select x.pline_type_code from code_fault_group x where x.fault_group_code='" + arr[0] + "') and t.fault_group_code='" + arr[0] + "' and t.fault_place_code='" + arr[1] + "' and t.fault_part_code = '" + arr[2] + "' order by a.fault_name";
                break;

            default:
                this.thesql = "";
                break;
            }
        }
        //string retStr = "";
        List <string[]> children = new List <string[]>();

        if (this.thesql != string.Empty)
        {
            dataConn dc = new dataConn();
            dc.OpenConn();
            dc.theComd.CommandType = CommandType.Text;
            dc.theComd.CommandText = thesql;

            OracleDataReader dr     = dc.theComd.ExecuteReader();
            string           prefix = (ids == string.Empty) ? "" : (ids + "_");
            while (dr.Read())
            {
                children.Add(new string[] { prefix + dr["id"].ToString(), dr["name"].ToString() });
            }
            dr.Close();
            e.Children = children;
        }
    }
示例#11
0
        protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            //判断当前记录是否可以删除
            string strDelCode = e.Values["XH"].ToString();
            string ljlb = e.Values["ZYLJLB"].ToString();
            string strTableName = "";
            if (ljlb == "装配重要零件")
            {
                strTableName = "DMZYLJB";
            }
            else
            {
                strTableName = "DMJCLJB";
            }
            dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strDelCode + "') from dual");

            theDataConn.OpenConn();
            string theRet = theDataConn.GetValue();
            if (theRet != "Y")
            {
                ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete");
                ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet);
                theDataConn.CloseConn();
            }
            else
            {
                //插入到日志表
                try
                {
                    if (strTableName == "DMZYLJB")
                    {
                        string Sql2 = "INSERT INTO DMZYLJB_LOG (LJDM,LJMC,XH,GZDD,LJLB,user_code,flag,rqsj)"
                            + " SELECT LJDM,LJMC,XH,GZDD,LJLB,'" + theUserCode + "' , 'DEL', SYSDATE FROM DMZYLJB WHERE XH = '" + strDelCode + "'";
                        dc.ExeSql(Sql2);
                    }
                    if (strTableName == "DMJCLJB")
                    {
                        string Sql2 = "INSERT INTO DMJCLJB_LOG (LJDM,LJMC,XH,GZDD,user_code,flag,rqsj)"
                            + " SELECT LJDM,LJMC,XH,GZDD,LJLB,'" + theUserCode + "' , 'DEL', SYSDATE FROM DMJCLJB WHERE XH = '" + strDelCode + "'";
                        dc.ExeSql(Sql2);
                    }
                }
                catch
                {
                    return;
                }
                //确认删除
                string Sql = "delete from " + strTableName + " WHERE   XH = '" + strDelCode + "'";
                dc.ExeSql(Sql);
            }
            setCondition();
            e.Cancel = true;
        }
示例#12
0
    //删除
    protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
    {
        //判断当前记录是否可以删除
        string strCode      = e.Values["RMES_ID"].ToString();
        string strTableName = "CODE_SN";

        dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strCode + "') from dual");

        theDataConn.OpenConn();
        string theRet = theDataConn.GetValue();

        if (theRet != "Y")
        {
            ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete");
            ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet);
            theDataConn.CloseConn();
        }
        else
        {
            //确认删除
            //插入到日志表20161101
            try
            {
                string Sql1 = " SELECT * FROM CODE_SN WHERE rmes_id='" + strCode + "'";
                dc.setTheSql(Sql1);
                string rmes_id       = dc.GetTable().Rows[0]["RMES_ID"].ToString();
                string company_code  = dc.GetTable().Rows[0]["COMPANY_CODE"].ToString();
                string pline_code    = dc.GetTable().Rows[0]["PLINE_CODE"].ToString();
                string INITIAL_VALUE = dc.GetTable().Rows[0]["INITIAL_VALUE"].ToString();
                string CURRENT_VALUE = dc.GetTable().Rows[0]["CURRENT_VALUE"].ToString();
                string MAX_VALUE     = dc.GetTable().Rows[0]["MAX_VALUE"].ToString();
                string INCREASE_FLAG = dc.GetTable().Rows[0]["INCREASE_FLAG"].ToString();
                string ENABLE_FLAG   = dc.GetTable().Rows[0]["ENABLE_FLAG"].ToString();
                string WARNING_VALUE = dc.GetTable().Rows[0]["WARNING_VALUE"].ToString();
                string VENDER_CODE   = dc.GetTable().Rows[0]["VENDER_CODE"].ToString();

                string Sql2 = "INSERT INTO CODE_SN_LOG (RMES_ID,COMPANY_CODE,PLINE_CODE,INITIAL_VALUE,CURRENT_VALUE,MAX_VALUE,INCREASE_FLAG,ENABLE_FLAG,WARNING_VALUE,VENDER_CODE,user_code,flag,rqsj)"
                              + "VALUES('" + rmes_id + "','" + theCompanyCode + "','" + pline_code + "','" + INITIAL_VALUE + "','" + CURRENT_VALUE + "','" + MAX_VALUE + "','" + INCREASE_FLAG + "','" + ENABLE_FLAG + "','" + WARNING_VALUE + "','" + VENDER_CODE + "','" + theUserCode + "','DEL',SYSDATE)";
                dc.ExeSql(Sql2);
            }
            catch
            {
                return;
            }

            string Sql = "delete from CODE_SN WHERE  COMPANY_CODE = '" + theCompanyCode + "' and RMES_ID = '" + strCode + "'";
            dc.ExeSql(Sql);
        }


        setCondition();
        e.Cancel = true;
    }
示例#13
0
    protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
    {
        //判断当前记录是否可以删除
        string strDelCode   = e.Values["RMES_ID"].ToString();
        string strTableName = "DATA_ROUNTING_REMARK";

        dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strDelCode + "') from dual");

        theDataConn.OpenConn();
        string theRet = theDataConn.GetValue();

        if (theRet != "Y")
        {
            ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete");
            ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet);
            theDataConn.CloseConn();
        }
        else
        {
            //插入到日志表
            try
            {
                string Sql1 = " SELECT * FROM DATA_ROUNTING_REMARK WHERE rmes_id='" + strDelCode + "'";
                dc.setTheSql(Sql1);
                string rmes_id         = dc.GetTable().Rows[0]["RMES_ID"].ToString();
                string company_code    = dc.GetTable().Rows[0]["COMPANY_CODE"].ToString();
                string ROUNTING_REMARK = dc.GetTable().Rows[0]["ROUNTING_REMARK"].ToString();
                string PLINE_CODE      = dc.GetTable().Rows[0]["PLINE_CODE"].ToString();
                string GS    = dc.GetTable().Rows[0]["GS"].ToString();
                string XL    = dc.GetTable().Rows[0]["XL"].ToString();
                string PL    = dc.GetTable().Rows[0]["PL"].ToString();
                string RL    = dc.GetTable().Rows[0]["RL"].ToString();
                string ISDK  = dc.GetTable().Rows[0]["ISDK"].ToString();
                string ISEGR = dc.GetTable().Rows[0]["ISEGR"].ToString();

                string Sql2 = "INSERT INTO DATA_ROUNTING_REMARK_LOG (RMES_ID,COMPANY_CODE,rounting_remark,pline_code,gs,xl,pl,rl,isdk,isegr,user_code,flag,rqsj)"
                              + "VALUES('" + strDelCode + "','" + theCompanyCode + "','" + ROUNTING_REMARK + "','" + PLINE_CODE + "','" + GS + "','" + XL + "','" + PL + "','" + RL + "','" + ISDK + "','" + ISEGR + "','" + theUserCode + "','DEL',SYSDATE)";
                dc.ExeSql(Sql2);
            }
            catch
            {
                return;
            }
            //确认删除
            string Sql = "delete from DATA_ROUNTING_REMARK WHERE RMES_ID = '" + strDelCode + "'";
            dc.ExeSql(Sql);
        }


        setCondition();
        e.Cancel = true;
    }
示例#14
0
    protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
    {
        //判断当前记录是否可以删除
        string strDelCode   = e.Values["SO"].ToString();
        string strTableName = "ATPUEPAINTPROCOLOR";

        dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strDelCode + "') from dual");

        theDataConn.OpenConn();
        string theRet = theDataConn.GetValue();

        if (theRet != "Y")
        {
            ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete");
            ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet);
            theDataConn.CloseConn();
        }
        else
        {
            //插入到日志表
            try
            {
                string Sql1 = " SELECT * FROM ATPUEPAINTPROCOLOR WHERE SO='" + strDelCode + "'";
                dc.setTheSql(Sql1);
                string SITE  = dc.GetTable().Rows[0]["SITE"].ToString();
                string PROC  = dc.GetTable().Rows[0]["PROC"].ToString();
                string COLOR = dc.GetTable().Rows[0]["COLOR"].ToString();

                string Sql2 = "INSERT INTO ATPUEPAINTPROCOLOR_LOG(SO,SITE,PROC,COLOR,USER_CODE,FLAG,RQSJ)"
                              + "VALUES('" + strDelCode + "','" + SITE + "','" + PROC + "','" + COLOR + "','" + theUserCode + "','DEL',SYSDATE)";
                dc.ExeSql(Sql2);
            }
            catch
            {
                return;
            }
            //确认删除
            string Sql = "delete from ATPUEPAINTPROCOLOR WHERE   SO = '" + strDelCode + "'";
            dc.ExeSql(Sql);
        }


        setCondition();
        e.Cancel = true;
    }
示例#15
0
 protected void BtnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
         dataConn theDataConn = new dataConn();
         theDataConn.theComd.CommandType = CommandType.StoredProcedure;
         theDataConn.theComd.CommandText = "MW_UPDATE_ZJTS";
         theDataConn.theComd.Parameters.Add("TYPE1", OracleDbType.Varchar2).Value   = "ALL";
         theDataConn.theComd.Parameters.Add("RMESID1", OracleDbType.Varchar2).Value = "";
         theDataConn.OpenConn();
         theDataConn.theComd.ExecuteNonQuery();
         theDataConn.CloseConn();
         showAlert(this, "处理成功!");
     }
     catch (Exception e1)
     {
         showAlert(this, e1.Message.ToString());
     }
 }
示例#16
0
    //删除
    protected void ASPxGridView2_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
    {
        //判断当前记录是否可以删除
        string   strJX        = e.Values["JXREMARK"].ToString();
        string   strPD        = e.Values["PANDUAN"].ToString();
        string   strTableName = "JWYF";
        dataConn theDataConn  = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strJX + "') from dual");



        theDataConn.OpenConn();
        string theRet = theDataConn.GetValue();

        if (theRet != "Y")
        {
            ASPxGridView2.JSProperties.Add("cpCallbackName", "Delete");
            ASPxGridView2.JSProperties.Add("cpCallbackRet", theRet);
            theDataConn.CloseConn();
        }
        else
        {
            //插入到日志表
            try
            {
                string Sql2 = "INSERT INTO JWYF_LOG (JXREMARK,PANDUAN,user_code,flag,rqsj)"
                              + " SELECT JXREMARK,PANDUAN,'" + theUserCode + "' , 'DEL', SYSDATE FROM JWYF WHERE PANDUAN = '" + strPD + "'";
                dc.ExeSql(Sql2);
            }
            catch
            {
                return;
            }

            //确认删除
            string Sql = "delete from JWYF WHERE JXREMARK = '" + strJX + "'and PANDUAN = '" + strPD + "'";
            dc.ExeSql(Sql);
        }


        setCondition();
        e.Cancel = true;
    }
示例#17
0
        protected void ASPxGridView2_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            //判断当前记录是否可以删除
            string strDelCode   = e.Values["PART"].ToString();
            string strCzts      = e.Values["CZTS"].ToString();
            string strGxdm      = e.Values["GXDM"].ToString();
            string strPlancode  = e.Values["JHDM"].ToString();
            string strType      = e.Values["TSTYPE"].ToString();
            string strTableName = "RST_ATPU_ZJTS";

            dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strCzts + "') from dual");

            theDataConn.OpenConn();
            string theRet = theDataConn.GetValue();

            if (theRet != "Y")
            {
                ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete");
                ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet);
                theDataConn.CloseConn();
            }
            else
            {
                //确认删除
                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)select PART,CZTS,GXDM,GZDD,JHDM,JHSO,TSTYPE,RQSJ,WJPATH,NOTE_COLOR,NOTE_FONT, "
                              + "'" + theUserName + "','DEL',SYSDATE FROM RST_ATPU_ZJTS WHERE PART = '" + strDelCode + "' and CZTS='" + strCzts + "' and GXDM='" + strGxdm + "' and JHDM='" + strPlancode + "' and TSTYPE='" + strType + "'";
                dc.ExeSql(Lsql);
                string Sql = "delete from RST_ATPU_ZJTS WHERE PART = '" + strDelCode + "' and CZTS='" + strCzts + "' and GXDM='" + strGxdm + "' and JHDM='" + strPlancode + "' and TSTYPE='" + strType + "'";
                dc.ExeSql(Sql);
            }


            //if (Session["inv9501sql"] as string != "")
            //{
            //    DataTable dt2 = dc.GetTable(Session["inv9501sql"] as string);
            //    ASPxGridView2.DataSource = dt2;
            //    ASPxGridView2.DataBind();
            //}
            SetCondition();
            e.Cancel = true;
        }
示例#18
0
        protected void ASPxGridView1_RowDeleting1(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            //判断当前记录是否可以删除
            string dPLine       = e.Values["GZDD"].ToString();
            string dZddm        = e.Values["ZDMC"].ToString();
            string dLjdm        = e.Values["LJDM"].ToString();
            string strTableName = "ATPUZDLJMLB";

            dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','MES','MES','" + dPLine + "','" + dZddm + "','" + dLjdm + "') from dual");

            theDataConn.OpenConn();
            string theRet = theDataConn.GetValue();

            if (theRet != "Y")
            {
                ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete");
                ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet);
                theDataConn.CloseConn();
            }
            else
            {
                //插入到日志表
                try
                {
                    string Sql2 = "INSERT INTO ATPUZDLJMLB_LOG (GZDD,SO,ZDDM,ZDMC,LJDM,LJMC,user_code,flag,rqsj,PART_ABC)"
                                  + " SELECT GZDD,SO,ZDDM,ZDMC,LJDM,LJMC,'" + theUserCode + "' , 'DEL', SYSDATE,PART_ABC FROM ATPUZDLJMLB "
                                  + "WHERE  GZDD =  '" + dPLine + "' and ZDMC =  '" + dZddm + "' and LJDM =  '" + dLjdm + "'";
                    dc.ExeSql(Sql2);
                }
                catch
                {
                    return;
                }
                //确认删除
                string Sql = "delete from ATPUZDLJMLB WHERE   GZDD =  '" + dPLine + "' and ZDMC =  '" + dZddm + "' and LJDM =  '" + dLjdm + "'";
                dc.ExeSql(Sql);
            }

            e.Cancel = true;
            setCondition();
        }
示例#19
0
        protected void ASPxGridView2_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            //判断当前记录是否可以删除
            string dPLine = e.Values["PLINE_CODE"].ToString();

            string dLjmc        = e.Values["ABOM_DESC"].ToString();
            string strTableName = "ATPUSMLJB";

            dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','MES','MES','MES','MES','" + dLjmc + "') from dual");

            theDataConn.OpenConn();
            string theRet = theDataConn.GetValue();

            if (theRet != "Y")
            {
                ASPxGridView2.JSProperties.Add("cpCallbackName", "Delete");
                ASPxGridView2.JSProperties.Add("cpCallbackRet", theRet);
                theDataConn.CloseConn();
            }
            else
            {
                //插入到日志表
                try
                {
                    string Sql2 = "INSERT INTO ATPUSMLJB_LOG (PLINE_CODE,ABOM_DESC,PART_ABC,user_code,flag,rqsj)"
                                  + " SELECT PLINE_CODE,ABOM_DESC,PART_ABC,'" + theUserCode + "' , 'DEL', SYSDATE FROM ATPUSMLJB "
                                  + "WHERE  PLINE_CODE =  '" + dPLine + "' and ABOM_DESC =  '" + dLjmc + "'";
                    dc.ExeSql(Sql2);
                }
                catch
                {
                    return;
                }
                //确认删除
                string Sql = "delete from ATPUSMLJB WHERE   PLINE_CODE =  '" + dPLine + "' and ABOM_DESC =  '" + dLjmc + "'";
                dc.ExeSql(Sql);
            }

            setCondition();
            e.Cancel = true;
        }
示例#20
0
    protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
    {
        //判断当前记录是否可以删除
        string strDelCode   = e.Values["FDJJX"].ToString();
        string strDelCode2  = e.Values["SC"].ToString();
        string strTableName = "ATPUEMARK";

        dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strDelCode + "') from dual");

        theDataConn.OpenConn();
        string theRet = theDataConn.GetValue();

        if (theRet != "Y")
        {
            ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete");
            ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet);
            theDataConn.CloseConn();
        }
        else
        {
            //插入到日志表
            try
            {
                string Sql2 = "INSERT INTO ATPUEMARK_LOG (FDJJX,SC,RZZS1,RZZS2,RZZS3,RZG,SFMRZ,WHRQ,RYDM,user_code,flag,rqsj)"
                              + " SELECT FDJJX,SC,RZZS1,RZZS2,RZZS3,RZG,SFMRZ,WHRQ,RYDM,'" + theUserCode + "' , 'DEL', SYSDATE FROM ATPUEMARK WHERE FDJJX = '" + strDelCode + "' and SC = '" + strDelCode2 + "'";
                dc.ExeSql(Sql2);
            }
            catch
            {
                return;
            }
            //确认删除
            string Sql = "delete from ATPUEMARK WHERE   FDJJX = '" + strDelCode + "' and SC = '" + strDelCode2 + "'";
            dc.ExeSql(Sql);
        }


        setCondition();
        e.Cancel = true;
    }
示例#21
0
    //删除
    protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
    {
        //判断当前记录是否可以删除
        string strCode      = e.Values["SO"].ToString();
        string strTableName = "JWTCMSO";

        dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strCode + "') from dual");

        theDataConn.OpenConn();
        string theRet = theDataConn.GetValue();

        if (theRet != "Y")
        {
            ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete");
            ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet);
            theDataConn.CloseConn();
        }
        else
        {
            //插入到日志表
            try
            {
                string Sql2 = "INSERT INTO JWTCMSO_LOG (PLINE_CODE,SO,JX,TCL,TCL1,REMARK,GNUM,user_code,flag,rqsj)"
                              + " SELECT PLINE_CODE,SO,JX,TCL,TCL1,REMARK,GNUM,'" + theUserCode + "' , 'DEL', SYSDATE FROM JWTCMSO WHERE SO = '" + strCode + "'";
                dc.ExeSql(Sql2);
            }
            catch
            {
                return;
            }

            //确认删除
            string Sql = "delete from JWTCMSO WHERE SO = '" + strCode + "'";
            dc.ExeSql(Sql);
        }


        setCondition();
        e.Cancel = true;
    }
示例#22
0
    //删除
    protected void ASPxGridView2_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
    {
        //判断当前记录是否可以删除
        string strCode      = e.Values["RMES_ID"].ToString();
        string strTableName = "CODE_SN_RESERVE";

        dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strCode + "') from dual");

        theDataConn.OpenConn();
        string theRet = theDataConn.GetValue();

        if (theRet != "Y")
        {
            ASPxGridView2.JSProperties.Add("cpCallbackName", "Delete");
            ASPxGridView2.JSProperties.Add("cpCallbackRet", theRet);
            theDataConn.CloseConn();
        }
        else
        {
            //插入到日志表
            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 rmes_id='" + strCode + "')";
                dc.ExeSql(Sql2);
            }
            catch
            {
                return;
            }

            //确认删除
            string Sql = "delete from CODE_SN_RESERVE WHERE  COMPANY_CODE = '" + theCompanyCode + "' and RMES_ID = '" + strCode + "'";
            dc.ExeSql(Sql);
        }


        setCondition();
        e.Cancel = true;
    }
示例#23
0
    protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
    {
        //判断当前记录是否可以删除
        string strDelCode   = e.Values["XH"].ToString();
        string strTableName = "ATPUFLGJTHZQB";

        dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strDelCode + "') from dual");

        theDataConn.OpenConn();
        string theRet = theDataConn.GetValue();

        if (theRet != "Y")
        {
            ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete");
            ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet);
            theDataConn.CloseConn();
        }
        else
        {
            //插入到日志表
            try
            {
                string Sql2 = "INSERT INTO ATPUFLGJTHZQB_LOG (XH,LOCATION_CODE,LOCATION_NAME,LJJ,CYCLE,BZ,user_code,flag,rqsj)"
                              + " SELECT XH,LOCATION_CODE,LOCATION_NAME,LJJ,CYCLE,BZ,'" + theUserCode + "' , 'DEL', SYSDATE FROM ATPUFLGJTHZQB WHERE XH = '" + strDelCode + "' ";
                dc.ExeSql(Sql2);
            }
            catch
            {
                return;
            }

            //确认删除
            string Sql = "delete from ATPUFLGJTHZQB WHERE   XH = '" + strDelCode + "'";
            dc.ExeSql(Sql);
        }


        setCondition();
        e.Cancel = true;
    }
示例#24
0
    protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
    {
        //判断当前记录是否可以删除
        string strDelCode = e.Values["SO"].ToString();

        string strTableName = "ATPUKHTM";

        dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strDelCode + "') from dual");

        theDataConn.OpenConn();
        string theRet = theDataConn.GetValue();

        if (theRet != "Y")
        {
            ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete");
            ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet);
            theDataConn.CloseConn();
        }
        else
        {
            //插入到日志表
            try
            {
                string Sql2 = "INSERT INTO ATPUKHTM_LOG (khmc,khh,wlh,gysdm,sn,so,bbh,user_code,flag,rqsj)"
                              + " SELECT khmc,khh,wlh,gysdm,sn,so,bbh,'" + theUserCode + "' , 'DEL', SYSDATE FROM ATPUKHTM WHERE SO = '" + strDelCode + "' AND KHMC = '" + e.Values["KHMC"] + "' ";
                dc.ExeSql(Sql2);
            }
            catch
            {
                return;
            }
            //确认删除
            string Sql = "delete from ATPUKHTM WHERE   SO = '" + strDelCode + "' and KHMC = '" + e.Values["KHMC"] + "'";
            dc.ExeSql(Sql);
        }


        setCondition();
        e.Cancel = true;
    }
示例#25
0
    //删除
    protected void ASPxGridView2_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
    {
        //判断当前记录是否可以删除
        string strDM        = e.Values["LJDM"].ToString();
        string strTableName = "DMFJBZB";

        dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strDM + "') from dual");

        theDataConn.OpenConn();
        string theRet = theDataConn.GetValue();

        if (theRet != "Y")
        {
            ASPxGridView2.JSProperties.Add("cpCallbackName", "Delete");
            ASPxGridView2.JSProperties.Add("cpCallbackRet", theRet);
            theDataConn.CloseConn();
        }
        else
        {
            //插入到日志表
            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 + "' , 'DEL', SYSDATE FROM DMFJBZB WHERE LJDM = '" + strDM + "'";
                dc.ExeSql(Sql2);
            }
            catch
            {
                return;
            }
            //确认删除
            string Sql = "delete from DMFJBZB WHERE  LJDM = '" + strDM + "'";
            dc.ExeSql(Sql);
        }


        setCondition();
        e.Cancel = true;
    }
示例#26
0
    //删除
    protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
    {
        theDc.setTheSql("select func_check_delete_data('CODE_COMPANY','MES','MES','MES','MES','" + e.Values["COMPANY_CODE"].ToString() + "') from dual");
        theDc.OpenConn();
        string theRet = theDc.GetValue();

        if (theRet != "Y")
        {
            ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete");
            ASPxGridView1.JSProperties.Add("cpCompanyName", theRet);
            // theDc.CloseConn();
        }


        else
        {
            string dSql = "DELETE FROM CODE_COMPANY WHERE COMPANY_CODE='" + e.Values["COMPANY_CODE"].ToString() + "'";
            theDc.ExeSql(dSql);
        }

        e.Cancel = true;
        queryFunction();
    }
示例#27
0
    // 删除
    protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
    {
        //判断当前记录是否可以删除
        string   delStr      = e.Values["PROGRAM_CODE"].ToString();
        dataConn theDataConn = new dataConn("select func_check_delete_data('CODE_PROGRAM','" + theCompanyCode + "','MES','MES','MES','" + delStr + "') from dual");

        theDataConn.OpenConn();
        string theRet = theDataConn.GetValue();

        if (theRet != "Y")
        {
            ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete");
            ASPxGridView1.JSProperties.Add("cpCompanyName", theRet);
            theDataConn.CloseConn();
        }
        else
        {
            //删除操作
            string dSql = "DELETE FROM CODE_PROGRAM WHERE COMPANY_CODE='" + theCompanyCode + "' AND PROGRAM_CODE='" + e.Values["PROGRAM_CODE"].ToString() + "'";
            theDc.ExeSql(dSql);
        }
        e.Cancel = true;
        queryFunction();
    }
示例#28
0
    // 新增
    protected void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
    {
        ASPxTextBox  uCode        = ASPxGridView1.FindEditFormTemplateControl("txtUCode") as ASPxTextBox;
        ASPxTextBox  uName        = ASPxGridView1.FindEditFormTemplateControl("txtUName") as ASPxTextBox;
        ASPxComboBox uTeam        = ASPxGridView1.FindEditFormTemplateControl("CombTeam") as ASPxComboBox;
        dataConn     theDataConn1 = new dataConn(" select TRIM(TO_CHAR(SEQ_USER_ID.NEXTVAL,'000000')) from dual");

        theDataConn1.OpenConn();
        string userId = theDataConn1.GetValue();

        string inSql = "INSERT INTO CODE_USER (COMPANY_CODE, USER_ID, USER_CODE, USER_NAME,user_type) "
                       + "VALUES('" + theCompanyCode + "','" + userId + "','" + uCode.Text.Trim().ToUpper() + "','" + uName.Text.Trim() + "' ,'B')";
        dataConn inDc = new dataConn();

        inDc.ExeSql(inSql);
        inDc.CloseConn();
        string inSql2 = "INSERT INTO REL_TEAM_USER (COMPANY_CODE,USER_ID, PLINE_CODE, TEAM_CODE) "
                        + "VALUES('" + theCompanyCode + "','" + userId + "','" + thePlCode + "','" + uTeam.Value.ToString() + "')";

        theDc.ExeSql(inSql2);
        e.Cancel = true;
        ASPxGridView1.CancelEdit();
        queryFunction();
    }
示例#29
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //得到相关信息
        userManager theUserManager = (userManager)Session["theUserManager"];

        string theCompanyCode = theUserManager.getCompanyCode();
        string theProgramCode = Request.QueryString["selectProgramValue"].ToString();

        theFlag = Request.QueryString["theFlag"].ToString();
        try
        {
            theQryStr = Request.QueryString["theQryStr"].ToString();
        }
        catch (Exception) {
            theQryStr = "";
        }

        if (theQryStr.Trim() == "")
        {
            theQryStr = " 1=1 ";
        }

        //调用存储过程得到该程序号对应信息
        //该程序暂时废弃不用,如果以后要启用,请将调用存储过程修改。.NET 4.0下如下调用会产生参数重复插入的问题。 by liuzhy 2013.12.25 x-max XIAN :(
        dataConn theDataConn = new dataConn();

        theDataConn.theComd.CommandType = CommandType.StoredProcedure;
        theDataConn.theComd.CommandText = "MW_QUERY_COMMONQUERY_SINGLE";

        theDataConn.theComd.Parameters.Add("THECOMPANYCODE1", OracleDbType.Varchar2).Value     = theCompanyCode;
        theDataConn.theComd.Parameters.Add("THECOMPANYCODE1", OracleDbType.Varchar2).Direction = ParameterDirection.Input;

        theDataConn.theComd.Parameters.Add("THEPROGRAMCODE1", OracleDbType.Varchar2).Value     = theProgramCode;
        theDataConn.theComd.Parameters.Add("THEPROGRAMCODE1", OracleDbType.Varchar2).Direction = ParameterDirection.Input;


        theDataConn.theComd.Parameters.Add("THEPROGRAMNAME1", OracleDbType.Varchar2, 50).Direction = ParameterDirection.InputOutput;

        theDataConn.theComd.Parameters.Add("THERETQUERYFIELDCODE1", OracleDbType.Varchar2, 300).Direction = ParameterDirection.InputOutput;

        theDataConn.theComd.Parameters.Add("THERETQUERYFIELDNAME1", OracleDbType.Varchar2, 300).Direction = ParameterDirection.InputOutput;

        theDataConn.theComd.Parameters.Add("THERETFIELDCODE1", OracleDbType.Varchar2, 300).Direction = ParameterDirection.InputOutput;

        theDataConn.theComd.Parameters.Add("THERETFIELDNAME1", OracleDbType.Varchar2, 300).Direction = ParameterDirection.InputOutput;

        theDataConn.theComd.Parameters.Add("THERETQUERYSQL1", OracleDbType.Varchar2, 300).Direction = ParameterDirection.InputOutput;

        theDataConn.theComd.Parameters.Add("THERETPRIMARYKEY1", OracleDbType.Varchar2, 300).Direction = ParameterDirection.InputOutput;

        theDataConn.OpenConn();
        theDataConn.theComd.ExecuteNonQuery();

        theProgramName    = (string)theDataConn.theComd.Parameters["THEPROGRAMNAME1"].Value;
        theQueryFieldCode = (string)theDataConn.theComd.Parameters["THERETQUERYFIELDCODE1"].Value;
        theQueryFieldName = (string)theDataConn.theComd.Parameters["THERETQUERYFIELDNAME1"].Value;
        theFieldCode      = (string)theDataConn.theComd.Parameters["THERETFIELDCODE1"].Value;
        theFieldName      = (string)theDataConn.theComd.Parameters["THERETFIELDNAME1"].Value;
        theQuerySql       = (string)theDataConn.theComd.Parameters["THERETQUERYSQL1"].Value;
        thePrimaryKey     = (string)theDataConn.theComd.Parameters["THERETPRIMARYKEY1"].Value;



        theDataConn.CloseConn();


        //相关属性赋值

        if (theConditionStr == "")
        {
            theConditionStr = " where " + theQryStr;
        }
        else
        {
            theConditionStr = theConditionStr + " and " + theQryStr;
        }

        SqlDataSource1.SelectCommand = theQuerySql + " " + theConditionStr;

        string[] thePrimaryKeyArray = thePrimaryKey.Split(',');
        GridView1.DataKeyNames = thePrimaryKeyArray;

        //动态生成列

        if (!IsPostBack)
        {
            string[] theFieldCodeArray      = theFieldCode.Split(',');
            string[] theFieldNameArray      = theFieldName.Split(',');
            string[] theQueryFieldCodeArray = theQueryFieldCode.Split(',');
            string[] theQueryFieldNameArray = theQueryFieldName.Split(',');

            BoundField[] field = new BoundField[theFieldCodeArray.Length];
            for (int i = 0; i < theFieldCodeArray.Length; i++)
            {
                field[i]                = new BoundField();
                field[i].DataField      = theFieldCodeArray[i];
                field[i].HeaderText     = theFieldNameArray[i];
                field[i].SortExpression = theFieldCodeArray[i];
                GridView1.Columns.Add(field[i]);
            }

            //生成查询方式下拉框
            ListItem[] listItem = new ListItem[theQueryFieldCodeArray.Length];

            //增加空行
            ListItem listItem1 = new ListItem();
            listItem1.Value = "";
            listItem1.Text  = "";
            DropDownList1.Items.Add(listItem1);
            for (int j = 0; j < theQueryFieldCodeArray.Length; j++)
            {
                listItem[j]       = new ListItem();
                listItem[j].Value = theQueryFieldCodeArray[j];
                listItem[j].Text  = theQueryFieldNameArray[j];
                DropDownList1.Items.Add(listItem[j]);
            }
        }
    }
示例#30
0
    protected void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
    {
        string strCode      = e.Values["RMES_ID"].ToString();
        string strID        = e.Values["USER_ID"].ToString();
        string strTableName = "REL_USER_PLINE";

        dataConn theDataConn = new dataConn("select func_check_delete_data('" + strTableName + "','" + theCompanyCode + "','MES','MES','MES','" + strCode + "') from dual");

        theDataConn.OpenConn();
        string theRet = theDataConn.GetValue();

        if (theRet != "Y")
        {
            ASPxGridView1.JSProperties.Add("cpCallbackName", "Delete");
            ASPxGridView1.JSProperties.Add("cpCallbackRet", theRet);
            theDataConn.CloseConn();
        }
        else
        {
            //确认删除
            string Sql = "delete from REL_USER_PLINE WHERE  COMPANY_CODE = '" + theCompanyCode + "' and USER_ID = '" + strID + "'and RMES_ID = '" + strCode + "'";
            dc.ExeSql(Sql);
        }


        setCondition();
        e.Cancel = true;
        ////删除
        ////调用存储过程进行处理
        //userManager theUserManager = (userManager)Session["theUserManager"];
        //MW_MODIFY_USER_PLINE sp = new MW_MODIFY_USER_PLINE() {
        //    THEFUNCTION1 = "DELETE",
        //    THECOMPANYCODE1 = theCompanyCode,
        //    THEUSERID1 = e.Values["USER_ID"].ToString(),
        //    THEPLINECODE1 = e.Values["PLINE_CODE"].ToString()
        //};

        //Procedure.run(sp);

        //dataConn theDataConn = new dataConn();
        //theDataConn.theComd.CommandType = CommandType.StoredProcedure;
        //theDataConn.theComd.CommandText = "MW_MODIFY_USER_PLINE";

        //theDataConn.theComd.Parameters.Add("THEFUNCTION1", OracleDbType.Varchar2).Value = "DELETE";
        //theDataConn.theComd.Parameters.Add("THEFUNCTION1", OracleDbType.Varchar2).Direction = ParameterDirection.Input;

        //theDataConn.theComd.Parameters.Add("THECOMPANYCODE1", OracleDbType.Varchar2).Value = theCompanyCode;
        //theDataConn.theComd.Parameters.Add("THECOMPANYCODE1", OracleDbType.Varchar2).Direction = ParameterDirection.Input;

        //theDataConn.theComd.Parameters.Add("THEUSERID1", OracleDbType.Varchar2).Value = e.Keys["USER_ID"].ToString();
        //theDataConn.theComd.Parameters.Add("THEUSERID1", OracleDbType.Varchar2).Direction = ParameterDirection.Input;

        //theDataConn.theComd.Parameters.Add("THEPLINECODE1", OracleDbType.Varchar2).Value = e.Keys["PLINE_CODE"].ToString();
        //theDataConn.theComd.Parameters.Add("THEPLINECODE1", OracleDbType.Varchar2).Direction = ParameterDirection.Input;

        //theDataConn.OpenConn();
        //theDataConn.theComd.ExecuteNonQuery();

        //theDataConn.CloseConn();

        setCondition();
        e.Cancel = true;
    }