Ejemplo n.º 1
0
        protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
        {
            if (!ASPxGridView1.IsNewRowEditing && ASPxGridView1.IsEditing)
            {
                ///主键不可以修改
                (ASPxGridView1.FindEditFormTemplateControl("comboLJZL") as ASPxComboBox).Enabled = false;
                (ASPxGridView1.FindEditFormTemplateControl("comboPCode") as ASPxComboBox).Enabled = false;
                //(ASPxGridView1.FindEditFormTemplateControl("comboLJDM") as ASPxComboBox).Enabled = false;
                (ASPxGridView1.FindEditFormTemplateControl("ASPxTextBox1") as ASPxTextBox).Enabled = false;
                (ASPxGridView1.FindEditFormTemplateControl("txtLJMC") as ASPxTextBox).Enabled = false;

                if (theZYLJZL == "检查重要零件")
                {
                    (ASPxGridView1.FindEditFormTemplateControl("comboLJJB") as ASPxComboBox).Enabled = false;
                }
            }
            if (ASPxGridView1.IsNewRowEditing)
            {
                theZYLJZL = "";
                (ASPxGridView1.FindEditFormTemplateControl("comboLJZL") as ASPxComboBox).Text = "";
                if (theZYLJZL == "检查重要零件")
                {
                    (ASPxGridView1.FindEditFormTemplateControl("comboLJJB") as ASPxComboBox).Enabled = false;
                }
            }
            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 = ASPxGridView1.FindEditFormTemplateControl("comboPCode") as ASPxComboBox;
            uPcode.DataSource = Pdt;
            uPcode.TextField = Pdt.Columns[1].ToString();
            uPcode.ValueField = Pdt.Columns[0].ToString();
            uPcode.SelectedIndex = uPcode.Items.Count >= 0 ? 0 : -1;
        }
Ejemplo n.º 2
0
        //创建EDITFORM前
        protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
        {
            string       Sql    = " select distinct a.pline_code,b.pline_name as 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 = ASPxGridView1.FindEditFormTemplateControl("txtPCode") as ASPxComboBox;

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

            //    if (Session["9100USER"].ToString() != "")
            //    {
            //        string sql = Session["9100USER"] as string;
            //        SqlBgy.SelectCommand = sql;
            //        SqlBgy.DataBind();
            //    }
            //}
            //catch
            //{ }
            //try
            //{
            //    if (Session["9100PART"].ToString() != "")
            //    {
            //        string sql = Session["9100PART"] as string;
            //        SqlPart.SelectCommand = sql;
            //        SqlPart.DataBind();
            //    }
            //}
            //catch
            //{ }
        }
Ejemplo n.º 3
0
    //创建EDITFORM前
    protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
    {
        string       Sql    = " select distinct a.pline_code,b.pline_name as showtext 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 = ASPxGridView1.FindEditFormTemplateControl("txtPCode") as ASPxComboBox;

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

        string Sql2 = "select distinct LOCATION_CODE,LOCATION_CODE||' '||LOCATION_NAME from CODE_LOCATION where LOCATION_CODE not like 'OP%' and LOCATION_CODE not in (select location_code from ms_location_time where gzdd in (select pline_code from vw_user_role_program where user_id='" + theUserId + "' and program_code='" + theProgramCode + "' and company_code='" + theCompanyCode + "'))"
                      + "and  pline_code in (select pline_id from vw_user_role_program where user_id='" + theUserId + "' and program_code='" + theProgramCode + "' and company_code='" + theCompanyCode + "') order by LOCATION_CODE";
        DataTable    dt2    = dc.GetTable(Sql2);
        ASPxComboBox uLCode = ASPxGridView1.FindEditFormTemplateControl("txtLCode") as ASPxComboBox;

        uLCode.DataSource = dt2;
        uLCode.TextField  = dt2.Columns[1].ToString();
        uLCode.ValueField = dt2.Columns[0].ToString();


        if (!ASPxGridView1.IsNewRowEditing && ASPxGridView1.IsEditing)
        {
            ///主键不可以修改
            (ASPxGridView1.FindEditFormTemplateControl("txtLCode") as ASPxComboBox).Enabled = false;
            (ASPxGridView1.FindEditFormTemplateControl("txtPCode") as ASPxComboBox).Enabled = false;
        }
        else
        {
            //uTcode.SelectedIndex = 0;
        }
    }
Ejemplo n.º 4
0
        //创建EDITFORM前
        protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
        {
            string Sql3 = "SELECT PT_PART,PT_DESC2 FROM COPY_PT_MSTR where pt_phantom=0 order by PT_PART ";

            SqlDataSource3.SelectCommand = Sql3;
            SqlDataSource3.DataBind();
        }
Ejemplo n.º 5
0
        //创建EDITFORM前
        protected void ASPxGridView3_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
        {
            if (!ASPxGridView3.IsNewRowEditing && ASPxGridView3.IsEditing)
            {
                ///主键不可以修改
                (ASPxGridView3.FindEditFormTemplateControl("comboLJDM3") as ASPxComboBox).Enabled = false;

                //处理ASPxCheckBox
                if (ASPxGridView3.GetRowValues(ASPxGridView3.FocusedRowIndex, "SFHC").ToString() == "1")
                {
                    (ASPxGridView3.FindEditFormTemplateControl("chHCFlag") as ASPxCheckBox).Checked = true;
                }
                else
                {
                    (ASPxGridView3.FindEditFormTemplateControl("chHCFlag") as ASPxCheckBox).Checked = false;
                }
                //处理ASPxCheckBox
                if (ASPxGridView3.GetRowValues(ASPxGridView3.FocusedRowIndex, "SFZC").ToString() == "1")
                {
                    (ASPxGridView3.FindEditFormTemplateControl("chHCZCFlag") as ASPxCheckBox).Checked = true;
                }
                else
                {
                    (ASPxGridView3.FindEditFormTemplateControl("chHCZCFlag") as ASPxCheckBox).Checked = false;
                }
            }
        }
Ejemplo n.º 6
0
    //创建EDITFORM前
    protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
    {
        string    Sql = "select distinct a.pline_code,a.pline_code||' '||b.pline_name as showtext 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 = ASPxGridView1.FindEditFormTemplateControl("txtPCode") as ASPxComboBox;

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


        //  string strPCode = uPCode.Value.ToString();

        string    Sql1 = "select distinct PLAN_SO,PLAN_SO as showtext from DATA_PLAN ";
        DataTable dt1  = dc.GetTable(Sql1);

        ASPxComboBox txtSO = ASPxGridView1.FindEditFormTemplateControl("txtSO") as ASPxComboBox;

        txtSO.DataSource = dt1;
        txtSO.TextField  = dt1.Columns[1].ToString();
        txtSO.ValueField = dt1.Columns[0].ToString();
        if (!ASPxGridView1.IsNewRowEditing && ASPxGridView1.IsEditing)
        {
            ///主键不可以修改
            (ASPxGridView1.FindEditFormTemplateControl("txtSO") as ASPxComboBox).Enabled = false;
        }
        else
        {
            //uTcode.SelectedIndex = 0;
        }
    }
Ejemplo n.º 7
0
    protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
    {
        //创建Editform,对其中某些字段进行属性设置

        ASPxComboBox uPcode = ASPxGridView1.FindEditFormTemplateControl("dropPlineCode") as ASPxComboBox;
        ASPxComboBox uScode = ASPxGridView1.FindEditFormTemplateControl("dropStationCode") as ASPxComboBox;

        string    Sql2 = "select pline_code,pline_code||' '||pline_name as showtext from CODE_PRODUCT_LINE";
        DataTable dt2  = dc.GetTable(Sql2);

        uPcode.DataSource = dt2;
        uPcode.TextField  = dt2.Columns[1].ToString();
        uPcode.ValueField = dt2.Columns[0].ToString();


        string    Sql3 = "SELECT STATION_CODE,STATION_CODE||' '||STATION_NAME AS SHOWTEXT FROM CODE_STATION";
        DataTable dt3  = dc.GetTable(Sql3);

        uScode.DataSource = dt3;
        uScode.TextField  = dt3.Columns[1].ToString();
        uScode.ValueField = dt3.Columns[0].ToString();

        if (!ASPxGridView1.IsNewRowEditing && ASPxGridView1.IsEditing)
        {
            ///主键不可以修改
            (ASPxGridView1.FindEditFormTemplateControl("txtSubCode") as ASPxTextBox).Enabled = false;
        }
    }
Ejemplo n.º 8
0
    protected void grid_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
    {
        if (this.grid.EditingRowVisibleIndex > -1)
        {
            ASPxPageControl pageControl = this.grid.FindEditFormTemplateControl("pageControl") as ASPxPageControl;

            ASPxTextBox  partyName = pageControl.FindControl("txt_PartyName") as ASPxTextBox;
            ASPxTextBox  whName    = pageControl.FindControl("txt_WhName") as ASPxTextBox;
            ASPxDateEdit txt_Date  = pageControl.FindControl("txt_Date") as ASPxDateEdit;
            txt_Date.Enabled = false;
            partyName.Text   = EzshipHelper.GetPartyName(this.grid.GetRowValues(this.grid.EditingRowVisibleIndex, new string[] { "PartyId" }));
            whName.Text      = EzshipHelper.GetWarehouse(this.grid.GetRowValues(this.grid.EditingRowVisibleIndex, new string[] { "WhCode" }));
            string oid = SafeValue.SafeString(this.grid.GetRowValues(this.grid.EditingRowVisibleIndex, new string[] { "Id" }));
            if (oid.Length > 0)
            {
                string     sql            = string.Format("select StatusCode from wh_Contract  where Id='{0}'", oid);
                string     closeInd       = SafeValue.SafeString(C2.Manager.ORManager.ExecuteScalar(sql), "USE");//
                ASPxButton btn            = this.grid.FindEditFormTemplateControl("btn_CloseJob") as ASPxButton;
                ASPxButton btn_VoidMaster = this.grid.FindEditFormTemplateControl("btn_Void") as ASPxButton;
                if (closeInd == "CLS")
                {
                    btn.Text = "Open Job";
                }
                if (closeInd == "CNL")
                {
                    btn_VoidMaster.Text = "Unvoid";
                }
                else
                {
                    btn.Text = "Close";
                }
            }
        }
    }
Ejemplo n.º 9
0
        //创建EDITFORM前
        protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
        {
            if (!ASPxGridView1.IsNewRowEditing && ASPxGridView1.IsEditing)
            {
                ///主键不可以修改
                (ASPxGridView1.FindEditFormTemplateControl("comboLJDM") as ASPxComboBox).Enabled = false;

                //处理ASPxCheckBox
                string a = ASPxGridView1.GetRowValues(ASPxGridView1.FocusedRowIndex, "RQEND").ToString();
                if (ASPxGridView1.GetRowValues(ASPxGridView1.FocusedRowIndex, "RQEND").ToString() != "")
                {
                    (ASPxGridView1.FindEditFormTemplateControl("chValidFlag") as ASPxCheckBox).Checked = true;
                }
                else
                {
                    (ASPxGridView1.FindEditFormTemplateControl("chValidFlag") as ASPxCheckBox).Checked = false;
                }

                if (ASPxGridView1.GetRowValues(ASPxGridView1.FocusedRowIndex, "RQBEGIN").ToString() != "")
                {
                    theBeginDate = Convert.ToDateTime(ASPxGridView1.GetRowValues(ASPxGridView1.FocusedRowIndex, "RQBEGIN").ToString());
                }
                if (ASPxGridView1.GetRowValues(ASPxGridView1.FocusedRowIndex, "RQEND").ToString() != "")
                {
                    theEndDate = Convert.ToDateTime(ASPxGridView1.GetRowValues(ASPxGridView1.FocusedRowIndex, "RQEND").ToString());
                }
            }
        }
Ejemplo n.º 10
0
    protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
    {
        //创建EditForm前
        //string Sql = "select a.pline_code,a.pline_code||' '||a.pline_name as showtext from code_product_line a ";
        string    Sql = "select DISTINCT A.PLINE_CODE,A.PLINE_CODE||' '||a.pline_name AS SHOWTEXT FROM CODE_PRODUCT_LINE A where pline_code in( select pline_code from vw_user_role_program where USER_ID='" + theUserId + "' and program_code='" + theProgramCode + "' )  ";
        DataTable dt  = dc.GetTable(Sql);

        ASPxComboBox uPCode = ASPxGridView1.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;
        string    Sql2 = "select ROUNTING_REMARK,ROUNTING_REMARK as showtext from DATA_ROUNTING_REMARK ";
        DataTable dt2  = dc.GetTable(Sql2);

        ASPxComboBox uROUNT = ASPxGridView1.FindEditFormTemplateControl("comboxROUNT") as ASPxComboBox;

        uROUNT.DataSource = dt2;
        uROUNT.TextField  = dt2.Columns[1].ToString();
        uROUNT.ValueField = dt2.Columns[0].ToString();


        if (!ASPxGridView1.IsNewRowEditing && ASPxGridView1.IsEditing)
        {
            ///主键不可以修改
            (ASPxGridView1.FindEditFormTemplateControl("comboxROUNT") as ASPxComboBox).Enabled = false;
        }
        else
        {
            //uTcode.SelectedIndex = 0;
        }
    }
Ejemplo n.º 11
0
        protected void gridDistributorsManage_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
        {
            if (!SessionManager.IsEditFormCreated)
            {
                if (!gridDistributorsManage.IsNewRowEditing)
                {
                    // initialize distributor type combo box
                    ASPxComboBox combo = (ASPxComboBox)gridDistributorsManage.FindEditFormTemplateControl("cboType");
                    if (combo != null)
                    {
                        object value = gridDistributorsManage.GetRowValues(gridDistributorsManage.EditingRowVisibleIndex, "IDDistributorType");

                        foreach (ListEditItem lei in combo.Items)
                        {
                            if (lei.Value.ToString() == value.ToString())
                            {
                                combo.SelectedItem = lei;
                            }
                        }
                    }
                }

                SessionManager.IsEditFormCreated = true;
            }
        }
Ejemplo n.º 12
0
    protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
    {
        userManager theUserManager = (userManager)Session["theUserManager"];

        theCompanyCode = theUserManager.getCompanyCode();
        ASPxComboBox plineCode     = ASPxGridView1.FindEditFormTemplateControl("plineCode") as ASPxComboBox;
        ASPxComboBox productSeries = ASPxGridView1.FindEditFormTemplateControl("productSeries") as ASPxComboBox;
        string       sql1          = "select pline_code,pline_name from code_product_line where company_code=" + theCompanyCode;
        DataTable    dt            = dc.GetTable(sql1);

        plineCode.DataSource = dt;
        plineCode.TextField  = "pline_name";
        plineCode.ValueField = "pline_code";
        //plineCode.DataBind();

        string    sql2 = "select distinct MODEL_CODE from data_xk_oldbom";
        DataTable dt1  = dc.GetTable(sql2);

        productSeries.DataSource = dt1;
        productSeries.TextField  = "MODEL_CODE";
        productSeries.ValueField = "MODEL_CODE";
        //productSeries.DataBind();    前台使用了<%# Bind("") %>后台就不能使用DataBind()
        //创建Editform,对其中某些字段进行属性设置

        //if (!ASPxGridView1.IsNewRowEditing && ASPxGridView1.IsEditing)
        //{
        //    ///主键不可以修改
        //    (ASPxGridView1.FindEditFormTemplateControl("txtPlanCode") as ASPxTextBox).Enabled = false;
        //}
    }
Ejemplo n.º 13
0
        //创建EDITFORM前
        protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
        {
            if (!ASPxGridView1.IsNewRowEditing && ASPxGridView1.IsEditing)
            {
                (ASPxGridView1.FindEditFormTemplateControl("txtPCode") as ASPxComboBox).Enabled    = false;
                (ASPxGridView1.FindEditFormTemplateControl("txtMCode") as ASPxTextBox).Enabled     = false;
                (ASPxGridView1.FindEditFormTemplateControl("txtGCode") as ASPxTextBox).Enabled     = false;
                (ASPxGridView1.FindEditFormTemplateControl("txtLocation") as ASPxComboBox).Enabled = false;

                (ASPxGridView1.FindEditFormTemplateControl("txtGName") as ASPxTextBox).Enabled = false;
                (ASPxGridView1.FindEditFormTemplateControl("txtMName") as ASPxTextBox).Enabled = false;
            }
            if (ASPxGridView1.IsNewRowEditing)
            {
                (ASPxGridView1.FindEditFormTemplateControl("txtGName") as ASPxTextBox).Enabled = false;
                (ASPxGridView1.FindEditFormTemplateControl("txtMName") as ASPxTextBox).Enabled = false;
            }
            string       Sql    = " select distinct a.pline_code,b.pline_name as showtext 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 = ASPxGridView1.FindEditFormTemplateControl("txtPCode") as ASPxComboBox;

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

            if (!ASPxGridView1.IsNewRowEditing && ASPxGridView1.IsEditing)
            {
                (ASPxGridView1.FindEditFormTemplateControl("txtPCode") as ASPxComboBox).Enabled = false;
                (ASPxGridView1.FindEditFormTemplateControl("txtMCode") as ASPxTextBox).Enabled  = false;
            }
        }
Ejemplo n.º 14
0
    //创建EDITFORM前
    protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
    {
        // txtPCode.value = '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 = ASPxGridView1.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 (!ASPxGridView1.IsNewRowEditing && ASPxGridView1.IsEditing)
        {
            ///主键不可以修改
            string strIflag = ASPxGridView1.GetRowValues(ASPxGridView1.EditingRowVisibleIndex, new string[] { "INCREASE_FLAG" }).ToString();

            char chr = Convert.ToChar(strIflag);
            (ASPxGridView1.FindEditFormTemplateControl("ASPxComboBox1") as ASPxComboBox).Enabled = false;
            if (chr == 'A')
            {
                (ASPxGridView1.FindEditFormTemplateControl("txtSinitial") as ASPxTextBox).Enabled = false;
            }
            else
            {
                (ASPxGridView1.FindEditFormTemplateControl("txtSmax") as ASPxTextBox).Enabled = false;
            }
        }
        else
        {
            //uTcode.SelectedIndex = 0;
        }
    }
Ejemplo n.º 15
0
 protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
 {
     if (!ASPxGridView1.IsNewRowEditing && ASPxGridView1.IsEditing)
     {
         ///主键不可以修改
         (ASPxGridView1.FindEditFormTemplateControl("txtVendorCode") as ASPxTextBox).Enabled = false;
     }
 }
Ejemplo n.º 16
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;
     }
 }
Ejemplo n.º 17
0
        protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
        {
            ////创建Editform,对其中某些字段进行属性设置

            //if (!ASPxGridView1.IsNewRowEditing && ASPxGridView1.IsEditing)
            //{
            //    ///主键不可以修改
            //    (ASPxGridView1.FindEditFormTemplateControl("txtDeptCode") as ASPxTextBox).Enabled = false;
            //}
        }
Ejemplo n.º 18
0
 protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
 {
     if (!ASPxGridView1.IsNewRowEditing && ASPxGridView1.IsEditing)
     {
         //主键不可以修改
         (ASPxGridView1.FindEditFormTemplateControl("pro") as ASPxTextBox).Enabled = false;
         //按照之前开发的样子,生产线也不可以修改
         //(ASPxGridView1.FindEditFormTemplateControl("ASPxComboBox1") as ASPxComboBox).Enabled = false;
     }
 }
Ejemplo n.º 19
0
    protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
    {
        ASPxGridLookup gridLookupUser = ASPxGridView1.FindEditFormTemplateControl("GridLookupUser") as ASPxGridLookup;

        gridLookupUser.GridView.Width = 250;

        ASPxGridLookup gridLookupTeam = ASPxGridView1.FindEditFormTemplateControl("gridLookupTeam") as ASPxGridLookup;

        gridLookupTeam.GridView.Width = 250;
    }
Ejemplo n.º 20
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();
        }
Ejemplo n.º 21
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();
    }
Ejemplo n.º 22
0
        //创建EDITFORM前
        //初始化入出库类型combobox
        protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
        {
            string       sql     = "SELECT LXMC FROM DP_RKLX ORDER BY LXDM ";
            DataTable    dt      = dc.GetTable(sql);
            ASPxComboBox cb_Rklx = ASPxGridView1.FindEditFormTemplateControl("txtRklx") as ASPxComboBox;

            cb_Rklx.DataSource = dt;
            cb_Rklx.TextField  = dt.Columns[0].ToString();
            cb_Rklx.ValueField = dt.Columns[0].ToString();
        }
Ejemplo n.º 23
0
 protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
 {
     if (!ASPxGridView1.IsNewRowEditing && ASPxGridView1.IsEditing)
     {
         ///主键不可以修改
         (ASPxGridView1.FindEditFormTemplateControl("txtPCode") as ASPxComboBox).Enabled = false;
     }
     else
     {
         //uTcode.SelectedIndex = 0;
     }
 }
Ejemplo n.º 24
0
 protected void grid_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
 {
     Control wc = grid.FindEditFormTemplateControl("ASPxButtonEdit1");
     //grid.fin
     //if (wc != null)
     //{
     //    ASPxButtonEdit templateEdit = wc as ASPxButtonEdit;
     //    //
     //    // Initialize the editor as required
     //    //
     //    templateEdit.ForeColor = System.Drawing.Color.Blue;
     //}
 }
 protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
 {
     if (Session["isEditForCreated"] == null)
     {
         ASPxComboBox currentBox = ((ASPxGridView)sender).FindEditFormTemplateControl("descrBox") as ASPxComboBox;
         int          index      = ((ASPxGridView)sender).EditingRowVisibleIndex;
         int          currentKey = Convert.ToInt32(((ASPxGridView)sender).GetRowValues(index, "CategoryID"));
         for (int i = 1; i <= 9; i++)
         {
             currentBox.Items.Add("Description" + i.ToString());
         }
         currentBox.SelectedIndex = currentKey - 1;
     }
     Session["isEditForCreated"] = true;
 }
Ejemplo n.º 26
0
    protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
    {
        ASPxComboBox workUnit = ASPxGridView1.FindEditFormTemplateControl("WorkUnit") as ASPxComboBox;
        ASPxComboBox WorkShop = ASPxGridView1.FindEditFormTemplateControl("WorkShop") as ASPxComboBox;



        //ASPxTextBox routingCode = ASPxGridView1.FindEditFormTemplateControl("txtRoutingCode") as ASPxTextBox;

        if (!ASPxGridView1.IsNewRowEditing && ASPxGridView1.IsEditing)
        {
            workUnit.Enabled = false;
            WorkShop.Enabled = true;
            //routingCode.Enabled = false;
        }
    }
Ejemplo n.º 27
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;
            }
        }
Ejemplo n.º 28
0
    protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
    {
        ASPxComboBox uTcode = ASPxGridView1.FindEditFormTemplateControl("dropStaionType") as ASPxComboBox;
        ASPxComboBox uPcode = ASPxGridView1.FindEditFormTemplateControl("dropPlineCode") as ASPxComboBox;
        //ASPxComboBox uScode = ASPxGridView1.FindEditFormTemplateControl("dropStaionArea") as ASPxComboBox;


        string    Sql4 = "SELECT STATION_TYPE_CODE,STATION_TYPE_CODE||' '||STATION_TYPE_NAME AS SHOWTEXT FROM CODE_STATION_TYPE";
        DataTable dt4  = dc.GetTable(Sql4);

        uTcode.DataSource = dt4;
        uTcode.TextField  = dt4.Columns[1].ToString();
        uTcode.ValueField = dt4.Columns[0].ToString();


        string    Sql2 = "select RMES_ID,pline_code||' '||pline_name as showtext from CODE_PRODUCT_LINE";
        DataTable dt2  = dc.GetTable(Sql2);

        uPcode.DataSource = dt2;
        uPcode.TextField  = dt2.Columns[1].ToString();
        uPcode.ValueField = dt2.Columns[0].ToString();


        //string  Sql3 = "SELECT STATION_AREA_CODE,STATION_AREA_CODE||' '||STATION_AREA_NAME AS SHOWTEXT FROM CODE_STATION_AREA";
        //DataTable dt3 = dc.GetTable(Sql3);

        //uScode.DataSource = dt3;
        //uScode.TextField = dt3.Columns[1].ToString();
        //uScode.ValueField = dt3.Columns[0].ToString();



        if (!ASPxGridView1.IsNewRowEditing && ASPxGridView1.IsEditing)
        {
            ///主键不可以修改
            (ASPxGridView1.FindEditFormTemplateControl("txtStationCode") as ASPxTextBox).Enabled = false;
        }
        else
        {
            //uTcode.SelectedIndex = 0;
            //uPcode.SelectedIndex = 0;
            //uScode.SelectedIndex = 0;
        }
    }
Ejemplo n.º 29
0
    //创建EDITFORM前
    protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
    {
        string       Sql    = "select STATION_TYPE_CODE,STATION_TYPE_CODE||' '||STATION_TYPE_NAME as showtext from CODE_STATION_TYPE";
        DataTable    dt     = dc.GetTable(Sql);
        ASPxComboBox uSType = ASPxGridView1.FindEditFormTemplateControl("txtSType") as ASPxComboBox;

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


        string       PSql   = "select RMES_ID PLINE_CODE,PLINE_NAME,PLINE_CODE 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 = ASPxGridView1.FindEditFormTemplateControl("txtPCode") as ASPxComboBox;

        uPcode.DataSource = Pdt;
        uPcode.TextField  = Pdt.Columns[1].ToString();
        uPcode.ValueField = Pdt.Columns[0].ToString();

        //uPcode.SelectedIndex = uPcode.Items.Count >= 0 ? 0 : -1;

        string ASql = "select distinct AREA_CODE,AREA_CODE||' '||AREA_NAME as showtext from CODE_STATION_AREA where pline_code in "
                      + "(select pline_code from vw_user_role_program where user_id='" + theUserId + "' and program_code='" + theProgramCode + "' and company_code='" + theCompanyCode + "') order by case AREA_CODE when 'A' then 1 when 'T' then 2 when 'P' then 3 when 'U' then 4 end";
        DataTable    Adt    = dc.GetTable(ASql);
        ASPxComboBox uSArea = ASPxGridView1.FindEditFormTemplateControl("txtSArea") as ASPxComboBox;

        uSArea.DataSource = Adt;
        uSArea.TextField  = Adt.Columns[1].ToString();
        uSArea.ValueField = Adt.Columns[0].ToString();

        if (!ASPxGridView1.IsNewRowEditing && ASPxGridView1.IsEditing)
        {
            ///主键不可以修改
            (ASPxGridView1.FindEditFormTemplateControl("txtSCode") as ASPxTextBox).Enabled  = false;
            (ASPxGridView1.FindEditFormTemplateControl("txtPCode") as ASPxComboBox).Enabled = false;
        }
        else
        {
            uPcode.SelectedIndex = uPcode.Items.Count >= 0 ? 0 : -1;
            //uTcode.SelectedIndex = 0;
        }
    }
Ejemplo n.º 30
0
    //修改

    //创建EDITFORM前
    protected void ASPxGridView1_HtmlEditFormCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewEditFormEventArgs e)
    {
        string    Sql = "select ljlb||'--'||ljjc as showtext from dmfjbzb order by ljlb,ljjc ";
        DataTable dt  = dc.GetTable(Sql);

        ASPxComboBox uFJB = ASPxGridView1.FindEditFormTemplateControl("ComboFJB") as ASPxComboBox;

        uFJB.DataSource = dt;
        // uFJB.TextField = dt.Columns[1].ToString();
        uFJB.TextField = dt.Columns[0].ToString();
        if (!ASPxGridView1.IsNewRowEditing && ASPxGridView1.IsEditing)
        {
            ///主键不可以修改
            (ASPxGridView1.FindEditFormTemplateControl("TextSO") as ASPxTextBox).Enabled = false;
        }
        else
        {
            //uTcode.SelectedIndex = 0;
        }
    }