コード例 #1
0
        protected void grid_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            ASPxTextBox text   = grid.FindEditFormTemplateControl("txtName") as ASPxTextBox;
            ASPxTextBox textId = grid.FindEditFormTemplateControl("txtId") as ASPxTextBox;



            this.language.id  = -1;
            language.name     = text.Text;
            language.isactive = true;
            this.objLanuage.AddLanguage(language);
            grid.CancelEdit();
            e.Cancel             = true;
            this.grid.DataSource = objLanuage.GetLanguages();
            this.grid.DataBind();
        }
 protected void ASPxGridView1_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
 {
     string[] param = e.Parameters.Split('|');
     if (param[0] == "oneRow")
     {
         int          visibleIndex   = int.Parse(param[1]);
         ASPxGridView grid           = sender as ASPxGridView;
         ASPxTextBox  tbCategoryName = grid.FindRowCellTemplateControl(visibleIndex, grid.Columns["CategoryName"] as GridViewDataColumn, "txtBox") as ASPxTextBox;
         ASPxTextBox  tbDescription  = grid.FindRowCellTemplateControl(visibleIndex, grid.Columns["Description"] as GridViewDataColumn, "txtBox") as ASPxTextBox;
         AccessDataSource1.UpdateParameters["CategoryName"].DefaultValue = tbCategoryName.Text;
         AccessDataSource1.UpdateParameters["Description"].DefaultValue  = tbDescription.Text;;
         AccessDataSource1.UpdateParameters["CategoryID"].DefaultValue   = grid.GetRowValues(visibleIndex, "CategoryID").ToString();
         AccessDataSource1.Update();
     }
     ASPxGridView1.DataBind();
 }
コード例 #3
0
    protected void grid_Zone_HtmlEditFormCreated(object sender, ASPxGridViewEditFormEventArgs e)
    {
        ASPxGridView grid = (sender as ASPxGridView) as ASPxGridView;

        if (grid.EditingRowVisibleIndex > -1)
        {
            ASPxPageControl pageControl   = grid.FindEditFormTemplateControl("pageControl_Zone") as ASPxPageControl;
            ASPxTextBox     txt_Zone_Code = pageControl.FindControl("txt_Zone_Code") as ASPxTextBox;
            txt_Zone_Code.Enabled = false;
            ASPxTextBox txt_PartyName     = pageControl.FindControl("txt_PartyName") as ASPxTextBox;
            ASPxTextBox txt_WarehouseName = pageControl.FindControl("txt_WarehouseName") as ASPxTextBox;

            txt_PartyName.Text     = EzshipHelper.GetPartyName(grid.GetRowValues(grid.EditingRowVisibleIndex, new string[] { "PartyId" }));
            txt_WarehouseName.Text = EzshipHelper.GetWarehouse(grid.GetRowValues(grid.EditingRowVisibleIndex, new string[] { "WarehouseCode" }));
        }
    }
コード例 #4
0
 public void EnableCombinations(bool Value)
 {
     foreach (Control c in CombinationRow.Controls)
     {
         if (c is TextBox)
         {
             TextBox C = (TextBox)c;
             C.Enabled = Value;
         }
         else if (c is DevExpress.Web.ASPxTextBox)
         {
             ASPxTextBox T = (ASPxTextBox)c;
             T.Enabled = Value;
         }
     }
 }
コード例 #5
0
    private void OnLoad()
    {
        int start = 0;   // this.ASPxGridView1.PageIndex * ASPxGridView1.SettingsPager.PageSize;
        int end   = 100; // (ASPxGridView1.PageIndex + 1) * ASPxGridView1.SettingsPager.PageSize;

        for (int i = start; i < end; i++)
        {
            ASPxTextBox  docId = this.grid.FindRowTemplateControl(i, "txt_Id") as ASPxTextBox;
            ASPxCheckBox isPay = this.grid.FindRowTemplateControl(i, "ack_IsPay") as ASPxCheckBox;
            if (docId != null && isPay != null && isPay.Checked)
            {
                list.Add(new Record(SafeValue.SafeInt(docId.Text, 0)
                                    ));
            }
        }
    }
コード例 #6
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;

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

        inDc.ExeSql(inSql);
        inDc.CloseConn();

        e.Cancel = true;
        ASPxGridView1.CancelEdit();
        queryFunction();
    }
コード例 #7
0
    protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
    {
        ASPxTextBox uCXH   = ASPxGridView1.FindEditFormTemplateControl("txtCXH") as ASPxTextBox;
        ASPxTextBox txtFR  = ASPxGridView1.FindEditFormTemplateControl("txtFR") as ASPxTextBox;
        ASPxTextBox txtsat = ASPxGridView1.FindEditFormTemplateControl("txtSAT") as ASPxTextBox;
        string      strFR  = txtFR.Text.Trim();

        string Sql = "UPDATE ATPUFRCXH SET CXH='" + uCXH.Text.Trim() + "',sat='" + txtsat.Text.Trim() + "'"
                     + " WHERE   FR = '" + strFR + "'";

        dc.ExeSql(Sql);

        e.Cancel = true;
        ASPxGridView1.CancelEdit();
        setCondition();
    }
コード例 #8
0
        public override System.Web.UI.Control Build()
        {
            base.Build();
            ASPxTextBox tb = new ASPxTextBox();

            tb.Width                        = ModuleField.Width;
            tb.Height                       = ModuleField.Height;
            tb.MaskSettings.Mask            = "(9999)99999999";
            tb.MaskSettings.ErrorText       = "格式错误!";
            tb.MaskSettings.IncludeLiterals = MaskIncludeLiteralsMode.None;
            tb.ValidationSettings.RequiredField.IsRequired = ModuleField.IsRequired;
            tb.ValidationSettings.RequiredField.ErrorText  = ModuleField.ErrorText;
            tb.Text     = ModuleField.CurrentValue == null ? ModuleField.DefaultValue == null ? null : ModuleField.DefaultValue.ToString() : ModuleField.CurrentValue.ToString();
            tb.NullText = ModuleField.NullText;
            return(tb);
        }
コード例 #9
0
    protected void grid_InvDet_InitNewRow(object sender, DevExpress.Web.Data.ASPxDataInitNewRowEventArgs e)
    {
        e.NewValues["DocLineNo"] = 0;
        ASPxTextBox docCurr = this.ASPxGridView1.FindEditFormTemplateControl("txt_Currency") as ASPxTextBox;

        e.NewValues["Currency"] = docCurr.Text;
        //e.NewValues["Currency"] = System.Configuration.ConfigurationManager.AppSettings["Currency"];
        e.NewValues["ExRate"]   = 1.0;
        e.NewValues["GstAmt"]   = 0;
        e.NewValues["DocAmt"]   = 0;
        e.NewValues["LocAmt"]   = 0;
        e.NewValues["Qty"]      = 1;
        e.NewValues["Price"]    = 0;
        e.NewValues["GstType"]  = "Z";
        e.NewValues["AcSource"] = "CR";
    }
コード例 #10
0
    protected void btnSave_Command(object sender, CommandEventArgs e)
    {
        ASPxTextBox txtPassword = gvTSelf.FindEditFormTemplateControl("txtPassword") as ASPxTextBox;
        ASPxTextBox txtName     = gvTSelf.FindEditFormTemplateControl("txtName") as ASPxTextBox;
        string      password    = txtPassword.Text;

        if (password.Length < 6)
        {
            Response.Write("<script>alert('密码不得少于6位')</script>");
            return;
        }
        else
        {
            gvTSelf.UpdateEdit();
        }
    }
コード例 #11
0
        protected void grid_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            ASPxTextBox text   = grid.FindEditFormTemplateControl("txtName") as ASPxTextBox;
            ASPxTextBox textId = grid.FindEditFormTemplateControl("txtId") as ASPxTextBox;



            this.country.id  = -1;
            country.name     = text.Text;
            country.isactive = true;
            this.objCountry.AddCountry(country);
            grid.CancelEdit();
            e.Cancel             = true;
            this.grid.DataSource = objCountry.GetCountrys();
            this.grid.DataBind();
        }
コード例 #12
0
        protected void grid_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            ASPxTextBox text   = grid.FindEditFormTemplateControl("txtName") as ASPxTextBox;
            ASPxTextBox textId = grid.FindEditFormTemplateControl("txtId") as ASPxTextBox;



            this.health.id  = -1;
            health.name     = text.Text;
            health.isactive = true;
            this.objHealth.AddHealthType(health);
            grid.CancelEdit();
            e.Cancel             = true;
            this.grid.DataSource = objHealth.GetHealthTypes();
            this.grid.DataBind();
        }
コード例 #13
0
 protected override WebControl CreateEditModeControlCore()
 {
     if (AllowEdit.ResultValue)
     {
         ASPxTextBox textBox = RenderHelper.CreateASPxTextBox();
         textBox.ID = "textBox";
         textBox.ValidationSettings.RegularExpression.ValidationExpression = UrlEmailMask;
         textBox.ValidationSettings.RegularExpression.ErrorText            = UserVisibleExceptionLocalizer.GetExceptionMessage(UserVisibleExceptionId.MaskValidationErrorMessage);
         textBox.TextChanged += EditValueChangedHandler;
         return(textBox);
     }
     else
     {
         return(CreateViewModeControlCore());
     }
 }
コード例 #14
0
    protected void grid_bkg_RowUpdated(object sender, DevExpress.Web.Data.ASPxDataUpdatedEventArgs e)
    {
        ASPxGridView   grd     = sender as ASPxGridView;
        ASPxTextBox    mkgId   = grd.FindEditFormTemplateControl("txtMkgId") as ASPxTextBox;
        ASPxSpinEdit   wt      = grd.FindEditFormTemplateControl("spin_wt2") as ASPxSpinEdit;
        ASPxSpinEdit   m3      = grd.FindEditFormTemplateControl("spin_m4") as ASPxSpinEdit;
        ASPxSpinEdit   qty     = grd.FindEditFormTemplateControl("spin_pkg2") as ASPxSpinEdit;
        ASPxButtonEdit pkgType = grd.FindEditFormTemplateControl("txt_pkgType2") as ASPxButtonEdit;
        ASPxMemo       mkg     = grd.FindEditFormTemplateControl("txt_mkg2") as ASPxMemo;
        ASPxMemo       des     = grd.FindEditFormTemplateControl("txt_des2") as ASPxMemo;

        string sql = string.Format("update SeaExportMkg set Qty='{1}',PackageType='{2}',Weight='{3}',Volume='{4}',Marking='{5}',Description='{6}'  where SequenceId='{0}'"
                                   , mkgId.Text, qty.Value, pkgType.Text, wt.Value, m3.Value, mkg.Text, des.Text);

        ConnectSql.ExecuteSql(sql);
    }
コード例 #15
0
        public void InstantiateIn(Control _container)
        {
            GridViewEditItemTemplateContainer container = _container as GridViewEditItemTemplateContainer;

            object[] values    = (object[])container.Grid.GetRowValues(container.VisibleIndex, new string[] { "Type", "DataValue" });
            string   dataType  = Convert.ToString(values[0]);
            string   dataValue = Convert.ToString(values[1]);

            switch (dataType)
            {
            case "Text":
                ASPxTextBox txt = new ASPxTextBox();
                txt.ID   = "txt";
                txt.Text = dataValue;
                container.Controls.Add(txt);
                break;

            case "DateTime":
                ASPxDateEdit date = new ASPxDateEdit();
                date.ID   = "date";
                date.Date = Convert.ToDateTime(dataValue);
                container.Controls.Add(date);
                break;

            case "Dictionary1":
                ASPxComboBox cmb = new ASPxComboBox();
                cmb.ID         = "dict";
                cmb.DataSource = DataProvider.GetDictionaryData(DataType.Dictionary1);
                cmb.TextField  = "Data";
                cmb.ValueField = "Id";
                cmb.DataBind();
                cmb.Value = dataValue;
                container.Controls.Add(cmb);
                break;

            case "Dictionary2":
                ASPxComboBox cmb2 = new ASPxComboBox();
                cmb2.ID         = "dict";
                cmb2.DataSource = DataProvider.GetDictionaryData(DataType.Dictionary2);
                cmb2.TextField  = "Data";
                cmb2.ValueField = "Id";
                cmb2.DataBind();
                cmb2.Value = dataValue;
                container.Controls.Add(cmb2);
                break;
            }
        }
コード例 #16
0
        protected void ASPxCardView1_CardInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            ASPxCardView card = sender as ASPxCardView;
            ASPxTextBox  f    = FindPageControl(card).FindControl("f") as ASPxTextBox;

            e.NewValues["FirstName"] = f.Text;
            ASPxTextBox l = FindPageControl(card).FindControl("l") as ASPxTextBox;

            e.NewValues["LastName"] = l.Text;
            ASPxTextBox j = FindPageControl(card).FindControl("j") as ASPxTextBox;

            e.NewValues["JeuneFilleName"] = j.Text;
            ASPxTextBox p = FindPageControl(card).FindControl("p") as ASPxTextBox;

            e.NewValues["Position"] = p.Text;
            ASPxDateEdit d = FindPageControl(card).FindControl("d") as ASPxDateEdit;

            e.NewValues["DateOfBirth"] = Convert.ToDateTime(d.Text);
            ASPxTextBox m = FindPageControl(card).FindControl("m") as ASPxTextBox;

            e.NewValues["MaritalStatus"] = m.Text;
            ASPxTextBox s = FindPageControl(card).FindControl("s") as ASPxTextBox;

            e.NewValues["SocialSecurityRef"] = s.Text;
            ASPxTextBox fa = FindPageControl(card).FindControl("fa") as ASPxTextBox;

            e.NewValues["FatherId"] = fa.Text;
            ASPxTextBox mo = FindPageControl(card).FindControl("mo") as ASPxTextBox;

            e.NewValues["MotherId"] = mo.Text;
            ASPxTextBox st = FindPageControl(card).FindControl("st") as ASPxTextBox;

            e.NewValues["State"] = st.Text;
            ASPxDateEdit da = FindPageControl(card).FindControl("da") as ASPxDateEdit;

            e.NewValues["DeathDate"] = Convert.ToDateTime(da.Text);
            ASPxTextBox sex = FindPageControl(card).FindControl("sex") as ASPxTextBox;

            e.NewValues["Sexe"] = sex.Text;
            ASPxTextBox fax = FindPageControl(card).FindControl("fax") as ASPxTextBox;

            e.NewValues["Fax"] = fax.Text;
            ASPxTextBox note = FindPageControl(card).FindControl("note") as ASPxTextBox;

            e.NewValues["note"]  = note.Text;
            e.NewValues["Photo"] = Session["data"];
        }
コード例 #17
0
    //end update

    /// <summary>
    /// new record
    /// </summary>
    protected int insert_voyage()
    {
        int _newid = 0;

        try
        {
            ///new instance of record
            VoyageTable _tbl    = new VoyageTable();
            string      _joined = "";

            //get values off editform
            //vessel id
            ASPxComboBox _cbo = (ASPxComboBox)this.fmvVoyage.FindControl("dxcboVesselID");
            if (_cbo != null && _cbo.Value != null)
            {
                _tbl.VesselID = wwi_func.vint(_cbo.Value.ToString());
                _joined       = _cbo.Text.ToString();
            }

            //voyage number
            ASPxTextBox _txt = (ASPxTextBox)this.fmvVoyage.FindControl("dxtxtVoyageNumber");
            if (_txt != null)
            {
                _tbl.VoyageNumber = _txt.Text.ToString();
                _joined          += " " + _txt.Text.ToString();
            }

            //joined = vessel name & voyage number
            _tbl.Joined = _joined;
            //user
            _tbl.AddedBy = Page.Session["user"] != null ? (Int32)((UserClass)Page.Session["user"]).UserId : 0;
            //date
            _tbl.DateAdded = DateTime.Now;
            //insert
            _tbl.Save();
            //get new id
            _newid = (int)_tbl.GetPrimaryKeyValue();
        }
        catch (Exception ex)
        {
            string _ex = ex.Message.ToString();
            this.dxlblErr.Text          = _ex;
            this.dxpnlErr.ClientVisible = true;
        }

        return(_newid);
    }
コード例 #18
0
ファイル: ArCnEdit.aspx.cs プロジェクト: felix-wei/tsllog1806
    protected void grid_InvDet_InitNewRow(object sender, DevExpress.Web.Data.ASPxDataInitNewRowEventArgs e)
    {
        e.NewValues["DocLineNo"] = 0;
        ASPxTextBox docCurr = this.ASPxGridView1.FindEditFormTemplateControl("txt_Currency") as ASPxTextBox;

        e.NewValues["Currency"] = docCurr.Text;
        e.NewValues["ExRate"]   = 1.0;
        e.NewValues["GstAmt"]   = 0;
        e.NewValues["DocAmt"]   = 0;
        e.NewValues["LocAmt"]   = 0;
        e.NewValues["Qty"]      = 1;
        e.NewValues["Price"]    = 0;
        e.NewValues["GstType"]  = "Z";
        e.NewValues["AcSource"] = "DB";
        e.NewValues["InvNo"]    = " ";
        e.NewValues["InvId"]    = 0;
    }
コード例 #19
0
ファイル: atpu2000.aspx.cs プロジェクト: radtek/DCEC
    //修改
    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();
    }
コード例 #20
0
 protected void grid_ref_HtmlEditFormCreated(object sender, ASPxGridViewEditFormEventArgs e)
 {
     if (this.grid_ref.EditingRowVisibleIndex > -1)
     {
         ASPxPageControl pageControl        = this.grid_ref.FindEditFormTemplateControl("pageControl") as ASPxPageControl;
         ASPxTextBox     txt_AgentName      = this.grid_ref.FindEditFormTemplateControl("txt_AgentName") as ASPxTextBox;
         ASPxTextBox     txt_CrAgentName    = this.grid_ref.FindEditFormTemplateControl("txt_CrAgentName") as ASPxTextBox;
         ASPxTextBox     txt_NvoccAgentName = pageControl.FindControl("txt_NvoccAgentName") as ASPxTextBox;
         ASPxTextBox     txt_LocalCustName  = this.grid_ref.FindEditFormTemplateControl("txt_LocalCustName") as ASPxTextBox;
         ASPxTextBox     txt_WhName         = pageControl.FindControl("txt_WhName") as ASPxTextBox;
         ASPxDateEdit    refDate            = this.grid_ref.FindEditFormTemplateControl("date_RefDate") as ASPxDateEdit;
         refDate.ReadOnly        = true;
         refDate.BackColor       = ((DevExpress.Web.ASPxEditors.ASPxTextBox)(this.grid_ref.FindEditFormTemplateControl("txt_RefN"))).BackColor;
         txt_LocalCustName.Text  = EzshipHelper.GetPartyName(this.grid_ref.GetRowValues(this.grid_ref.EditingRowVisibleIndex, new string[] { "LocalCust" }));
         txt_AgentName.Text      = EzshipHelper.GetPartyName(this.grid_ref.GetRowValues(this.grid_ref.EditingRowVisibleIndex, new string[] { "AgentId" }));
         txt_CrAgentName.Text    = EzshipHelper.GetPartyName(this.grid_ref.GetRowValues(this.grid_ref.EditingRowVisibleIndex, new string[] { "CarrierAgentId" }));
         txt_NvoccAgentName.Text = EzshipHelper.GetPartyName(this.grid_ref.GetRowValues(this.grid_ref.EditingRowVisibleIndex, new string[] { "NvoccAgentId" }));
         txt_WhName.Text         = EzshipHelper.GetPartyName(this.grid_ref.GetRowValues(this.grid_ref.EditingRowVisibleIndex, new string[] { "WareHouseId" }));
         int oid = SafeValue.SafeInt(this.grid_ref.GetRowValues(this.grid_ref.EditingRowVisibleIndex, new string[] { "Id" }), 0);
         if (oid > 0)
         {
             string     userId         = HttpContext.Current.User.Identity.Name;
             ASPxLabel  lab_StatusCode = pageControl.FindControl("lb_JobStatus") as ASPxLabel;
             string     sql            = string.Format("select StatusCode from air_ref  where Id={0}", oid);
             string     closeInd       = SafeValue.SafeString(Manager.ORManager.ExecuteScalar(sql));
             ASPxButton btn_VoidMaster = this.grid_ref.FindEditFormTemplateControl("btn_VoidMaster") as ASPxButton;
             ASPxButton btn_CloseJob   = this.grid_ref.FindEditFormTemplateControl("btn_CloseJob") as ASPxButton;
             if (closeInd == "CLS")
             {
                 btn_CloseJob.Text   = "Open Job";
                 lab_StatusCode.Text = "Close";
             }
             else if (closeInd == "CNL")
             {
                 btn_VoidMaster.Text = "Unvoid";
                 lab_StatusCode.Text = "Void";
             }
             else
             {
                 btn_CloseJob.Text   = "Close Job";
                 lab_StatusCode.Text = "USE";
                 btn_VoidMaster.Text = "Void";
             }
         }
     }
 }
コード例 #21
0
        private ASPxTextBox createNode(string nodeText, string nodeId)
        {
            ASPxTextBox newNode = new ASPxTextBox();

            newNode.Text = nodeText;
            newNode.ID   = nodeId;
            newNode.Border.BorderStyle = BorderStyle.Solid;
            newNode.Border.BorderWidth = 1;
            newNode.Height             = 100;
            newNode.Width           = 170;
            newNode.Enabled         = false;
            newNode.Cursor          = "pointer";
            newNode.HorizontalAlign = HorizontalAlign.Center;
            //newNode.ClientSideEvents = "function(s,e) {var index = ListNode.GetSelectedIndex();if(index!=-1) {var items = ListNode.GetSelectedItems();PanelNode.PerformCallback(items[0].text);}}";

            return(newNode);
        }
コード例 #22
0
    protected void grid_Zone_BeforePerformDataSelect(object sender, EventArgs e)
    {
        ASPxPageControl pageControl = this.grid.FindEditFormTemplateControl("pageControl") as ASPxPageControl;
        ASPxTextBox     txt_Code    = pageControl.FindControl("txt_Code") as ASPxTextBox;

        string where = "";
        if (txt_Code.Text.Trim() != "")
        {
            where  = "LocLevel='Zone'";
            where += string.Format(" and WarehouseCode='{0}'", txt_Code.Text.Trim());
        }
        else
        {
            where = "1=0";
        }
        this.dsRefZone.FilterExpression = where;
    }
コード例 #23
0
    protected void grid_Transport_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
    {
        if (e.RowType != DevExpress.Web.ASPxGridView.GridViewRowType.Data)
        {
            return;
        }
        ASPxButtonEdit driver = this.grid_Transport.FindRowTemplateControl(e.VisibleIndex, "btn_DriveCode") as ASPxButtonEdit;

        if (driver != null)
        {
            driver.ClientInstanceName = driver.ClientInstanceName + e.VisibleIndex;
            ASPxTextBox towhead = this.grid_Transport.FindRowTemplateControl(e.VisibleIndex, "txt_TowheadCode") as ASPxTextBox;
            towhead.ClientInstanceName = towhead.ClientInstanceName + e.VisibleIndex;
            ASPxTextBox ScheduleDate = this.grid_Transport.FindRowTemplateControl(e.VisibleIndex, "txt_ScheduleDate") as ASPxTextBox;
            driver.ClientSideEvents.ButtonClick = "function(s,e){" + string.Format("PopupCTM_DriverLog({0},null,{1},'{2}');", driver.ClientInstanceName, towhead.ClientInstanceName, ScheduleDate.Text) + "}";
        }
    }
コード例 #24
0
        protected void grid_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            ASPxTextBox  text      = grid.FindEditFormTemplateControl("txtName") as ASPxTextBox;
            ASPxTextBox  txtMaNhom = grid.FindEditFormTemplateControl("txtMaNhom") as ASPxTextBox;
            ASPxSpinEdit txtThuTu  = grid.FindEditFormTemplateControl("txtThuTu") as ASPxSpinEdit;
            ASPxComboBox cmbNNL    = grid.FindEditFormTemplateControl("cmbNNL") as ASPxComboBox;



            int n = SqlHelper.ExecuteNonQuery(strconn, "SP_HRM_NhomChucDanhB", Int32.Parse(e.Keys[grid.KeyFieldName].ToString()), text.Text, txtMaNhom.Text, Int32.Parse(txtThuTu.Text), Int32.Parse(cmbNNL.Value.ToString()), 1);



            grid.CancelEdit();
            e.Cancel = true;
            LoadNhomChucDanh();
        }
コード例 #25
0
 protected void grd_DSRole_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
 {
     try
     {
         e.Cancel = true;
         ASPxFormLayout pnLayData = grd_DSRole.FindEditFormTemplateControl("LayOutThemSua") as ASPxFormLayout;
         ASPxMemo       txtNote   = pnLayData.FindControl("txtNote") as ASPxMemo;
         ASPxTextBox    txtName   = pnLayData.FindControl("txtName") as ASPxTextBox;
         ctlRole.insertRoles(txtName.Text, txtNote.Text);
         BindataThemNhanh();
         Utils.notifierGrid(grd_DSRole, Constant.NOTIFY_SUCCESS, "Bạn đã thêm thành công Role có [" + txtName.Text + "]");
     }
     catch (Exception ex)
     {
         Utils.notifierGrid(grd_DSRole, Constant.NOTIFY_FAILURE, ex.Message + " " + ex.StackTrace);
     }
 }
コード例 #26
0
ファイル: LCEdit.aspx.cs プロジェクト: felix-wei/tsllog1806
    protected void cmb_Status_CustomJSProperties(object sender, DevExpress.Web.ASPxClasses.CustomJSPropertiesEventArgs e)
    {
        ASPxComboBox cmb_Status = grid.FindEditFormTemplateControl("cmb_Status") as ASPxComboBox;
        ASPxTextBox  txt_LcNo   = grid.FindEditFormTemplateControl("txt_LcNo") as ASPxTextBox;
        string       doNo       = SafeValue.SafeString(txt_LcNo.Text);
        string       sql        = string.Format(@"select StatusCode from Wh_Trans where LcNo='{0}'", doNo);
        string       status     = SafeValue.SafeString(C2.Manager.ORManager.ExecuteScalar(sql), "N");

        if (status == "Confirmed")
        {
            cmb_Status.Text = "Confirmed";
        }
        if (status == "Draft")
        {
            cmb_Status.Text = "Draft";
        }
    }
コード例 #27
0
    protected void grid_contact_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
    {
        ASPxPageControl pageControl = this.grid.FindEditFormTemplateControl("pageControl") as ASPxPageControl;
        ASPxTextBox     txtPartyId  = pageControl.FindControl("txtPartyId") as ASPxTextBox;
        ASPxTextBox     txtName     = pageControl.FindControl("txtName") as ASPxTextBox;

        e.NewValues["PartyId"]   = txtPartyId.Text;
        e.NewValues["PartyName"] = txtName.Text;
        e.NewValues["IsDefault"] = SafeValue.SafeBool(e.NewValues["IsDefault"], true);
        e.NewValues["Name"]      = SafeValue.SafeString(e.NewValues["Name"]);
        e.NewValues["Tel"]       = SafeValue.SafeString(e.NewValues["Tel"]);
        e.NewValues["Fax"]       = SafeValue.SafeString(e.NewValues["Fax"]);
        e.NewValues["Address"]   = SafeValue.SafeString(e.NewValues["Address"]);
        e.NewValues["Email"]     = SafeValue.SafeString(e.NewValues["Email"]);
        e.NewValues["Mobile"]    = SafeValue.SafeString(e.NewValues["Mobile"]);
        e.NewValues["Remark"]    = SafeValue.SafeString(e.NewValues["Remark"]);
    }
コード例 #28
0
    protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
    {
        ASPxTextBox uJX  = ASPxGridView1.FindEditFormTemplateControl("txtJX") as ASPxTextBox;
        ASPxTextBox uRZG = ASPxGridView1.FindEditFormTemplateControl("txtRZG") as ASPxTextBox;
        ASPxTextBox uSC  = ASPxGridView1.FindEditFormTemplateControl("txtSC") as ASPxTextBox;

        ASPxTextBox  uS1    = ASPxGridView1.FindEditFormTemplateControl("txtS1") as ASPxTextBox;
        ASPxTextBox  uS2    = ASPxGridView1.FindEditFormTemplateControl("txtS2") as ASPxTextBox;
        ASPxTextBox  uS3    = ASPxGridView1.FindEditFormTemplateControl("txtS3") as ASPxTextBox;
        ASPxComboBox uSFMRZ = ASPxGridView1.FindEditFormTemplateControl("txtSFMRZ") as ASPxComboBox;

        string strSFMRZ = uSFMRZ.Value.ToString();

        //插入到日志表
        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 + "' , 'BEFOREEDIT', SYSDATE FROM ATPUEMARK WHERE FDJJX = '" + uJX.Text.Trim() + "'";
            dc.ExeSql(Sql2);
        }
        catch
        {
            return;
        }
        string Sql = "UPDATE ATPUEMARK SET SC='" + uSC.Text.Trim().ToUpper() + "',RZZS1='" + uS1.Text.Trim() + "',RZZS2='" + uS2.Text.Trim() + "',"
                     + "RZZS3='" + uS3.Text.Trim() + "',RZG='" + uRZG.Text.Trim() + "',SFMRZ='" + uSFMRZ.Text.Trim() + "',"
                     + "WHRQ=to_date('" + theTime + "','yyyy-mm-dd hh24:mi:ss'),INPUT_TIME=SYSDATE,INPUT_PERSON='" + theUserId + "' "
                     + " WHERE   FDJJX = '" + uJX.Text.Trim() + "'";

        dc.ExeSql(Sql);
        //插入到日志表
        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 + "' , 'AFTEREDIT', SYSDATE FROM ATPUEMARK WHERE FDJJX = '" + uJX.Text.Trim() + "'";
            dc.ExeSql(Sql2);
        }
        catch
        {
            return;
        }

        e.Cancel = true;
        ASPxGridView1.CancelEdit();
        setCondition();
    }
コード例 #29
0
        protected override void SetupControl(WebControl control)
        {
            base.SetupControl(control);
            if (control is ASPxTextBox)
            {
                ASPxTextBox         aSPxTextBox     = (ASPxTextBox)control;
                ASPxPureTextBoxBase aSPxPureTextBox = (ASPxPureTextBoxBase)control;
                aSPxPureTextBox.HorizontalAlign          = HorizontalAlign.Left;
                aSPxTextBox.MaskSettings.Mask            = "$ <-99999999999..99999999999g>.<00..99>";
                aSPxTextBox.MaskSettings.IncludeLiterals = MaskIncludeLiteralsMode.All;
                aSPxTextBox.MaskSettings.AllowMouseWheel = false;
                aSPxTextBox.DisplayFormatString          = CurrencyFormat;

                aSPxTextBox.ValueChanged += new EventHandler(this.SelectedCurrencyChangedHandler);
                aSPxTextBox.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.None;
            }
        }
コード例 #30
0
        protected void grid_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            ASPxTextBox  txtName            = grid.FindEditFormTemplateControl("txtName") as ASPxTextBox;
            ASPxTextBox  txtVietTat         = grid.FindEditFormTemplateControl("txtVietTat") as ASPxTextBox;
            ASPxTextBox  txtCapKhenThuong   = grid.FindEditFormTemplateControl("txtCapKhenThuong") as ASPxTextBox;
            ASPxMemo     memoGhiChu         = grid.FindEditFormTemplateControl("memoGhiChu") as ASPxMemo;
            ASPxComboBox cmbDoiTuongUpdate  = grid.FindEditFormTemplateControl("cmbDoiTuongUpdate") as ASPxComboBox;
            ASPxComboBox cmbThanhTichUpdate = grid.FindEditFormTemplateControl("cmbThanhTichUpdate") as ASPxComboBox;

            int n = SqlHelper.ExecuteNonQuery(strconn, "[HRM_DanhHieuThiDua_UI]", Int32.Parse(e.Keys[grid.KeyFieldName].ToString()), cmbThanhTichUpdate.Value, txtName.Text, txtVietTat.Text, memoGhiChu.Text,
                                              cmbDoiTuongUpdate.Value, txtCapKhenThuong.Text, 1);

            grid.CancelEdit();
            e.Cancel = true;
            grid.DataBind();
            LoadDanhHieuThiDua(Int32.Parse(cmbDoiTuong.Value.ToString()), Int32.Parse(cmbThanhTich.Value.ToString()));
        }
コード例 #31
0
ファイル: TextBox.cs プロジェクト: pampero/cgControlPanel
        public List<WebControl> RenderControl(XmlNode xmlControl)
        {
            base.Initialize(xmlControl);

            ASPxTextBox aspxTextBox = new ASPxTextBox
                                          {
                                              MaxLength = _PropertyMapper.GetMaxLength(),
                                              ID = _PropertyMapper.GetID(),
                                              NullText = "Ingrese un valor",
                                              Width = new Unit(80, UnitType.Percentage),
                                              ReadOnly = _PropertyMapper.ReadOnly()
                                          };

            aspxTextBox.ValidationSettings.SetFocusOnError = true;
            aspxTextBox.ValidationSettings.RequiredField.IsRequired = _PropertyMapper.Required();
            aspxTextBox.ValidationSettings.RequiredField.ErrorText = "Campo Requerido";
            aspxTextBox.ValidationSettings.ValidationGroup = "InputValidation";

            _Controls.Add(aspxTextBox);

            return _Controls;
        }
コード例 #32
0
ファイル: CMN_ORG.aspx.cs プロジェクト: TIT-tech/OPM_BO
    protected void BindExisting(ASPxSpinEdit txtSerialLevel, ASPxTextBox txtNameLevel, ASPxTextBox txtAbbrLevel, string ORG_SERIAL, ASPxRadioButton rdActive, ASPxRadioButton rdCancel)
    {
        string SQL = "select ORG_SERIAL,ORG_NAME,ORG_ABBR,ORG_TYPE,ORG_STATUS from CTLT_ORGANIZE where ORG_SERIAL='" + ORG_SERIAL + "'";
        SqlDataAdapter DA = new SqlDataAdapter(SQL, OPM_BL.DefaultConnectionString);
        DataTable DT = new DataTable();
        DA.Fill(DT);
        if (DT.Rows.Count > 0)
        {
            txtSerialLevel.Text = DT.Rows[0]["ORG_SERIAL"].ToString();
            txtSerialLevel.ReadOnly = true;
            txtSerialLevel.BackColor = System.Drawing.Color.Gray;

            txtNameLevel.Text = DT.Rows[0]["ORG_NAME"].ToString();
            txtAbbrLevel.Text = DT.Rows[0]["ORG_ABBR"].ToString();

            if ( DT.Rows[0]["ORG_STATUS"].ToString() == "A"){
                rdActive .Checked =true ;
                rdCancel.Checked =false ;
            }else{
                rdActive .Checked =false  ;
                rdCancel.Checked =true  ;
            }
        }
        else
        {
            txtSerialLevel.Text = "";
            txtSerialLevel.ReadOnly = false;
            txtSerialLevel.BackColor = System.Drawing.Color.White;

            txtNameLevel.Text = "";
            txtAbbrLevel.Text = "";
            rdActive.Checked = true;
            rdCancel.Checked = false;

        }
    }
コード例 #33
0
ファイル: FGMMain.aspx.cs プロジェクト: KijongNam/EDIS
        public void InstantiateIn(Control container)
        {
            Control control = new Control();
            control.ID = "GroupDetectorEditForm";
            container.Controls.Add(control);
            
            DataTable dt = datafield;
            string db_name = "";
            string desc_name = "";
            string auth = "";
            string cell_type = "";

            ASPxFormLayout editform_GroupDetector = new ASPxFormLayout();
            editform_GroupDetector.ID = "editform_GroupDetector";
            //editform_GroupDetector.Border.BorderWidth = Unit.Pixel(1);
            //editform_GroupDetector.SettingsItems.VerticalAlign = FormLayoutVerticalAlign.Middle;
            //editform_GroupDetector.SettingsItems.HorizontalAlign = FormLayoutHorizontalAlign.Center;
            editform_GroupDetector.Paddings.Padding = Unit.Pixel(8);
            
            
            foreach (DataRow dr in dt.Select("AUTH <> 'System'", "VIEW_SEQ"))
            {
                db_name = dr["DB_NAME"].ToString();
                desc_name = dr["DESC_NAME"].ToString();
                auth = dr["AUTH"].ToString();
                cell_type = dr["SEL_TYPE"].ToString();
                

                LayoutItem li = new LayoutItem(desc_name);
                li.FieldName = db_name;
                
                editform_GroupDetector.Items.Add(li);
                LayoutItemNestedControlContainer li_container = li.LayoutItemNestedControlContainer;
                if (auth == "Manager")
                {
                    li.CaptionStyle.Font.Bold = true;
                    li.CaptionStyle.ForeColor = Color.Red;
                }


                if (cell_type == "DropDown List")
                {
                    ASPxDropDownEdit dropdownEdit = new ASPxDropDownEdit();
                    dropdownEdit.ID = db_name;

                    ASPxComboBox comboBox = new ASPxComboBox();
                    comboBox.DataSource = Srch_DropDownItem(db_name);
                    comboBox.TextField = "LOOKUPDETDESC";
                    comboBox.DataBind();
                    comboBox.IncrementalFilteringMode = IncrementalFilteringMode.StartsWith;
                    comboBox.DropDownStyle = DropDownStyle.DropDown;
                    comboBox.EnableSynchronization = DevExpress.Utils.DefaultBoolean.False;
                    li_container.Controls.Add(comboBox);
                }
                else if (cell_type == "Note")
                {
                    ASPxMemo textMemo = new ASPxMemo();
                    textMemo.ID = db_name;
                    textMemo.Width = Unit.Percentage(91);
                    li_container.Controls.Add(textMemo);
                }
                else
                {
                    
                    ASPxTextBox textBox = new ASPxTextBox();
                    textBox.ID = db_name;
                    li_container.Controls.Add(textBox);


                    //Suffix 증가 유무 체크 (15.10.16)
                    if (db_name == "CNT")
                    {
                        li = new LayoutItem("Suffix");
                        li.FieldName = "DETECTOR_SUFFIX";

                        editform_GroupDetector.Items.Add(li);
                        li_container = li.LayoutItemNestedControlContainer;

                        ASPxCheckBox chkBox = new ASPxCheckBox();
                        chkBox.ID = "DETECTOR_SUFFIX";
                        li_container.Controls.Add(chkBox);
                    }

                }
                
            }
            

            container.Controls.Add(editform_GroupDetector);
            //container.Controls.Add(editform_GroupDetector);
            
            //Button
            ASPxFormLayout btn_lo = new ASPxFormLayout();
            btn_lo.ID = "button_GroupDetector";
            btn_lo.ColCount = 1;
            btn_lo.Width = Unit.Percentage(90);
            btn_lo.SettingsItems.HorizontalAlign = FormLayoutHorizontalAlign.Right;
            btn_lo.Paddings.Padding = Unit.Pixel(1);

            LayoutItem btn_li = new LayoutItem("btn_li");
            btn_li.ShowCaption = DevExpress.Utils.DefaultBoolean.False;
            btn_lo.Items.Add(btn_li);
            LayoutItemNestedControlContainer btn_li_container = btn_li.LayoutItemNestedControlContainer;

            ASPxGridViewTemplateReplacement btn_add = new ASPxGridViewTemplateReplacement();
            btn_add.ReplacementType = GridViewTemplateReplacementType.EditFormUpdateButton;
            btn_add.ID = "btn_add";
            btn_li_container.Controls.Add(btn_add);

            //LayoutItem btn_li2 = new LayoutItem("btn_li2");
            //btn_li2.ShowCaption = DevExpress.Utils.DefaultBoolean.False;
            //btn_lo.Items.Add(btn_li2);
            //LayoutItemNestedControlContainer btn_li_container2 = btn_li2.LayoutItemNestedControlContainer;

            ASPxGridViewTemplateReplacement btn_cancel = new ASPxGridViewTemplateReplacement();
            btn_cancel.ReplacementType = GridViewTemplateReplacementType.EditFormCancelButton;
            btn_cancel.ID = "btn_cancel";
            btn_li_container.Controls.Add(btn_cancel);
            //btn_li.HorizontalAlign = FormLayoutHorizontalAlign.Right;

            container.Controls.Add(btn_lo);
        }
コード例 #34
0
    private WebControl CreateTextEdit(Control container)
    {
        ASPxTextBox textbox = new ASPxTextBox();
        templateContainer = (GridViewDataItemTemplateContainer)container;
        textbox.ID = string.Format("{0}_{1}", (templateContainer.Column).FieldName, templateContainer.VisibleIndex);
        textbox.ClientInstanceName = string.Format("{0}_{1}", (templateContainer.Column).FieldName, templateContainer.VisibleIndex);
        textbox.Value = templateContainer.Grid.GetRowValues(templateContainer.VisibleIndex, (templateContainer.Column).FieldName).ToString();

        object clientevent = SqlHelper.ExecuteScalar( DataServices.ConnectString, "SY_modulefields_getClientevent", _moduleID, _tableName, (templateContainer.Column).FieldName);
        if (clientevent != null)
        {
            Dictionary<string, string> valueclientevent = JsonConvert.DeserializeObject<Dictionary<string, string>>(clientevent.ToString());
            if (valueclientevent != null)
            {
                textbox.ClientSideEvents.GotFocus = valueclientevent["gotfocus"];
                textbox.ClientSideEvents.Init = valueclientevent["init"];
                textbox.ClientSideEvents.KeyDown = valueclientevent["keydown"];
                textbox.ClientSideEvents.KeyPress = valueclientevent["keypress"];
                textbox.ClientSideEvents.KeyUp = valueclientevent["keyup"];
                textbox.ClientSideEvents.LostFocus = valueclientevent["lostfocus"];
                textbox.ClientSideEvents.TextChanged = valueclientevent["textchanged"];
                textbox.ClientSideEvents.Validation = valueclientevent["validation"];
                textbox.ClientSideEvents.ValueChanged = valueclientevent["valuechanged"];
                //{"gotfocus":"","init":"","keydown":"","keypress":"","keyup":"","lostfocus":"","textchanged":"","validation":"","valuechanged":""}
            }
        }
        return textbox;
    }
コード例 #35
0
    public List<HtmlTableCell> BuildTextBox(string fieldtext, string id, string helptext, string SkinID, int length, bool isReadOnly, string controlValue)
    {
        List<HtmlTableCell> c = new List<HtmlTableCell>();
        try
        {
            HtmlTableCell cell = new HtmlTableCell();
            cell.Attributes.Add("class", "tblFormViewtdLabel");
            cell.Style.Add("Width", "20%");
            ASPxLabel lb = new ASPxLabel() { Text = fieldtext };
            cell.Controls.Add(lb);
            HtmlTableCell celledit = new HtmlTableCell();
            celledit.Attributes.Add("class", "tblFormViewtdValue");
            celledit.Style.Add("Width", "30%");
            ASPxTextBox txt = new ASPxTextBox();
            txt.Style.Add("Width", "98%");
            txt.SkinID = SkinID;
            txt.MaxLength = length;
            txt.NullText = helptext;
            txt.ID = id;
            txt.Theme = "DevEx";
            txt.AutoPostBack = false;
            txt.Text = controlValue;
            txt.Width = Unit.Percentage(100);
            txt.ReadOnly = isReadOnly;
            celledit.Controls.Add(txt);

            c.Add(cell);
            c.Add(celledit);
            cot += 2;

        }
        catch (Exception)
        {
            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), Guid.NewGuid().ToString(),
                                                 "<script> alert('buildTextBox fieldname"+id+"'); </script>",
                                                 false);
        }
        return c;
    }
コード例 #36
0
 public static void SetTextBoxValue(ASPxTextBox Textbox, object objects)
 {
     try
     {
         if (objects != null)
             Textbox.Text = objects.ToString();
     }
     catch (Exception ex)
     {
         SiAuto.Main.LogString("Lỗi SetTextBoxValue :", ex.ToString());
     }
 }
コード例 #37
0
ファイル: InterfaceHelper.cs プロジェクト: ramyothman/RBM
        public static void AddTextQuestionAdvanced(BusinessLogicLayer.Entities.FormBuilder.FormField Q, Panel QuestionPanel)
        {
            QuestionPanel.ToolTip = Q.FormFieldType.Name;
             Label QuestionTitle = new Label();
             QuestionTitle.Text = String.Format(@"<span class='fb-Title'>{0}</span>", Q.Title);

             //-----
             Label IsReqired = new Label();
             IsReqired.Text = (Q.IsRequired) ? "*Required" : "";
             //-----
             Label HelpText = new Label();
             HelpText.Text = Q.HelpText;
             //-----
             ASPxTextBox txtAnswer = new ASPxTextBox();
             txtAnswer.ID = String.Format("Answer{0}", Q.FormFieldValues[0].FormFieldValueId);
             txtAnswer.Width = new Unit(250);
             if (Q.IsRequired)
             {
                 txtAnswer.ValidationSettings.CausesValidation = true;
                 txtAnswer.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.Text;
                 txtAnswer.ValidationSettings.RequiredField.IsRequired = true;
             }
             //-----
             ControlsAdder(QuestionPanel, QuestionsTemplates.Text, new Control[4] { QuestionTitle, IsReqired, HelpText, txtAnswer }, new String[4] { "@QuestionTitle", "@IsRequired", "@HelpText", "@AnswerTextBox" });
        }
コード例 #38
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TabPage)) throw new NullReferenceException("TabPage Vazia");
            if (string.IsNullOrEmpty(GridID)) throw new NullReferenceException("GridView Vazia");
            if (string.IsNullOrEmpty(DataSourceID)) throw new NullReferenceException("DataSourceID Vazia");
            txtBox = NamingContainer.FindControl(TxtBoxID) as ASPxTextBox;
            Grid = NamingContainer.FindControl(GridID) as ASPxGridView;
            DataSource = NamingContainer.FindControl(DataSourceID) as SqlDataSource;

            UsuariosControle ctrlUsu = new UsuariosControle();

            string idUsu = ctrlUsu.GetUsuarioByLogin(HttpContext.Current.Session["pUId"].ToString()).UsuarioID.ToString();
            sqlSituacao.SelectParameters["@usuario"].DefaultValue = idUsu;
            sqlSituacaoExterno.SelectParameters["@usuario"].DefaultValue = idUsu;

            HabilitarBotoes();
        }