protected virtual WebControl CreateCentredText() { Table table = new Table(); TableRow row = new TableRow(); TableCell cell = new TableCell(); table.Rows.Add(row); row.Cells.Add(cell); ASPxLabel lblSuccess = new ASPxLabel(); lblSuccess.ID = "lblSuccess"; lblSuccess.Text = "Record Saved Successfuly ."; cell.Controls.Add(lblSuccess); cell.Controls.Add(new LiteralControl(" ")); cell.Controls.Add(new LiteralControl("<br/>")); ASPxButton buttonSendNewMsg = new ASPxButton(); buttonSendNewMsg.ID = "ButtonSendNewMsg"; buttonSendNewMsg.RenderMode = ButtonRenderMode.Link; buttonSendNewMsg.Text = "New Customer Item"; cell.Controls.Add(buttonSendNewMsg); table.Height = Unit.Percentage(100); table.Width = Unit.Percentage(100); table.BorderWidth = Unit.Pixel(0); cell.VerticalAlign = VerticalAlign.Middle; cell.HorizontalAlign = HorizontalAlign.Center; return(table); }
private void OnLoad() { int start = 0; int end = 5000; for (int i = start; i < end; i++) { ASPxCheckBox isPay = this.grid_handle.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_handle.Columns["No"], "ack_IsPay") as ASPxCheckBox; ASPxTextBox txt_Id = this.grid_handle.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_handle.Columns["No"], "txt_Id") as ASPxTextBox; //ASPxLabel lbl_DoNo = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn)this.grid.Columns["DoNo"], "lbl_DoNo") as ASPxLabel; //ASPxLabel lbl_Description = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn)this.grid.Columns["Description"], "lbl_Description") as ASPxLabel; ASPxLabel lbl_PartyId = this.grid_handle.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_handle.Columns["PartyName"], "lbl_PartyId") as ASPxLabel; //ASPxLabel lbl_LotNo = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn)this.grid.Columns["LotNo"], "lbl_LotNo") as ASPxLabel; ASPxLabel lbl_Qty = this.grid_handle.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_handle.Columns["Qty"], "lbl_Qty") as ASPxLabel; //ASPxLabel lbl_ChargeCode = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn)this.grid.Columns["ChargeCode"], "lbl_ChargeCode") as ASPxLabel; //ASPxSpinEdit spin_Price = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn)this.grid.Columns["Price"], "spin_Price") as ASPxSpinEdit; //ASPxSpinEdit spin_Surcharge = this.grid_handle.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn)this.grid_handle.Columns["Surcharge"], "spin_Surcharge") as ASPxSpinEdit; if (isPay != null && isPay.Checked) { list.Add(new Record(txt_Id.Text, lbl_PartyId.Text, 0)); } else if (txt_Id == null) { break; } ; } }
protected void nb_ItemClick(object source, DevExpress.Web.ASPxNavBar.NavBarItemEventArgs e) { ASPxNavBar navbar = source as ASPxNavBar; ASPxLabel lbl = Page.FindControl("lbl") as ASPxLabel; ASPxSplitter splitter = Page.FindControl("splitter") as ASPxSplitter; UserControl topgrid = splitter.FindControl("cbpTop").FindControl("topgrid") as UserControl; UserControl bottomgrid = splitter.FindControl("cbpBottom").FindControl("bottomgrid") as UserControl; ASPxGridView grid1 = null, grid2 = null; if (topgrid != null) { grid1 = topgrid.FindControl("grid1") as ASPxGridView; } if (bottomgrid != null) { grid2 = bottomgrid.FindControl("grid2") as ASPxGridView; } if (e.Item.Name == "itm32") { StringBuilder result = new StringBuilder(); if (grid1 != null) { result.AppendFormat("grid1 exists, current page is {0}", grid1.PageIndex + 1); } if (grid2 != null) { Object[] values = (Object[])grid2.GetRowValues(grid2.VisibleStartIndex + 1, new String[] { "Id", "Name", "Text" }); result.AppendFormat("<br />grid2 exists, the second visible row values are <span style=\"Color: Red;\">{0}, {1}, {2}</span>", values[0], values[1], values[2]); } lbl.Text = result.ToString(); } }
protected void Handler_OnCallback(object source, DevExpress.Web.CallbackEventArgs e) { String[] values = String.Concat(e.Parameter).Split(new char[] { '=' }, StringSplitOptions.RemoveEmptyEntries); if (values.Count() > 1) { switch (values[0]) { case "NewValue": int id; if (int.TryParse(values[1], out id)) { SelectedItem = Items.List.Where(f => f.Index == id).FirstOrDefault(); } break; } } if (EditValueChanged != null) { EditValueChanged(this, EventArgs.Empty); } InnerRender(); if (OnClickScript != "") { ASPxLabel label = new ASPxLabel(); label.ClientSideEvents.Init = string.Format(@"function(s,e) {{ {0} }}", OnClickScript); Controls.Add(label); } }
private void OnLoad() { int start = 0; int end = count; for (int i = start; i < end; i++) { ASPxCheckBox isPay = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["Id"], "ack_IsPay") as ASPxCheckBox; ASPxTextBox id = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["Id"], "txt_Id") as ASPxTextBox; ASPxLabel txt_ContNo = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ContNo"], "lbl_ContNo") as ASPxLabel; ASPxLabel lbl_JobNo = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["JobNo"], "lbl_JobNo") as ASPxLabel; ASPxLabel lbl_ContType = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ContType"], "lbl_ContType") as ASPxLabel; ASPxSpinEdit spin_Price = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["Price"], "spin_Price") as ASPxSpinEdit; ASPxSpinEdit spin_Qty = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["Qty"], "spin_Qty") as ASPxSpinEdit; ASPxTextBox txt_Unit = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["Unit"], "txt_Unit") as ASPxTextBox; ASPxTextBox txt_GroupBy = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["GroupBy"], "txt_GroupBy") as ASPxTextBox; if (id != null && isPay != null && isPay.Checked) { list.Add(new Record(SafeValue.SafeInt(id.Text, 0), lbl_JobNo.Text, "", "", SafeValue.SafeDecimal(spin_Price.Value), SafeValue.SafeDecimal(spin_Qty.Value), txt_Unit.Text, txt_GroupBy.Text)); } else if (id == null) { break; } } }
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; 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[] { "WarehouseId" })); string oid = SafeValue.SafeString(this.grid.GetRowValues(this.grid.EditingRowVisibleIndex, new string[] { "Id" })); if (oid.Length > 0) { ASPxLabel jobStatusStr = pageControl.FindControl("lb_JobStatus") as ASPxLabel; string sql = string.Format("select StatusCode from wh_SORelease 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_VoidMaster") as ASPxButton; if (closeInd == "CNL") { btn_VoidMaster.Text = "Unvoid"; jobStatusStr.Text = "Void"; } if (closeInd == "CLS") { btn.Text = "Open Job"; jobStatusStr.Text = "Close"; } else { jobStatusStr.Text = "USE"; } } } }
protected void Page_Load(object sender, EventArgs e) { ASPxLabel lblPageTitle = (ASPxLabel)Master.FindControl("lblPageTitle"); lblPageTitle.Text = "Administration: Default Image"; loadImage(); }
private void OnLoad() { string salesman = SafeValue.SafeString(Request.QueryString["Salesman"].ToString()); int start = 0; int end = 5000; for (int i = start; i < end; i++) { ASPxCheckBox isPay = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Id"], "ack_IsPay") as ASPxCheckBox; ASPxTextBox id = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Id"], "txt_Id") as ASPxTextBox; ASPxLabel product = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Product"], "lbl_ProductCode") as ASPxLabel; ASPxLabel lotNo = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["LotNo"], "lbl_LotNo") as ASPxLabel; ASPxSpinEdit qty = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Qty"], "spin_Qty") as ASPxSpinEdit; ASPxSpinEdit price = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Price"], "spin_Price") as ASPxSpinEdit; //ASPxComboBox location = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn)this.ASPxGridView1.Columns["Location"], "cmb_Location") as ASPxComboBox; ASPxLabel des1 = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Des1"], "lbl_Description") as ASPxLabel; ASPxComboBox cmb_SalesId = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Salesman"], "cmb_SalesId") as ASPxComboBox; ASPxSpinEdit hanQty = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["HanQty"], "spin_HandQty") as ASPxSpinEdit; if (id != null && isPay != null && isPay.Checked && product != null) { list.Add(new Record("", product.Text, lotNo.Text, SafeValue.SafeInt(qty.Text, 0), SafeValue.SafeDecimal(price.Text, 0), "", des1.Text, "", SafeValue.SafeInt(hanQty, 0))); } else if (id == null) { break; } ; } }
private void OnLoad() { int start = 0; int end = 5000; for (int i = start; i < end; i++) { ASPxCheckBox isPay = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Id"], "ack_IsPay") as ASPxCheckBox; ASPxTextBox sku = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["ProductCode"], "txt_Product") as ASPxTextBox; ASPxTextBox lotNo = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["LotNo"], "txt_LotNo") as ASPxTextBox; ASPxSpinEdit qty = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Qty1"], "spin_Qty1") as ASPxSpinEdit; ASPxLabel location = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Location"], "lbl_Location") as ASPxLabel; ASPxLabel des = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Description"], "txt_Description") as ASPxLabel; ASPxLabel wh = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["WareHouse"], "txt_WareHouse") as ASPxLabel; ASPxLabel doNo = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["DoNo"], "txt_DoNo") as ASPxLabel; ASPxComboBox fromWh = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["ToWarehouseId"], "cmb_WareHouse") as ASPxComboBox; ASPxComboBox toLoc = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["ToLocId"], "cmb_Location") as ASPxComboBox; if (sku != null && isPay != null && isPay.Checked) { list.Add(new Record(sku.Text, lotNo.Text, SafeValue.SafeInt(qty.Value, 0), location.Text, wh.Text, des.Text, doNo.Text , fromWh.Text, toLoc.Text)); } else if (sku == null) { break; } ; } }
public ParametrizedActionDateRangeControl(ActionContainerOrientation orientation) { _button = RenderHelper.CreateASPxButton(); _button.AutoPostBack = false; _button.Click += button_Click; _button.EnableClientSideAPI = true; _button.ID = "B"; Control editor = CreateEditorBody(); editor.ID = "Ed"; label = RenderHelper.CreateASPxLabel(); label.ID = "L"; label.Wrap = DevExpress.Utils.DefaultBoolean.False; Table table = RenderHelper.CreateTable(); table.CssClass = "ParametrizedActionControl"; table.ID = "T"; labelCell = new TableCell(); TableCell editorCell = new TableCell(); TableCell buttonCell = new TableCell(); FillTemplateTable(orientation, table, labelCell, editorCell, buttonCell); labelCell.Controls.Add(label); labelCell.CssClass = "ControlCaption"; editorCell.Controls.Add(editor); editorCell.CssClass = "Label"; buttonCell.Controls.Add(_button); buttonCell.CssClass = "Editor"; Controls.Add(table); }
private void OnLoad1() { int start = 0; int end = 5000; string doNo = SafeValue.SafeString(Request.QueryString["Sn"].ToString()); for (int i = start; i < end; i++) { ASPxCheckBox isPay = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Id"], "ack_IsPay") as ASPxCheckBox; ASPxTextBox id = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Id"], "txt_Id") as ASPxTextBox; ASPxTextBox sku = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["ProductCode"], "txt_Product") as ASPxTextBox; ASPxTextBox lotNo = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["LotNo"], "txt_LotNo") as ASPxTextBox; ASPxSpinEdit spin_Qty = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Qty"], "spin_Qty") as ASPxSpinEdit; ASPxLabel spin_Picked = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Qty5"], "spin_Picked") as ASPxLabel; ASPxLabel balQty = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["AvaibleQty"], "spin_AvaibleQty") as ASPxLabel; ASPxLabel location = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Location"], "lbl_Location") as ASPxLabel; ASPxLabel price = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Price"], "spin_Price") as ASPxLabel; ASPxLabel spin_PengingPickQty = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["PengingPickQty"], "spin_PengingPickQty") as ASPxLabel; ASPxLabel txt_Remark = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Remark"], "txt_Remark") as ASPxLabel; ASPxLabel txt_PalletNo = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["PalletNo"], "txt_PalletNo") as ASPxLabel; if (sku != null && isPay != null && isPay.Checked) { list.Add(new Record(SafeValue.SafeInt(id.Text, 0), sku.Text, lotNo.Text, SafeValue.SafeDecimal(spin_Qty.Value, 0), SafeValue.SafeDecimal(balQty.Text, 0), location.Text, SafeValue.SafeDecimal(price.Text, 0) , SafeValue.SafeInt(spin_PengingPickQty.Text, 0), txt_Remark.Text, txt_PalletNo.Text)); } else if (sku == null) { break; } ; } }
protected void grid_Transport_CustomDataCallback(object sender, ASPxGridViewCustomDataCallbackEventArgs e) { if (e.Parameters.Equals("save")) { gridView_save(sender, e); } if (e.Parameters.Equals("borrow")) { ASPxGridView grd = (sender as ASPxGridView) as ASPxGridView; ASPxLabel txt_Id = grd.FindEditFormTemplateControl("lb_Id") as ASPxLabel; C2.CtmMastData data = C2.Manager.ORManager.GetObject <C2.CtmMastData>(SafeValue.SafeInt(txt_Id.Text, 0)); if (data != null) { C2.CtmMastDataLog.addBorrow(data); e.Result = "success"; } } if (e.Parameters.Equals("return")) { ASPxGridView grd = (sender as ASPxGridView) as ASPxGridView; ASPxLabel txt_Id = grd.FindEditFormTemplateControl("lb_Id") as ASPxLabel; C2.CtmMastData data = C2.Manager.ORManager.GetObject <C2.CtmMastData>(SafeValue.SafeInt(txt_Id.Text, 0)); if (data != null) { C2.CtmMastDataLog.addReturn(data); e.Result = "success"; } } }
public List<HtmlTableCell> BuildCheckbox(string fieldtext, string id, 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(); lb.Text = fieldtext; cell.Controls.Add(lb); HtmlTableCell celledit = new HtmlTableCell(); celledit.Attributes.Add("class", "tblFormViewtdValue"); celledit.Style.Add("Width", "30%"); ASPxCheckBox cb = new ASPxCheckBox() { SkinID = SkinID, Text = "", ID = id, Checked = true, Width = Unit.Percentage(100), ReadOnly = isReadOnly }; cb.Theme = "DevEx"; cb.AutoPostBack = false; if (controlValue == "1") cb.Checked = true; celledit.Controls.Add(cb); c.Add(cell); c.Add(celledit); cot += 2; } catch (Exception ex) { ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), Guid.NewGuid().ToString(), "<script> alert('buildCheckbox fieldname" + id + "'); </script>", false); } return c; }
protected override void OnCallback(DevExpress.Web.CallbackEventArgsBase e) { base.OnCallback(e); String[] values = String.Concat(e.Parameter).Split(new char[] { '=' }, StringSplitOptions.RemoveEmptyEntries); if (values.Count() > 1) { switch (values[0]) { case "NewValue": DateTime val; if (DateTime.TryParse(values[1], out val)) { Value = val; } break; } } if (EditValueChanged != null) { EditValueChanged(this, EventArgs.Empty); } InnerRender(); if (OnClickScript != "") { ASPxLabel label = new ASPxLabel(); label.ClientSideEvents.Init = string.Format("function(s,e) {{ {0} }}", OnClickScript); Controls.Add(label); } }
protected void grid_CustomDataCallback(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e) { string paras = e.Parameters; string[] ar = paras.Split('_'); if (ar.Length >= 2) { if (ar[0].Equals("Saveline")) { #region ASPxGridView grid = sender as ASPxGridView; int rowIndex = SafeValue.SafeInt(ar[1], -1); ASPxLabel lbl_Id = this.grid.FindRowCellTemplateControl(rowIndex, null, "lbl_Id") as ASPxLabel; ASPxLabel lbl_JobNo = this.grid.FindRowCellTemplateControl(rowIndex, null, "lbl_JobNo") as ASPxLabel; ASPxComboBox txt_ContNo = this.grid.FindRowCellTemplateControl(rowIndex, null, "cbbContainer") as ASPxComboBox; ASPxLabel lbl_ContIndex = this.grid.FindRowCellTemplateControl(rowIndex, null, "lbl_ContIndex") as ASPxLabel; ASPxDateEdit date_ScheduleDate = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_ScheduleDate") as ASPxDateEdit; ASPxTextBox txt_SealNo = this.grid.FindRowCellTemplateControl(rowIndex, null, "txt_SealNo") as ASPxTextBox; ASPxComboBox cbbContType = this.grid.FindRowCellTemplateControl(rowIndex, null, "cbbContType") as ASPxComboBox; ASPxDateEdit date_CustomsClearDate = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_CustomsClearDate") as ASPxDateEdit; ASPxComboBox cmb_CustomsClearStatus = this.grid.FindRowCellTemplateControl(rowIndex, null, "cmb_CustomsClearStatus") as ASPxComboBox; ASPxComboBox cmb_CustomsVerifyInd = this.grid.FindRowCellTemplateControl(rowIndex, null, "cmb_CustomsVerifyInd") as ASPxComboBox; ASPxDateEdit date_CustomsVerifyDate = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_CustomsVerifyDate") as ASPxDateEdit; ASPxMemo memo_CustomsRemark = this.grid.FindRowCellTemplateControl(rowIndex, null, "memo_CustomsRemark") as ASPxMemo; ASPxDateEdit date_ValiDate = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_ValiDate") as ASPxDateEdit; ASPxDateEdit date_ScheduleStartDate = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_ScheduleStartDate") as ASPxDateEdit; ASPxDateEdit date_BillingDate = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_BillingDate") as ASPxDateEdit; ASPxDateEdit date_DispatchDate = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_DispatchDate") as ASPxDateEdit; ASPxDateEdit date_EtaDate = this.grid.FindRowCellTemplateControl(rowIndex, null, "date_EtaDate") as ASPxDateEdit; e.Result = update_cont(SafeValue.SafeInt(lbl_Id.Text, 0), lbl_JobNo.Text, txt_ContNo.Text, txt_SealNo.Text, cbbContType.Text, date_ScheduleDate.Date, lbl_ContIndex.Text, cmb_CustomsClearStatus.Text, date_CustomsClearDate.Date, cmb_CustomsVerifyInd.Text, date_CustomsVerifyDate.Date, memo_CustomsRemark.Text, date_ValiDate.Date, date_ScheduleStartDate.Date, date_BillingDate.Date, date_DispatchDate.Date, date_EtaDate.Date); #endregion } if (ar[0].Equals("Ediline")) { #region ASPxGridView grid = sender as ASPxGridView; int rowIndex = SafeValue.SafeInt(ar[1], -1); ASPxLabel lbl_JobId = this.grid.FindRowCellTemplateControl(rowIndex, null, "lbl_JobId") as ASPxLabel; ASPxComboBox cmb_CustomsClearStatus = this.grid.FindRowCellTemplateControl(rowIndex, null, "cmb_CustomsClearStatus") as ASPxComboBox; ASPxComboBox cmb_CustomsVerifyInd = this.grid.FindRowCellTemplateControl(rowIndex, null, "cmb_CustomsVerifyInd") as ASPxComboBox; if (SafeValue.SafeString(cmb_CustomsClearStatus.Value) == "Y") { e.Result = C2.Edi_Freight.DoOne(lbl_JobId.Text); DateTime now = DateTime.Now; string userId = HttpContext.Current.User.Identity.Name; Session["Export_" + now.ToString("yyyyMMdd") + userId] = null; } else { e.Result = "Edi Error! Pls confirm the Customs Clear Status"; } #endregion } } }
private void contCfsStatusChange(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewCustomDataCallbackEventArgs e, int rowIndex, string CfsStatus) { if (rowIndex < 0) { e.Result = "Save Error"; return; } ASPxLabel lb_id = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "lb_Id") as ASPxLabel; ASPxDateEdit txt_search_dateFrom = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "txt_search_dateFrom") as ASPxDateEdit; ASPxTextBox date_ScheduleStartTime = this.grid_Transport.FindRowCellTemplateControl(rowIndex, null, "date_ScheduleStartTime") as ASPxTextBox; string res = "Save Error"; if (lb_id != null) { string sql0 = ""; string sql = string.Format(@"update CTM_JobDet2 set BookingDate=@BookingDate where Id=@Oid", sql0); List <ConnectSql_mb.cmdParameters> list = new List <ConnectSql_mb.cmdParameters>(); list.Add(new ConnectSql_mb.cmdParameters("@Oid", lb_id.Text, SqlDbType.Int)); list.Add(new ConnectSql_mb.cmdParameters("@BookingDate", txt_search_dateFrom.Date.ToString("yyyy-MM-dd"), SqlDbType.DateTime)); if (ConnectSql_mb.ExecuteNonQuery(sql, list).status) { res = "Save successful!"; //C2.CtmJobDet1.contWarehouseStatusChanged(SafeValue.SafeInt(lb_id.Text, 0)); } } e.Result = res; }
protected void grid_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e) { if (e.DataColumn.FieldName == "empid") { ASPxLabel lblEmp = grid.FindRowCellTemplateControl(e.VisibleIndex, e.DataColumn, "lblEmp") as ASPxLabel; if (objEmployees.GetEmployees(Int32.Parse(e.CellValue.ToString())) != null) { lblEmp.Text = objEmployees.GetEmployees(Int32.Parse(e.CellValue.ToString())).fullname; } } if (e.DataColumn.FieldName == "officeid") { Philip.Modules.Office.OfficeController objOffice = new Philip.Modules.Office.OfficeController(); ASPxLabel lblOffice = grid.FindRowCellTemplateControl(e.VisibleIndex, e.DataColumn, "lblOffice") as ASPxLabel; if (objOffice.GetOffice(Int32.Parse(e.CellValue.ToString())) != null) { lblOffice.Text = objOffice.GetOffice(Int32.Parse(e.CellValue.ToString())).name; } } if (e.DataColumn.FieldName == "statemanagementid") { VNPT.Modules.StateManagement.StateManagementController objSate = new VNPT.Modules.StateManagement.StateManagementController(); ASPxLabel lblState = grid.FindRowCellTemplateControl(e.VisibleIndex, e.DataColumn, "lblState") as ASPxLabel; if (objSate.GetStateManagement(Int32.Parse(e.CellValue.ToString())) != null) { lblState.Text = objSate.GetStateManagement(Int32.Parse(e.CellValue.ToString())).name; } } }
protected void grdNames_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e) { if (e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.Detail) { string code = e.GetValue("Code").ToString(); clsDetail det = currentDetails.GetDetails(code); ASPxPageControl cntrl = ((ASPxGridView)sender).FindDetailRowTemplateControl(e.VisibleIndex, "ASPxPageControl1") as ASPxPageControl; ASPxLabel genLab = cntrl.FindControl("ASPxLabel1") as ASPxLabel; if (genLab != null) { genLab.Text = det.Gender; } ASPxLabel courtLab = cntrl.FindControl("ASPxLabel2") as ASPxLabel; if (courtLab != null) { courtLab.Text = det.TitleOfCourt; } ASPxLabel addrLab = cntrl.FindControl("ASPxLabel3") as ASPxLabel; if (addrLab != null) { addrLab.Text = det.Address; } } }
private void OnLoad() { int start = 0; int end = 1000; for (int i = start; i < end; i++) { ASPxCheckBox isOk = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["SequenceId"], "ack_IsOk") as ASPxCheckBox; ASPxTextBox id = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["SequenceId"], "txt_Id") as ASPxTextBox; ASPxLabel lbl_ChgcodeId = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ChgcodeId"], "lbl_ChgcodeId") as ASPxLabel; ASPxLabel lbl_ChgcodeDes = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ChgcodeDes"], "lbl_ChgcodeDes") as ASPxLabel; ASPxSpinEdit spin_Price = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["Price"], "spin_Price") as ASPxSpinEdit; ASPxSpinEdit spin_Qty = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["Qty"], "spin_Qty") as ASPxSpinEdit; ASPxTextBox txt_Unit = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ChgUnit"], "txt_Unit") as ASPxTextBox; if (id != null && isOk != null && isOk.Checked) { list.Add(new Record(lbl_ChgcodeId.Text, lbl_ChgcodeDes.Text, SafeValue.SafeDecimal(spin_Price.Value), SafeValue.SafeDecimal(spin_Qty.Value), txt_Unit.Text)); } else if (id == null) { break; } } }
//end bind order /// <summary> /// some conditional formatting on dstabound /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void fmvorder_DataBound(object sender, EventArgs e) { //If([Palletise]=-1,"To be shipped Pre-palletised","Ship as loose cartons for palletisation at destination") ASPxLabel _lbl = this.fmvorder.FindControl("dxlblorderPalletise") as ASPxLabel; if (_lbl != null) { if (_lbl.Text == "True") { _lbl.Text = "To be shipped Pre-palletised"; } else { _lbl.Text = "Ship as loose cartons for palletisation at destination"; } } //bill of lading style _lbl = this.fmvorder.FindControl("dxlblorderExBL") as ASPxLabel; if (_lbl != null) { if (_lbl.Text == "True") { _lbl.Text = "Please issue an Express Bill of Lading"; } else { _lbl.Text = "Negotiable Bill of Lading required"; } } //date formatting string[] _lbls = { "ExWorks", "Ets", "Eta" }; for (int _ix = 0; _ix < _lbls.Length; _ix++) { _lbl = this.fmvorder.FindControl("dxlblorder" + _lbls[_ix].ToString()) as ASPxLabel; if (_lbl != null) { _lbl.Text = wwi_func.vdatetime(_lbl.Text.ToString()).ToShortDateString(); } } //hot job _lbl = this.fmvorder.FindControl("dxlblorderHot") as ASPxLabel; if (_lbl.Text != "False") { _lbl.Text = "Hot job"; _lbl.ClientVisible = true; } else { _lbl.ClientVisible = false; } //curent date _lbl = this.fmvorder.FindControl("dxlblCurrentDate") as ASPxLabel; if (_lbl != null) { _lbl.Text = DateTime.Now.ToShortDateString(); } }
public void InstantiateIn(Control container) { ASPxLabel lbl = new ASPxLabel(); lbl.ID = "lblFrom"; lbl.Text = "From:"; container.Controls.Add(lbl); ASPxDateEdit dateFrom = new ASPxDateEdit(); dateFrom.ID = "dateFrom"; dateFrom.ClientInstanceName = "dFrom"; dateFrom.Date = new DateTime(1950, 1, 1); container.Controls.Add(dateFrom); lbl = new ASPxLabel(); lbl.ID = "lblTo"; lbl.Text = "To:"; container.Controls.Add(lbl); ASPxDateEdit dateTo = new ASPxDateEdit(); dateTo.ID = "dateTo"; dateTo.ClientInstanceName = "dTo"; dateTo.Date = new DateTime(1960, 11, 30); container.Controls.Add(dateTo); ASPxButton btn = new ASPxButton(); btn.ID = "btnApply"; btn.Text = "Apply"; btn.AutoPostBack = false; btn.ClientSideEvents.Click = "function (s, e) { ApplyFilter( dFrom, dTo ); }"; container.Controls.Add(btn); }
protected override void OnCallback(DevExpress.Web.CallbackEventArgsBase e) { base.OnCallback(e); String[] values = String.Concat(e.Parameter).Split(new char[] { '=' }, StringSplitOptions.RemoveEmptyEntries); if (values.Count() > 1) { switch (values[0]) { case "NewValue": decimal val = 0; if (decimal.TryParse(String.Concat(values[1]).Replace(".", System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator), out val)) { Value = val; } break; } } if (EditValueChanged != null) { EditValueChanged(this, EventArgs.Empty); } InnerRender(); if (OnClickScript != "") { ASPxLabel label = new ASPxLabel(); label.ClientSideEvents.Init = string.Format(@"function(s,e) {{ {0} }}", OnClickScript); Controls.Add(label); } }
private void SetChangePasswordVisibility(bool IsVisible) { try { ASPxButton btnChange = gridUsers.FindEditFormTemplateControl("btnChangePassword") as ASPxButton; ASPxTextBox txtPassword = gridUsers.FindEditFormTemplateControl("txtEfPassword") as ASPxTextBox; ASPxLabel lblPassword = gridUsers.FindEditFormTemplateControl("lblEfPassword") as ASPxLabel; if (btnChange != null) { btnChange.Visible = !IsVisible; } if (txtPassword != null) { txtPassword.Visible = IsVisible; } if (lblPassword != null) { lblPassword.Visible = IsVisible; } } catch (Exception ex) { Logger.Log(string.Format("exception {0}", ex.ToString()), LogLevel.Error); } }
private void OnLoad() { int start = 0; // this.ASPxGridView1.PageIndex * ASPxGridView1.SettingsPager.PageSize; int end = 1000; // (ASPxGridView1.PageIndex + 1) * ASPxGridView1.SettingsPager.PageSize; for (int i = start; i < end; i++) { ASPxCheckBox isPay = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["Id"], "ack_IsPay") as ASPxCheckBox; ASPxLabel Id = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["Id"], "lbl_Id") as ASPxLabel; ASPxDateEdit date_ShipDate = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ShipDate"], "date_ShipDate") as ASPxDateEdit; ASPxTextBox txt_ShipIndex = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ShipIndex"], "txt_ShipIndex") as ASPxTextBox; ASPxTextBox txt_ShipPortCode = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ShipPortCode"], "txt_ShipPortCode") as ASPxTextBox; ASPxComboBox cbb_ContIndex = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ContIndex"], "cbb_ContIndex") as ASPxComboBox; ASPxSpinEdit spin_Qty = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["QtyOrig"], "spin_Qty") as ASPxSpinEdit; ASPxSpinEdit spin_Weight = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["WeightOrig"], "spin_Weight") as ASPxSpinEdit; ASPxSpinEdit spin_Volume = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["VolumeOrig"], "spin_Volume") as ASPxSpinEdit; if (Id != null && isPay != null && isPay.Checked) { list.Add(new Record(SafeValue.SafeInt(Id.Text, 0), SafeValue.SafeInt(txt_ShipIndex.Value, 0), date_ShipDate.Date, txt_ShipPortCode.Text, SafeValue.SafeString(cbb_ContIndex.Value), SafeValue.SafeDecimal(spin_Qty.Value), SafeValue.SafeDecimal(spin_Weight.Value), SafeValue.SafeDecimal(spin_Volume.Value))); } else { if (Id == null) { break; } } } }
protected void labelC1_Init(object sender, EventArgs e) { ASPxLabel label = sender as ASPxLabel; GridViewDataItemTemplateContainer container = label.NamingContainer as GridViewDataItemTemplateContainer; label.ClientInstanceName = "labelC1_" + container.KeyValue; }
protected void LocalizeEditForm(WebControl editForm) { try { //In the following place FindEditFormTemplateControl returns always null. devexpress bug? foreach (Control ctrl in editForm.Controls) { if (ctrl is GridViewEditFormTemplateContainer) { foreach (Control ctrl2 in ctrl.Controls) { switch (ctrl2.ID) { case "lblEfCategoryName": ASPxLabel label2 = (ASPxLabel)ctrl2; label2.Text = Utilities.GetResourceString("Common", "CategoryEfName"); break; case "lblEfInternalId": ASPxLabel label3 = (ASPxLabel)ctrl2; label3.Text = Utilities.GetResourceString("Common", "CategoryEfInternalId"); break; default: continue; } //--switch } //--foreach search controls } //--if template container } //--foreach, search template } catch (Exception) { } }
protected void grid_HtmlEditFormCreated(object sender, ASPxGridViewEditFormEventArgs e) { if (this.grid.EditingRowVisibleIndex > -1) { ASPxPageControl pageControl = this.grid.FindEditFormTemplateControl("pageControl") as ASPxPageControl; ASPxTextBox txt_PartyId = pageControl.FindControl("txtPartyId") as ASPxTextBox; txt_PartyId.Enabled = false; string partyId = SafeValue.SafeString(this.grid.GetRowValues(this.grid.EditingRowVisibleIndex, new string[] { "PartyId" })); string sql = "select Salesman from XXPartySales where PartyId='" + partyId + "' and DefaultInd='Y'"; string salesMan = SafeValue.SafeString(C2.Manager.ORManager.ExecuteScalar(sql)); ASPxTextBox txt_DefaultSale = pageControl.FindControl("txt_DefaultSale") as ASPxTextBox; txt_DefaultSale.Text = salesMan; ASPxButton btn_Block = this.grid.FindEditFormTemplateControl("btn_Block") as ASPxButton; ASPxLabel status = pageControl.FindControl("lblStatus") as ASPxLabel; if (partyId.Length > 0) { sql = string.Format("select Status from XXParty where PartyId='{0}'", partyId); string closeInd = SafeValue.SafeString(C2.Manager.ORManager.ExecuteScalar(sql));// closeIndStr.Text if (closeInd == "InActive") { status.Text = "InActive"; btn_Block.Text = "UnLock"; } else { status.Text = "USE"; btn_Block.Text = "Lock"; } dsRefContact.FilterExpression = "PartyId='" + partyId + "'"; } } }
private void OnLoad() { int start = 0; int end = count; for (int i = start; i < end; i++) { ASPxCheckBox isPay = this.grid_wh.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_wh.Columns["Id"], "ack_IsPay") as ASPxCheckBox; ASPxTextBox id = this.grid_wh.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_wh.Columns["Id"], "txt_Id") as ASPxTextBox; ASPxSpinEdit spin_Qty = this.grid_wh.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_wh.Columns["Qty"], "spin_Qty") as ASPxSpinEdit; ASPxSpinEdit spin_WholeQty = this.grid_wh.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_wh.Columns["Qty"], "spin_WholeQty") as ASPxSpinEdit; ASPxSpinEdit spin_Weight = this.grid_wh.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_wh.Columns["Qty"], "spin_Weight") as ASPxSpinEdit; ASPxSpinEdit spin_Volume = this.grid_wh.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_wh.Columns["Qty"], "spin_Volume") as ASPxSpinEdit; ASPxSpinEdit spin_LengthPack = this.grid_wh.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_wh.Columns["Qty"], "spin_LengthPack") as ASPxSpinEdit; ASPxSpinEdit spin_WidthPack = this.grid_wh.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_wh.Columns["Qty"], "spin_WidthPack") as ASPxSpinEdit; ASPxSpinEdit spin_HeightPack = this.grid_wh.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_wh.Columns["Qty"], "spin_HeightPack") as ASPxSpinEdit; ASPxLabel lbl_JobNo = this.grid_wh.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_wh.Columns["JobNo"], "lbl_JobNo") as ASPxLabel; ASPxLabel lbl_RefNo = this.grid_wh.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_wh.Columns["JobNo"], "lbl_RefNo") as ASPxLabel; ASPxComboBox txt_ToLoc = this.grid_wh.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_wh.Columns["Qty"], "txt_ToLoc") as ASPxComboBox; if (id != null && isPay != null && isPay.Checked) { list.Add(new Record(SafeValue.SafeInt(id.Text, 0), SafeValue.SafeDecimal(spin_Qty.Value), SafeValue.SafeDecimal(spin_WholeQty.Value), SafeValue.SafeDecimal(spin_Weight.Value), SafeValue.SafeDecimal(spin_Volume.Value), SafeValue.SafeDecimal(spin_LengthPack.Value), SafeValue.SafeDecimal(spin_WidthPack.Value), SafeValue.SafeDecimal(spin_HeightPack.Value), lbl_JobNo.Text, lbl_RefNo.Text, SafeValue.SafeString(txt_ToLoc.Value))); } else if (id == null) { break; } } }
protected void ASPxLabel1_Init(object sender, EventArgs e) { ASPxLabel lbl = (ASPxLabel)sender; GridViewHeaderTemplateContainer container = (GridViewHeaderTemplateContainer)lbl.NamingContainer; lbl.Text = container.Column.Caption; }
private void OnLoad() { int start = 0; int end = 10000; for (int i = start; i < end; i++) { ASPxTextBox Id = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Id"], "txt_Id") as ASPxTextBox; ASPxCheckBox isPay = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Id"], "ack_IsPay") as ASPxCheckBox; ASPxLabel sku = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Code"], "txt_Product") as ASPxLabel; ASPxSpinEdit price = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Price"], "spin_Price") as ASPxSpinEdit; ASPxTextBox lotNo = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["LotNo"], "txt_LotNo") as ASPxTextBox; ASPxSpinEdit qty1 = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Qty1"], "spin_Qty1") as ASPxSpinEdit; ASPxSpinEdit qty2 = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Qty2"], "spin_Qty2") as ASPxSpinEdit; ASPxSpinEdit qty3 = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Qty3"], "spin_Qty3") as ASPxSpinEdit; ASPxLabel location = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Location"], "lbl_Location") as ASPxLabel; ASPxLabel des = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Des1"], "lbl_Description") as ASPxLabel; ASPxLabel palletNo = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["PalletNo"], "lbl_PalletNo") as ASPxLabel; ASPxLabel remark = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Remark"], "lbl_Remark") as ASPxLabel; ASPxLabel handQty = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["HandQty"], "txt_HandQty") as ASPxLabel; if (sku != null && isPay != null && isPay.Checked) { list.Add(new Record(SafeValue.SafeInt(Id.Text, 0), sku.Text, lotNo.Text, SafeValue.SafeInt(qty1.Value, 0), 0 , location.Text, SafeValue.SafeString(des.Text), SafeValue.SafeString(palletNo.Text), SafeValue.SafeString(remark.Text), SafeValue.SafeInt(handQty.Text, 0))); } else if (sku == null) { break; } ; } }
private void OnLoad(string driver) { int start = 0; // this.ASPxGridView1.PageIndex * ASPxGridView1.SettingsPager.PageSize; int end = 10000; // (ASPxGridView1.PageIndex + 1) * ASPxGridView1.SettingsPager.PageSize; for (int i = start; i < end; i++) { ASPxLabel jobId = this.grid_Transport.FindRowTemplateControl(i, "txt_jobId") as ASPxLabel; ASPxCheckBox isPay = this.grid_Transport.FindRowTemplateControl(i, "ack_IsPay") as ASPxCheckBox; //ASPxComboBox Towhead = this.grid_Transport.FindRowTemplateControl(i, "cbb_TowheadCode") as ASPxComboBox; ASPxButtonEdit DriverCode = this.grid_Transport.FindRowTemplateControl(i, "btn_DriveCode") as ASPxButtonEdit; ASPxTextBox Towhead = this.grid_Transport.FindRowTemplateControl(i, "txt_TowheadCode") as ASPxTextBox; ASPxComboBox Cfs = this.grid_Transport.FindRowTemplateControl(i, "cbb_CfsCode") as ASPxComboBox; ASPxComboBox Chessis = this.grid_Transport.FindRowTemplateControl(i, "cbb_Chessis") as ASPxComboBox; ASPxComboBox subletFlag = this.grid_Transport.FindRowTemplateControl(i, "cbb_SubletFlag") as ASPxComboBox; ASPxTextBox subletHaulierName = this.grid_Transport.FindRowTemplateControl(i, "txt_SubletHauliername") as ASPxTextBox; ASPxComboBox Bay = this.grid_Transport.FindRowTemplateControl(i, "cbb_Trip_BayCode") as ASPxComboBox; ASPxComboBox status = this.grid_Transport.FindRowTemplateControl(i, "cbb_Trip_StatusCode") as ASPxComboBox; ASPxLabel Id = this.grid_Transport.FindRowTemplateControl(i, "lb_Id") as ASPxLabel; if (jobId != null && DriverCode != null & Towhead != null && Cfs != null && Chessis != null && subletFlag != null && subletHaulierName != null && Bay != null && isPay != null && isPay.Checked) { list.Add(new Record(jobId.Text, DriverCode.Text, Towhead.Text, Cfs.Text, Chessis.Text, subletFlag.Text, subletHaulierName.Text, Bay.Text, status.Value.ToString(), Id.Text)); } } }
public HintPanelBase() { Paddings.PaddingBottom = 8; var innerHintPanel = new ASPxPanel(); Controls.Add(innerHintPanel); label = new ASPxLabel { EncodeHtml = false }; innerHintPanel.Controls.Add(label); }
public FilterPanel() { Paddings.PaddingBottom = 8; var innerHintPanel = new ASPxPanel(); innerHintPanel.Paddings.Assign(new Paddings(8, 8, 8, 8)); innerHintPanel.BackColor = System.Drawing.Color.LightGoldenrodYellow; Controls.Add(innerHintPanel); label = new ASPxLabel(); innerHintPanel.Controls.Add(label); }
public List<HtmlTableCell> BuildNumberSpin(string caption, 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(); lb.Text = caption; cell.Controls.Add(lb); HtmlTableCell celledit = new HtmlTableCell(); celledit.Attributes.Add("class", "tblFormViewtdValue"); celledit.Style.Add("Width", "30%"); ASPxSpinEdit se = new ASPxSpinEdit(); se.SkinID = skinID; se.ID = id; se.NullText = helptext; se.MaxLength = length; //se.Enabled = alowEdit; se.Width = Unit.Percentage(99); se.Theme = "DevEx"; se.AutoPostBack = false; se.ReadOnly = isReadOnly; se.Value = controlValue; celledit.Controls.Add(se); c.Add(cell); c.Add(celledit); cot += 2; } catch (Exception) { ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), Guid.NewGuid().ToString(), "<script> alert('buildNumberSpin fieldname" + id + "'); </script>", false); } return c; }
public List<HtmlTableCell> BuildMemoText(string fieldtext, string id, string helptext, string SkinID, 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(); lb.Text = fieldtext; cell.Controls.Add(lb); HtmlTableCell celledit = new HtmlTableCell(); celledit.Attributes.Add("class", "tblFormViewtdValue"); celledit.Style.Add("Width", "30%"); ASPxMemo mm = new ASPxMemo() { SkinID = SkinID, ID = id, Rows = 2, /*mm.Enabled = alowEdit;*/NullText = helptext, Width = Unit.Percentage(99), ReadOnly = isReadOnly }; mm.Text = controlValue; mm.Theme = "DevEx"; mm.AutoPostBack = false; celledit.Controls.Add(mm); c.Add(cell); c.Add(celledit); cot += 2; } catch (Exception) { ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), Guid.NewGuid().ToString(), "<script> alert('buildMemoText fieldname" + id + "'); </script>", false); } return c; }
public static string GetLeaveNoSeq(string LeaveNoType, ASPxComboBox cmbLeaveType, ASPxLabel lblOrgSerial) { string ret = ""; if (LeaveNoType != "") { string sql = "select isnull(max(leaveno_seq),0) leaveno_seq "; sql += " from HRM_LEAVE_HIS "; sql += " where leave_id=@_LEAVE_ID "; sql += " and org_serial=@_ORG_SERIAL"; sql += " and leaveno_year=@_BUDGET_YEAR"; SqlParameter[] param = new SqlParameter[3]; param[0] = OPM_BL.setParameter("@_LEAVE_ID", SqlDbType.Int, Convert.ToInt16(cmbLeaveType.Value)); if (lblOrgSerial.Text.Trim() != "") { param[1] = OPM_BL.setParameter("@_ORG_SERIAL", SqlDbType.Int, Convert.ToInt16(lblOrgSerial.Text)); } else { param[1] = OPM_BL.setParameter("@_ORG_SERIAL", SqlDbType.Int, DBNull.Value); } param[2] = OPM_BL.setParameter("@_BUDGET_YEAR", SqlDbType.Int, OPM_BL.setBudgetYear(DateTime.Now)); DataTable dt = OPM_BL.GetDatatable(sql, param); if (dt.Rows.Count > 0) { if (Convert.IsDBNull(dt.Rows[0]["leaveno_seq"]) == false) { ret = (Convert.ToInt16(dt.Rows[0]["leaveno_seq"]) + 1).ToString().PadLeft(3, '0'); } else { ret = "001"; } } else { ret = "001"; } } return ret; }
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; }
public static int GetLeaveSeq(ASPxLabel lblPersonID, ASPxComboBox cmbLeaveType) { //หาจำนวนครั้งที่ลา int ret = 1; try { string sql = "select count(id) qty"; sql += " from HRM_LEAVE_HIS"; sql += " where person_id=@_PERSON_ID"; sql += " and leave_id=@_LEAVE_ID"; sql += " and budget_year=@_BUDGET_YEAR"; SqlParameter[] param = new SqlParameter[3]; param[0] = OPM_BL.setParameter("@_PERSON_ID", SqlDbType.BigInt, Convert.ToInt64(lblPersonID.Text)); param[1] = OPM_BL.setParameter("@_LEAVE_ID", SqlDbType.BigInt, Convert.ToInt16(cmbLeaveType.Value)); param[2] = OPM_BL.setParameter("@_BUDGET_YEAR", SqlDbType.Int, OPM_BL.setBudgetYear(DateTime.Now)); DataTable dt = OPM_BL.GetDatatable(sql, param); if (dt.Rows.Count > 0) { ret = (Convert.ToInt16(dt.Rows[0]["qty"]) + 1); } else { ret = 1; } dt.Dispose(); } catch (Exception ex) { } return ret; }
public static string GetLeaveNoType(ASPxComboBox cmbLeaveType, ASPxLabel lblOrgCode) { string ret = ""; try { string sql = "select leave_shot_name"; sql += " from PDM_MS_LEAVE "; sql += " where leave_id=@_LEAVE_ID"; SqlParameter[] param = new SqlParameter[1]; param[0] = OPM_BL.setParameter("@_LEAVE_ID", SqlDbType.Int, Convert.ToInt16(cmbLeaveType.Value)); DataTable dt = OPM_BL.GetDatatable(sql, param); if (dt.Rows.Count > 0) { if (Convert.IsDBNull(dt.Rows[0]["leave_shot_name"]) == false) { ret = dt.Rows[0]["leave_shot_name"].ToString() + lblOrgCode.Text; } } dt.Dispose(); } catch (Exception ex) { } return ret; }
public static void LabelApplyTheme(ASPxLabel Label, string theTheme) { Label.CssFilePath = "~/App_Themes/Glass/{0}/styles.css"; Label.CssPostfix = "Glass"; }
public static bool ApproveLeaveGroupData(Control page, TextBox txtSendDate, DateTime SendDateValue, long vLeaveGroupID, HttpRequest req, string Leave_Status) { bool result = false; try { string sql = " update hrm_leave_group_approver"; sql += " set approve_status=@_LEAVE_STATUS"; sql += " ,approve_date=@_APPROVE_DATE"; sql += " where leave_group_id=@_LEAVE_GROUP_ID"; sql += " and person_id_approve=@_PERSON_ID"; SqlParameter[] param = new SqlParameter[4]; param[0] = OPM_BL.setParameter("@_LEAVE_STATUS", SqlDbType.VarChar, Leave_Status.ToString()); //1=อนุญาต //param[0] = OPM_BL.setParameter("@_LEAVE_STATUS", SqlDbType.VarChar, "1"); //1=อนุญาต param[1] = OPM_BL.setParameter("@_APPROVE_DATE", SqlDbType.Date, SendDateValue); param[2] = OPM_BL.setParameter("@_LEAVE_GROUP_ID", SqlDbType.BigInt, vLeaveGroupID); param[3] = OPM_BL.setParameter("@_PERSON_ID", SqlDbType.BigInt, Convert.ToInt64(LoginUserData.getLoginUserID(req))); string ret = OPM_BL.ExecuteNoneQuery(sql, param); if (ret != "true") { OPM_BL.SetAlertTextDate(page, ret, txtSendDate); result = false; } else { //ตรวจว่า ผู้อนุญาตทำการ อนุญาตครบแล้วทุกคน sql = "select id, approve_status "; sql += " from hrm_leave_group_approver"; sql += " where leave_group_id=@_LEAVE_GROUP_ID"; param = new SqlParameter[1]; param[0] = OPM_BL.setParameter("@_LEAVE_GROUP_ID", SqlDbType.BigInt, vLeaveGroupID); DataTable dt = OPM_BL.GetDatatable(sql, param); if (dt.Rows.Count > 0) { int totAppQty = dt.Rows.Count; //จำนวนผู้อนุญาตทั้งหมด dt.DefaultView.RowFilter = "approve_status='1'"; //จำนวนผู้คลิกอนุญาตแล้ว if (totAppQty == dt.DefaultView.Count) { //ถ้าอนุญาติครบทุกคนแล้ว sql = "update hrm_leave_group"; sql += " set leave_status=@_LEAVE_STATUS"; sql += " ,comm_date = @_APPROVE_DATE"; sql += " where id=@_ID"; param = new SqlParameter[3]; param[0] = OPM_BL.setParameter("@_LEAVE_STATUS", SqlDbType.VarChar, "3"); //อนุญาตแล้ว //param[0] = OPM_BL.setParameter("@_LEAVE_STATUS", SqlDbType.VarChar, Leave_Status.ToString()); //อนุญาตแล้ว param[1] = OPM_BL.setParameter("@_APPROVE_DATE", SqlDbType.Date, SendDateValue); param[2] = OPM_BL.setParameter("@_ID", SqlDbType.BigInt, vLeaveGroupID); ret = OPM_BL.ExecuteNoneQuery(sql, param); if (ret != "true") { OPM_BL.SetAlertTextDate(page, ret, txtSendDate); result = false; } else { string vLeaveID = OPM_BL.GetSysconfig("LeaveGroupID"); if (vLeaveID.Trim() == "") { vLeaveID = "100"; } string vUserCode = LoginUserData.getLoginUserCode(req); //หารายชื่อผู้อนุญาติให้ไปราชการเป็นหมู่คณะ sql = " select person_id_approve, isnull(approver_level,'') approver_level , approve_status, approve_date, isnull(remarks,'') remarks"; sql += " from HRM_LEAVE_GROUP_APPROVER "; sql += " where leave_group_id=@_LEAVE_GROUP_ID"; param = new SqlParameter[1]; param[0] = OPM_BL.setParameter("@_LEAVE_GROUP_ID", SqlDbType.BigInt, vLeaveGroupID); DataTable aDt = OPM_BL.GetDatatable(sql, param); if (aDt.Rows.Count > 0) { //ทำการ Insert ข้อมูลการลาไปราชการเป็นหมู่คณะให้กับทุกคน sql = "select gp.person_id, isnull(p.per_type,'') per_type, g.org_serial, p.time_code, g.start_date,g.start_flag,g.end_date,g.end_flag, " + Environment.NewLine; sql += " g.budget_year,g.doc_no,isnull(g.gov_aid_place,'') gov_aid_place ,isnull(g.remarks,'') remarks,g.leave_status,g.send_date,g.comm_date " + Environment.NewLine; sql += " from HRM_LEAVE_GROUP_PERSON gp " + Environment.NewLine; sql += " inner join vw_CMN_PERSON p on p.id=gp.person_id " + Environment.NewLine; sql += " inner join HRM_LEAVE_GROUP g on g.id=gp.leave_group_id " + Environment.NewLine; sql += " where gp.leave_group_id=@_LEAVE_GROUP_ID " + Environment.NewLine; param = new SqlParameter[1]; param[0] = OPM_BL.setParameter("@_LEAVE_GROUP_ID", SqlDbType.BigInt, vLeaveGroupID); DataTable gDt = OPM_BL.GetDatatable(sql, param); if (gDt.Rows.Count > 0) { foreach (DataRow gDr in gDt.Rows) { sql = "insert into HRM_LEAVE_HIS(created_by,created_date,person_id,org_serial,time_code, " + Environment.NewLine; sql += " leave_id,start_date,start_flag,end_date,end_flag,budget_year," + Environment.NewLine; sql += " leave_seq,day_qty,leave_day,leaveno_type,leaveno_seq,leaveno_year, " + Environment.NewLine; sql += " remarks, leave_status,nosys_flag,ins_dpis,per_type,save_leave_by,leave_group_id) " + Environment.NewLine; sql += " output inserted.id " + Environment.NewLine; sql += " values(@_CREATED_BY,getdate(),@_PERSON_ID,@_ORG_SERIAL,@_TIME_CODE, " + Environment.NewLine; sql += " @_LEAVE_ID,@_START_DATE,@_START_FLAG,@_END_DATE,@_END_FLAG,@_BUDGET_YEAR," + Environment.NewLine; sql += " @_LEAVE_SEQ, @_DAY_QTY, @_LEAVE_DAY,@_LEAVENO_TYPE,@_LEAVENO_SEQ,@_LEAVENO_YEAR, " + Environment.NewLine; sql += " @_REMARKS, @_LEAVE_STATUS, @_NOSYS_FLAG, @_INS_DPIS, @_PER_TYPE, @_SAVE_LEAVE_BY,@_LEAVE_GROUP_ID) " + Environment.NewLine; param = new SqlParameter[23]; param[0] = OPM_BL.setParameter("@_CREATED_BY", SqlDbType.VarChar, vUserCode); param[1] = OPM_BL.setParameter("@_PERSON_ID", SqlDbType.BigInt, Convert.ToInt64(gDr["person_id"])); param[2] = OPM_BL.setParameter("@_ORG_SERIAL", SqlDbType.BigInt, Convert.ToInt64(gDr["org_serial"])); param[3] = OPM_BL.setParameter("@_TIME_CODE", SqlDbType.VarChar, gDr["time_code"].ToString()); param[4] = OPM_BL.setParameter("@_LEAVE_ID", SqlDbType.Int, Convert.ToInt16(vLeaveID)); param[5] = OPM_BL.setParameter("@_START_DATE", SqlDbType.DateTime, Convert.ToDateTime(gDr["start_date"])); param[6] = OPM_BL.setParameter("@_START_FLAG", SqlDbType.VarChar, gDr["start_flag"].ToString()); param[7] = OPM_BL.setParameter("@_END_DATE", SqlDbType.DateTime, Convert.ToDateTime(gDr["end_date"])); param[8] = OPM_BL.setParameter("@_END_FLAG", SqlDbType.VarChar, gDr["end_flag"].ToString()); param[9] = OPM_BL.setParameter("@_BUDGET_YEAR", SqlDbType.Int, Convert.ToInt16(gDr["budget_year"])); string[] tmpDocNo = gDr["doc_no"].ToString().Split('/'); if (tmpDocNo.Length == 3) { ASPxLabel lblPersonID = new ASPxLabel(); lblPersonID.Text = gDr["person_id"].ToString(); ASPxComboBox cmbLeaveType = new ASPxComboBox(); cmbLeaveType.Value = vLeaveID; param[10] = OPM_BL.setParameter("@_LEAVE_SEQ", SqlDbType.Int, OPM_BL.GetLeaveSeq(lblPersonID, cmbLeaveType)); param[11] = OPM_BL.setParameter("@_LEAVENO_TYPE", SqlDbType.VarChar, tmpDocNo[0]); param[12] = OPM_BL.setParameter("@_LEAVENO_SEQ", SqlDbType.VarChar, Convert.ToInt16(tmpDocNo[1]).ToString().PadLeft(3, '0')); param[13] = OPM_BL.setParameter("@_LEAVENO_YEAR", SqlDbType.Int, Convert.ToInt16(gDr["budget_year"])); } DateTime StartDateValue = Convert.ToDateTime(gDr["start_date"]); DateTime txtEndDateValue = Convert.ToDateTime(gDr["end_date"]); ASPxComboBox cmbStartDateFlag = new ASPxComboBox(); ASPxComboBox cmbEndDateFlag = new ASPxComboBox(); cmbStartDateFlag.Value = gDr["start_flag"]; cmbEndDateFlag.Value = gDr["end_flag"]; param[14] = OPM_BL.setParameter("@_DAY_QTY", SqlDbType.Float, OPM_BL.GetDayQty(StartDateValue, txtEndDateValue, cmbStartDateFlag, cmbEndDateFlag)); param[15] = OPM_BL.setParameter("@_LEAVE_DAY", SqlDbType.Float, OPM_BL.GetLeaveQty(StartDateValue, txtEndDateValue, cmbStartDateFlag, cmbEndDateFlag)); param[16] = OPM_BL.setParameter("@_REMARKS", SqlDbType.VarChar, gDr["remarks"].ToString()); //กรณีการลาไม่ได้กรอกหมายเหตุ param[17] = OPM_BL.setParameter("@_LEAVE_STATUS", SqlDbType.VarChar, gDr["leave_status"].ToString()); param[18] = OPM_BL.setParameter("@_NOSYS_FLAG", SqlDbType.VarChar, "2"); //การส่งใบลาผ่านระบบลา param[19] = OPM_BL.setParameter("@_INS_DPIS", SqlDbType.VarChar, "2"); //ยังไม่ส่งข้อมูลไปยัง DPIS param[20] = OPM_BL.setParameter("@_PER_TYPE", SqlDbType.VarChar, gDr["per_type"].ToString()); param[21] = OPM_BL.setParameter("@_SAVE_LEAVE_BY", SqlDbType.VarChar, "A"); param[22] = OPM_BL.setParameter("@_LEAVE_GROUP_ID", SqlDbType.BigInt, vLeaveGroupID); DataTable lDt = OPM_BL.GetDatatable(sql, param); if (lDt.Rows.Count > 0) { long vLeaveHisID = Convert.ToInt64(lDt.Rows[0]["id"]); //Insert ข้อมูลรายชื่อผู้อนุญาต foreach (DataRow aDr in aDt.Rows) { sql = "insert into HRM_LEAVE_HIS_APPROVER (created_by,created_date,leave_his_id,person_id_approve,approver_level,approve_status,approve_date,remarks)"; sql += " values(@_CREATED_BY,getdate(),@_LEAVE_HIS_ID,@_PERSON_ID_APPROVE,@_APPROVER_LEVEL,@_APPROVE_STATUS,@_APPROVE_DATE, @_REMARKS)"; param = new SqlParameter[7]; param[0] = OPM_BL.setParameter("@_CREATED_BY", SqlDbType.VarChar, vUserCode); param[1] = OPM_BL.setParameter("@_LEAVE_HIS_ID", SqlDbType.BigInt, vLeaveHisID); param[2] = OPM_BL.setParameter("@_PERSON_ID_APPROVE", SqlDbType.BigInt, Convert.ToInt64(aDr["person_id_approve"])); param[3] = OPM_BL.setParameter("@_APPROVER_LEVEL", SqlDbType.VarChar, aDr["approver_level"].ToString()); param[4] = OPM_BL.setParameter("@_APPROVE_STATUS", SqlDbType.VarChar, aDr["approve_status"].ToString()); param[5] = OPM_BL.setParameter("@_APPROVE_DATE", SqlDbType.VarChar, aDr["approve_date"].ToString()); param[6] = OPM_BL.setParameter("@_REMARKS", SqlDbType.VarChar, aDr["remarks"].ToString()); string rt = OPM_BL.ExecuteNoneQuery(sql, param); if (rt == "true") { result = true; } else { result = false; break; } } } lDt.Dispose(); } } gDt.Dispose(); } aDt.Dispose(); } } } dt.Dispose(); } } catch (Exception ex) { } return result; }
public string showMessage(string classname, string key, ASPxLabel lblmessage, bool isSuccess, object[] param, Exception ex) { if (isSuccess) { var msg = (string)GetGlobalResourceObject(classname, key); if (msg != null) msg = string.Format(msg, param); if (lblmessage != null) { lblmessage.ForeColor = Color.Green; lblmessage.Text = msg; } SiAuto.Main.LogColored(Color.LightGreen, "User result: {0}", msg); } else { var msg = (string)GetGlobalResourceObject(classname, key); if (msg != null) msg = string.Format(msg, param); if (lblmessage != null) { lblmessage.ForeColor = Color.Red; lblmessage.Text = msg; } SiAuto.Main.LogColored(Color.Red, "User result: {0}", ex.ToString()); } return ""; }
protected virtual void CreateSearchResultSummaryControl() { TemplateContainer.Add( SRSummaryControl = new ASPxLabel() ); SRSummaryControl.ID = Grid.GetSRSummaryControlID(); }
protected override void OnCallback(DevExpress.Web.CallbackEventArgsBase e) { base.OnCallback(e); String[] values = String.Concat(e.Parameter).Split(new char[] { '=' }, StringSplitOptions.RemoveEmptyEntries); if (values.Count() > 1) { switch (values[0]) { case "NewValue": decimal val = 0; if (decimal.TryParse(String.Concat(values[1]).Replace(".", System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator), out val)) Value = val; break; } } if (EditValueChanged != null) EditValueChanged(this, EventArgs.Empty); InnerRender(); if (OnClickScript != "") { ASPxLabel label = new ASPxLabel(); label.ClientSideEvents.Init = string.Format(@"function(s,e) {{ {0} }}", OnClickScript); Controls.Add(label); } }
public void RegisterOnClickScript() { if (OnClickScript != "") { ASPxLabel label = new ASPxLabel(); label.ClientSideEvents.Init = string.Format("function(s,e) {{ {0} }}", OnClickScript); Controls.Add(label); } }
public List<HtmlTableCell> BuildGridLookup(string fieldtext, string id, string tablename, string alias, string helptext, string SkinID, int length, string datasource, 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%"); //json attribute DataTable dtvalues = JsonConvert.DeserializeObject<DataTable>(datasource); string textformat = dtvalues.Rows[0]["textformat"].ToString(); string tablequery = dtvalues.Rows[0]["tablequery"].ToString(); string type = dtvalues.Rows[0]["type"].ToString(); string colSetting = dtvalues.Rows[0]["colSetting"].ToString(); string datavalue = dtvalues.Rows[0]["datavalue"].ToString(); string wherecondition = dtvalues.Rows[0]["wherecondition"].ToString(); SqlDataSource sqldata = new SqlDataSource() { ConnectionString = DataServices.ConnectString }; ASPxGridLookup gl = new ASPxGridLookup(); switch (type) { #region table case "table": { string select = string.Format("SELECT * FROM {0}", tablequery); string querysql = ProccessquerySql(select, wherecondition); proccessCreateColumnGridLookup(type,"",colSetting, gl); sqldata.SelectCommandType = SqlDataSourceCommandType.Text; sqldata.SelectCommand = querysql; gl.DataSource = sqldata; gl.KeyFieldName = datavalue; } break; #endregion #region query case "query": { string select = tablequery; string querysql = ProccessquerySql(select, wherecondition); proccessCreateColumnGridLookup(type,"", colSetting, gl); sqldata.SelectCommandType = SqlDataSourceCommandType.Text; sqldata.SelectCommand = querysql; gl.DataSource = sqldata; gl.KeyFieldName = select.IndexOf('*') >= 0 ? datavalue : datavalue.ToLower(); } break; #endregion #region query case "sp": { proccessCreateColumnGridLookup(type, "", colSetting, gl); sqldata.SelectCommandType = SqlDataSourceCommandType.StoredProcedure; sqldata.SelectCommand = tablequery; ProccessAddparamForStore(wherecondition, sqldata); gl.DataSource = sqldata; gl.KeyFieldName = datavalue; } break; #endregion } gl.ID = id; gl.GridViewProperties.Settings.ShowFilterRow = true; gl.SkinID = SkinID; gl.GridView.Width = Unit.Pixel((gl.GridView.Columns.Count > 0 ? gl.GridView.Columns.Count : 1) * (gl.GridView.Columns.Count > 0 ? int.Parse(gl.GridView.Columns[0].Width.Value.ToString()) : 1)); gl.Width = Unit.Percentage(99); gl.Theme = "DevEx"; gl.AutoPostBack = false; gl.TextFormatString = textformat; gl.DataBind(); gl.Value = controlValue; gl.ReadOnly = isReadOnly; celledit.Controls.Add(gl); c.Add(cell); c.Add(celledit); cot += 2; } catch (Exception ex) { LogAction(0, ex.ToString()); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), Guid.NewGuid().ToString(), "<script> alert('BuildGridLookup fieldname" + id + "'); </script>", false); } return c; }
public void GenerateActionsLayoutScript() { var lbl = new ASPxLabel(); lbl.ClientSideEvents.Init = "function(s,e) { CalcActionsColumns(); }"; VRAH.Controls.Add(lbl); Scripts.Controls.Add(lbl); }
protected override void OnCallback(DevExpress.Web.CallbackEventArgsBase e) { base.OnCallback(e); String[] values = String.Concat(e.Parameter).Split(new char[] { '=' }, StringSplitOptions.RemoveEmptyEntries); if (values.Count() > 1) { switch (values[0]) { case "NewValue": DateTime val; if (DateTime.TryParse(values[1], out val)) Value = val; break; } } if (EditValueChanged != null) EditValueChanged(this, EventArgs.Empty); InnerRender(); if (OnClickScript != "") { ASPxLabel label = new ASPxLabel(); label.ClientSideEvents.Init = string.Format("function(s,e) {{ {0} }}", OnClickScript); Controls.Add(label); } }
public List<HtmlTableCell> BuildCombobox(string fieldtext, string id, string tablename, string alias, string SkinID, string datasource, 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%"); //json attribute DataTable dtvalues = JsonConvert.DeserializeObject<DataTable>(datasource); string type = dtvalues.Rows[0]["type"].ToString(); string tablequery = dtvalues.Rows[0]["tablequery"].ToString(); string textformat = dtvalues.Rows[0]["textformat"].ToString(); string colSetting = dtvalues.Rows[0]["colSetting"].ToString(); string datavalue = dtvalues.Rows[0]["datavalue"].ToString(); string wherecondition = dtvalues.Rows[0]["wherecondition"].ToString(); SqlDataSource sqldata = new SqlDataSource() { ConnectionString = DataServices.ConnectString }; ASPxComboBox cmb = new ASPxComboBox(); switch (type) { #region table case "table": { string select = string.Format("SELECT * FROM {0}", tablequery); string querysql = ProccessquerySql(select, wherecondition); proccessCreateColumnComboBox(type,"",colSetting, cmb); sqldata.SelectCommandType = SqlDataSourceCommandType.Text; sqldata.SelectCommand = querysql; cmb.DataSource = sqldata; cmb.ValueField = datavalue; } break; #endregion #region query case "query": { string select = tablequery; string querysql = ProccessquerySql(select, wherecondition); proccessCreateColumnComboBox(type, select,colSetting, cmb); sqldata.SelectCommandType = SqlDataSourceCommandType.Text; sqldata.SelectCommand = tablequery; sqldata.SelectCommand = querysql; cmb.DataSource = sqldata; cmb.ValueField = select.IndexOf('*')>=0?datavalue:datavalue.ToLower(); } break; #endregion #region sp case "sp": { proccessCreateColumnComboBox(type,"",colSetting, cmb); sqldata.SelectCommandType = SqlDataSourceCommandType.StoredProcedure; sqldata.SelectCommand = tablequery; ProccessAddparamForStore(wherecondition, sqldata); cmb.DataSource = sqldata; cmb.ValueField = datavalue; } break; #endregion } cmb.ID = id; cmb.Width = Unit.Percentage(99); cmb.SkinID = SkinID; cmb.Theme = "DevEx"; cmb.AutoPostBack = false; cmb.CallbackPageSize = 30; cmb.DisplayFormatString = textformat; cmb.DataBind(); cmb.Value = controlValue; cmb.ReadOnly = isReadOnly; celledit.Controls.Add(cmb); c.Add(cell); c.Add(celledit); cot += 2; } catch (Exception ex) { LogAction(0, ex.ToString()); ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), Guid.NewGuid().ToString(), "<script> alert('buildCombobox fieldname" + id + "'); </script>", false); } return c; }
public List<HtmlTableCell> BuildDatetimePicker(string fieldtext, string id, string helptext, string SkinID, 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%"); ASPxDateEdit date = new ASPxDateEdit(); date.SkinID = SkinID; date.ID = id; date.NullText = helptext; date.Value = controlValue; date.DisplayFormatString = "dd/MM/yyyy"; //de.Enabled = alowEdit; date.Theme = "DevEx"; date.AutoPostBack = false; date.Width = Unit.Percentage(99); date.ReadOnly = isReadOnly; celledit.Controls.Add(date); c.Add(cell); c.Add(celledit); cot += 2; } catch (Exception) { ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), Guid.NewGuid().ToString(), "<script> alert('buildDatetimePicker fieldname" + id + "'); </script>", false); } return c; }
protected void Page_Load(object sender, EventArgs e) { m_Table = new HtmlTable(); fullList = GetData(); m_Table.Border = 1; HtmlTableRow row = GetHeader(); m_Table.Rows.Add(row); String currentAction = null; foreach (UserManagement.Data.Permission p in fullList) { HtmlTableCell cell; if (currentAction == null || currentAction != p.Name) { currentAction = p.Name; row = new HtmlTableRow(); for (int i = 0; i < 5; i++) row.Cells.Add(new HtmlTableCell()); cell = new HtmlTableCell(); ASPxLabel label = new ASPxLabel { Text = p.Name }; cell.Controls.Add(label); row.Cells.RemoveAt(0); row.Cells.Insert(0, cell); } cell = new HtmlTableCell(); ASPxCheckBox chk = new ASPxCheckBox(); chk.ClientSideEvents.CheckedChanged = "function(s, e) {document.getElementById('" + ((DetailComponent)Parent).linkSubmit.ClientID + "').className = 'btnSubmitChanged'}"; chk.ID = "chk_" + p.Action + "_" + p.PermissionID.ToString(); cell.Controls.Add(chk); SelectionPermission sp = new SelectionPermission(p.PermissionID, p.Name, p.Action); if (selectedList.Contains(sp)) chk.Checked = true; if (p.Action.Equals('R')) { row.Cells.RemoveAt(1); row.Cells.Insert(1, cell); } else if (p.Action.Equals('C')) { row.Cells.RemoveAt(2); row.Cells.Insert(2, cell); } else if (p.Action.Equals('U')) { row.Cells.RemoveAt(3); row.Cells.Insert(3, cell); } else if (p.Action.Equals('D')) { row.Cells.RemoveAt(4); row.Cells.Insert(4, cell); } m_Table.Rows.Add(row); } Controls.Add(m_Table); }
protected virtual ASPxEditBase CreateButtonSeparator(ASPxSmartGridViewCommandButtonSeparatorType buttonSeparatorType) { switch (buttonSeparatorType) { case ASPxSmartGridViewCommandButtonSeparatorType.Image: return ButtonSeparatorImage = new ASPxImage(); default: return ButtonSeparatorText = new ASPxLabel(); } }
protected void Handler_OnCallback(object source, DevExpress.Web.CallbackEventArgs e) { String[] values = String.Concat(e.Parameter).Split(new char[] { '=' }, StringSplitOptions.RemoveEmptyEntries); if (values.Count() > 1) { switch (values[0]) { case "NewValue": var newValues = values[1].Split(new String[] { Delimeter }, StringSplitOptions.RemoveEmptyEntries); int id; var oldValues = String.Concat(Value).Split(new String[] { Delimeter }, StringSplitOptions.RemoveEmptyEntries).ToList(); foreach (var item in newValues) { if (int.TryParse(item, out id)) { var SelectedItem = Items.List[id]; if (oldValues.IndexOf(SelectedItem.Value) == -1) oldValues.Add(SelectedItem.Value); } } Value = String.Join(Delimeter, oldValues); break; case "AddValue": newValues = values[1].Split(new String[] { Delimeter }, StringSplitOptions.RemoveEmptyEntries); foreach(var item in newValues) if (Items.List.Where(f => f.Value == item).Count() == 0) { var newItem = Items.Add(); newItem.Text = newItem.Value = item; } oldValues = String.Concat(Value).Split(new String[] { Delimeter }, StringSplitOptions.RemoveEmptyEntries).ToList(); foreach (var item in newValues) if (oldValues.IndexOf(item) == -1) oldValues.Add(item); Value = String.Join(Delimeter, oldValues); break; case "Remove": oldValues = String.Concat(Value).Split(new String[] { Delimeter }, StringSplitOptions.RemoveEmptyEntries).ToList(); if (int.TryParse(values[1], out id)) { var item = Items.List[id]; if (oldValues.IndexOf(item.Value) > -1) oldValues.Remove(item.Value); if (item.IsMissed) Items.List.Remove(item); } Value = String.Join(Delimeter, oldValues); break; } } if (EditValueChanged != null) EditValueChanged(this, EventArgs.Empty); InnerRender(); if (OnClickScript != "") { ASPxLabel label = new ASPxLabel(); label.ClientSideEvents.Init = string.Format(@"function(s,e) {{ {0} }}", OnClickScript); Controls.Add(label); } if (OnCallback != null) OnCallback(source, e); }
private HtmlTableRow GetHeader() { HtmlTableRow row = new HtmlTableRow(); HtmlTableCell c = new HtmlTableCell(); ASPxLabel label = new ASPxLabel { Text = GetLocalResourceObject("Name").ToString() }; c.Controls.Add(label); row.Cells.Add(c); c = new HtmlTableCell(); label = new ASPxLabel { Text = GetLocalResourceObject("Read").ToString() }; c.Controls.Add(label); row.Cells.Add(c); c = new HtmlTableCell(); label = new ASPxLabel { Text = GetLocalResourceObject("Create").ToString() }; c.Controls.Add(label); row.Cells.Add(c); c = new HtmlTableCell(); label = new ASPxLabel { Text = GetLocalResourceObject("Update").ToString() }; c.Controls.Add(label); row.Cells.Add(c); c = new HtmlTableCell(); label = new ASPxLabel { Text = GetLocalResourceObject("Delete").ToString() }; c.Controls.Add(label); row.Cells.Add(c); return row; }