protected void cpOutputCommReport_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { }
protected void cbpanelUserPhase_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { }
protected void ASPxCallbackPanel1_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { //if (hidID.Contains("ID")) // FrmUtil.GetImage("Family", hidID["id"].ToString(), ASPxBinaryImage1); }
protected void gauge_CustomCallback(object source, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { UpdateGauge(); }
protected void cb_luukhoadaotao_OnCallback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { object idketqua = 0; if (e.Parameter.Contains("save")) { string filename = string.Empty; if (Session["file"] != null) { filename = Session["file"].ToString(); Session.Remove("file"); } int nguoi_kh = 0; int nguoi_th = 0; int tien_kh = 0; int tien_th = txt_thuchien_kinhphi.Text == "" ? 0 : Convert.ToInt32(txt_thuchien_kinhphi.Text); string tenkhoadaotao = cmb_khoadaotao.Value == null ? txt_khoadaotao.Text : cmb_khoadaotao.Text; object idkhoadaotaokehoach = cmb_khoadaotao.Value == null ? 0 : cmb_khoadaotao.Value; if (check_capnhat.Checked) { tenkhoadaotao = txt_khoadaotao.Text; int idkdt = cmb_khoadaotao.Value == null ? 0 : Convert.ToInt32(cmb_khoadaotao.Value); SqlHelper.ExecuteNonQuery(strconn, "[HRM_KHOADAOTAOKEHOACH_UI]", idkdt, 0, tenkhoadaotao, "", 0, 0, null, null, "", 0, 2); } object idkhoadaotao = SqlHelper.ExecuteScalar(strconn, "[HRM_KHOADAOTAO_UI]", 0, txt_madaotao.Text, idkhoadaotaokehoach, tenkhoadaotao, "", nguoi_kh, nguoi_th, tien_kh, tien_th, txt_nguonkinhphi.Text, txt_cosodaotao.Text, 0, cmb_chuyennganh.Value, 0, date_tungay.Value, date_denngay.Value, filename, memo_ghichu.Text, cmb_diadiemtochuc.Value, txt_donvitochuc.Text, check_camket.Checked, 0); for (int i = 0; i < grid_nhanvien.VisibleRowCount; i++) { ASPxComboBox cmb_ketqua = grid_nhanvien.FindRowCellTemplateControl(i, grid_nhanvien.Columns["ketqua"] as GridViewDataColumn, "cmb_ketqua") as ASPxComboBox; if (cmb_ketqua != null) { idketqua = cmb_ketqua.Value; } SqlHelper.ExecuteNonQuery(strconn, "HRM_KHOADAOTAONHANVIEN_UI", 0, idkhoadaotao, grid_nhanvien.GetRowValues(i, "idnhanvien"), idketqua, date_denngay.Value); } cb_luukhoadaotao.JSProperties["cpOP"] = 0; } else if (e.Parameter.Contains("update")) { string filename = string.Empty; if (Session["file"] != null) { filename = Session["file"].ToString(); Session.Remove("file"); } string tenkhoadaotao = cmb_khoadaotao.Value == null ? txt_khoadaotao.Text : cmb_khoadaotao.Text; object idkhoadaotaokehoach = cmb_khoadaotao.Value == null ? 0 : cmb_khoadaotao.Value; if (check_capnhat.Checked) { tenkhoadaotao = txt_khoadaotao.Text; SqlHelper.ExecuteNonQuery(strconn, "[HRM_KHOADAOTAOKEHOACH_UI]", cmb_khoadaotao.Value, 0, tenkhoadaotao, "", 0, 0, null, null, "", idkhoadaotaokehoach, 2);; } object idkhoadaotao = SqlHelper.ExecuteNonQuery(strconn, "[HRM_KHOADAOTAO_UI]", e.Parameter.Replace("update", ""), txt_madaotao.Text, idkhoadaotaokehoach, tenkhoadaotao, "", 0, 0, 0, Convert.ToInt32(txt_thuchien_kinhphi.Text), txt_nguonkinhphi.Text, txt_cosodaotao.Text, 0, cmb_chuyennganh.Value == null ? 0 : cmb_chuyennganh.Value, 0, date_tungay.Value, date_denngay.Value, filename, memo_ghichu.Text, cmb_diadiemtochuc.Value == null ? 0 : cmb_diadiemtochuc.Value, txt_donvitochuc.Text, check_camket.Checked, 0); for (int i = 0; i <= grid_nhanvien.VisibleRowCount; i++) { ASPxComboBox cmb_ketqua = grid_nhanvien.FindRowCellTemplateControl(i, grid_nhanvien.Columns["ketqua"] as GridViewDataColumn, "cmb_ketqua") as ASPxComboBox; if (cmb_ketqua != null) { idketqua = cmb_ketqua.Value; } SqlHelper.ExecuteNonQuery(strconn, "HRM_KHOADAOTAONHANVIEN_UI", 0, e.Parameter.Replace("update", ""), grid_nhanvien.GetRowValues(i, "idnhanvien"), idketqua, date_denngay.Value); } cb_luukhoadaotao.JSProperties["cpOP"] = 0; } else if (e.Parameter.Contains("delete")) { SqlHelper.ExecuteNonQuery(strconn, "[HRM_GET_KHOADAOTAO]", e.Parameter.Replace("delete", ""), 0, 10); string url = String.Format("{0}/images/FileQD/{1}", DotNetNuke.Common.Globals.ApplicationPath, gridToChucBoiDuong.GetRowValues(gridToChucBoiDuong.FocusedRowIndex, "quyetdinh")); string file = Server.MapPath(url); if (File.Exists(file)) { File.Delete(file); } cb_luukhoadaotao.JSProperties["cpOP"] = 0; } else if (e.Parameter.Contains("loadedit")) { DataSet ds = SqlHelper.ExecuteDataset(strconn, "[HRM_GET_KHOADAOTAO_NHANVIEN1]", e.Parameter.Replace("loadedit", ""), "", 0); DataTable tb1 = ds.Tables[0]; if (tb1.Rows.Count > 0) { txt_madaotao.Text = tb1.Rows[0]["madaotao"].ToString(); txt_donvitochuc.Text = tb1.Rows[0]["donvitochuc"].ToString(); txt_khoadaotao.Text = tb1.Rows[0]["khoadaotao"].ToString(); txt_nguonkinhphi.Text = tb1.Rows[0]["nguonkinhphi"].ToString(); txt_cosodaotao.Text = tb1.Rows[0]["cosodaotao"].ToString(); //txt_kehoachsoluonghocvien.Text = tb1.Rows[0]["kehoach_soluonghocvien"].ToString(); //txt_thuchien_soluonghocvien.Text = tb1.Rows[0]["thuchien_soluonghocvien"].ToString(); //txt_kehoachkinhphi.Text = tb1.Rows[0]["kehoach_kinhphi"].ToString(); txt_thuchien_kinhphi.Text = tb1.Rows[0]["thuchien_kinhphi"].ToString(); memo_ghichu.Text = tb1.Rows[0]["ghichu"].ToString(); //var itemhinhthuc = cmb_hinhthucdaotao.Items.FindByValue(tb1.Rows[0]["idhinhthucdaotao"]); //if (itemhinhthuc != null) // itemhinhthuc.Selected = true; //var itemtrinhdo = cmb_trinhdo.Items.FindByValue(tb1.Rows[0]["idtrinhdo"]); //if (itemtrinhdo != null) // itemtrinhdo.Selected = true; var itemdiadiem = cmb_diadiemtochuc.Items.FindByValue(tb1.Rows[0]["iddiadiemtochuc"]); if (itemdiadiem != null) { itemdiadiem.Selected = true; } var itemnganhdaotao = cmb_chuyennganh.Items.FindByValue(tb1.Rows[0]["idchuyennganh"]); if (itemnganhdaotao != null) { itemnganhdaotao.Selected = true; } date_tungay.Value = tb1.Rows[0]["tungay"]; date_denngay.Value = tb1.Rows[0]["denngay"]; load_combokhoadaotao(Convert.ToDateTime(tb1.Rows[0]["tungay"]).Year + "," + cmb_chuyennganh.Value); var itemkhoadaotao = cmb_khoadaotao.Items.FindByValue(tb1.Rows[0]["idkhoadaotaokehoach"]); if (itemkhoadaotao != null) { itemkhoadaotao.Selected = true; } else { cb_luukhoadaotao.JSProperties["cpShow"] = 0; } } grid_nhanvien.DataSource = ds.Tables[1]; grid_nhanvien.DataBind(); for (int i = 0; i < grid_nhanvien.VisibleRowCount; i++) { ASPxComboBox cmb_ketqua = grid_nhanvien.FindRowCellTemplateControl(i, grid_nhanvien.Columns["ketqua"] as GridViewDataColumn, "cmb_ketqua") as ASPxComboBox; if (cmb_ketqua != null) { var item = cmb_ketqua.Items.FindByValue(grid_nhanvien.GetRowValues(i, "ketqua")); if (item != null) { item.Selected = true; } } } var list = (from x in ds.Tables[1].AsEnumerable() select new { id = x.Field <Int32>("idnhanvien"), hoten = x.Field <string>("hoten") }).ToJson(); cb_luukhoadaotao.JSProperties["cpListNV"] = list; cb_luukhoadaotao.JSProperties["cpOP"] = 1; } else if (e.Parameter.Contains("loadnull")) { txt_madaotao.Text = ""; txt_donvitochuc.Text = ""; txt_khoadaotao.Text = ""; txt_nguonkinhphi.Text = ""; txt_cosodaotao.Text = ""; //txt_kehoachsoluonghocvien.Text = ""; //txt_thuchien_soluonghocvien.Text = ""; //txt_kehoachkinhphi.Text = ""; txt_thuchien_kinhphi.Text = ""; memo_ghichu.Text = ""; //cmb_hinhthucdaotao.SelectedIndex = 0; //cmb_trinhdo.SelectedIndex = 0; cmb_diadiemtochuc.SelectedIndex = 0; cmb_chuyennganh.SelectedIndex = 0; date_tungay.Value = null; date_denngay.Value = null; grid_nhanvien.DataSource = null; grid_nhanvien.DataBind(); cb_luukhoadaotao.JSProperties["cpOP"] = 2; } }
protected void panelBookingEntriesPopup_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { string[] args = e.Parameter.Split('|'); string command = args[0]; NAS.BO.Invoice.SalesInvoiceBO salesInvoiceBO = new NAS.BO.Invoice.SalesInvoiceBO(); switch (command) { case "Show": popupBookingEntriesForm.ShowOnPageLoad = true; BillId = Guid.Parse(args[1]); BindData(); popupBookingEntriesForm.HeaderText = String.Format("Hạch toán phiếu bán hàng - {0}", salesInvoiceBO.GetBillById(session, BillId).Code); break; case "Book": /*2014-02-13 ERP-1417 Duc.Vo INS START*/ BusinessObjectBO BusinessObjectBO = new BusinessObjectBO(); int objectInventoryFinacialType = int.MinValue; //int objectInventoryItemType = int.MinValue; int objectInvoiceFinacialType = int.MinValue; int objectVoucherItemType = int.MinValue; /*2014-02-13 ERP-1417 Duc.Vo INS END*/ popupBookingEntriesForm.ShowOnPageLoad = true; string messages = null; UnitOfWork uow = null; try { uow = XpoHelper.GetNewUnitOfWork(); Bill bill = salesInvoiceBO.GetBillById(uow, BillId); popupBookingEntriesForm.HeaderText = String.Format("Hạch toán phiếu bán hàng - {0}", bill.Code); if (bill.RowStatus.Equals(Utility.Constant.ROWSTATUS_BOOKED_ENTRY)) { messages = String.Format("Phiếu bán hàng '{0}' đã được ghi sổ", bill.Code); } else { IEnumerable <string> temp; List <string> errorList = new List <string>(); bool canBookEntriesTemp; bool canBookEntries = true; canBookEntriesTemp = gridviewBookingEntriesForm.CanBookEntries(out temp); canBookEntries = canBookEntries & canBookEntriesTemp; errorList.AddRange(temp); canBookEntriesTemp = gridviewVoucherBookingEntriesForm.CanBookEntries(out temp); canBookEntries = canBookEntries & canBookEntriesTemp; errorList.AddRange(temp); canBookEntriesTemp = gridviewInventoryBookingEntriesForm.CanBookEntries(out temp); canBookEntries = canBookEntries & canBookEntriesTemp; errorList.AddRange(temp); /*2014-02-13 ERP-1417 Duc.Vo INS START*/ if (bill is NAS.DAL.Invoice.PurchaseInvoice) { objectInventoryFinacialType = Utility.Constant.BusinessObjectType_InputInventoryCommandFinancialTransaction; //objectInventoryItemType = Utility.Constant.BusinessObjectType_InputInventoryCommandItemTransaction; objectInvoiceFinacialType = Utility.Constant.BusinessObjectType_PurcharseFinancialTransaction; objectVoucherItemType = Utility.Constant.BusinessObjectType_PaymentVoucherTransaction; } else if (bill is NAS.DAL.Invoice.SalesInvoice) { objectInventoryFinacialType = Utility.Constant.BusinessObjectType_OutputInventoryCommandFinancialTransaction; //objectInventoryItemType = Utility.Constant.BusinessObjectType_OutputInventoryCommandItemTransaction; objectInvoiceFinacialType = Utility.Constant.BusinessObjectType_SalesFinancialTransaction; objectVoucherItemType = Utility.Constant.BusinessObjectType_ReceiptVoucherTransaction; } /*2014-02-13 ERP-1417 Duc.Vo INS END*/ if (canBookEntries) { TransactionBOBase transactionBOBase = new TransactionBOBase(); bill.RowStatus = Utility.Constant.ROWSTATUS_BOOKED_ENTRY; //Book entries //var transactions = new XPCollection<Transaction>(uow, // gridviewBookingEntriesForm.GetDataSource()); var transactions1 = gridviewBookingEntriesForm.GetDataSource(); foreach (var transaction in transactions1) { transactionBOBase.BookEntry(uow, transaction.TransactionId); } var transactions2 = gridviewVoucherBookingEntriesForm.GetDataSource(); foreach (var transaction in transactions2) { transactionBOBase.BookEntry(uow, transaction.TransactionId); } var transactions3 = gridviewInventoryBookingEntriesForm.GetDataSource(); foreach (var transaction in transactions3) { transactionBOBase.BookEntry(uow, transaction.TransactionId); } /*2014-02-13 ERP-1417 Duc.Vo INS START*/ foreach (var transaction in transactions1) { BusinessObjectBO.CreateBusinessObject(uow, objectInvoiceFinacialType, transaction.TransactionId, transaction.IssueDate); } foreach (var transaction in transactions2) { BusinessObjectBO.CreateBusinessObject(uow, objectVoucherItemType, transaction.TransactionId, transaction.IssueDate); } foreach (var transaction in transactions3) { BusinessObjectBO.CreateBusinessObject(uow, objectInventoryFinacialType, transaction.TransactionId, transaction.IssueDate); } /*2014-02-13 ERP-1417 Duc.Vo INS END*/ } else { foreach (var message in errorList) { messages += message + "\n"; } } } uow.CommitChanges(); BindData(); } catch (Exception) { throw; } finally { if (uow != null) { uow.Dispose(); } if (messages != null) { panelBookingEntriesPopup.JSProperties["cpError"] = messages; } } break; case "Cancel": popupBookingEntriesForm.ShowOnPageLoad = false; BillId = Guid.Empty; panelBookingEntriesPopup.JSProperties["cpEvent"] = "Closing"; break; default: break; } }
protected void panel2_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { gridProducts.Visible = true; }
protected void cbpanelUserFinishedProductUnit_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { }
protected void cpnReceiptVoucherEditingForm_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { string[] args = e.Parameter.Split('|'); string command = args[0]; bool isSuccess = false; PaymentVoucherTransactionBO paymentVoucherTransactionBO; try { switch (command) { case "Create": VoucherId = Guid.Empty; //If create voucher from bill if (args.Length > 1) { BillId = Guid.Parse(args[1]); } else { BillId = Guid.Empty; } GUIContext.State = new PaymentVoucherCreating(this); hiddenField["voucherId"] = VoucherId; number = null; break; case "Edit": if (args.Length < 2) { throw new Exception("Invalid parameters"); } VoucherId = Guid.Parse(args[1]); hiddenField["voucherId"] = VoucherId; paymentVoucherTransactionBO = new PaymentVoucherTransactionBO(); if (paymentVoucherTransactionBO.IsVoucherLockedBookingEntry(VoucherId)) { GUIContext.State = new PaymentVoucherLocked(this); } else { GUIContext.State = new PaymentVoucherEditing(this); UpdateBookingEntryState(); } number = null; break; case "ForceRefresh": if (GUIContext.State is PaymentVoucherCreating) { ClearFormValidation(); PaymentVoucherCreating_UpdateGUI(); UpdateGUIByCurrency(gridlookupCurrency.GetSelectedCurrency(session)); } else { paymentVoucherTransactionBO = new PaymentVoucherTransactionBO(); //if (GUIContext.State is ReceiptVoucherCreating) //{ // GUIContext.State = new ReceiptVoucherCreating(this); //} //else //{ if (paymentVoucherTransactionBO.IsVoucherLockedBookingEntry(VoucherId)) { GUIContext.State = new PaymentVoucherLocked(this); } else { UpdateBookingEntryState(); } } //} break; case "Cancel": GUIContext.Request(command, this); number = null; break; default: GUIContext.Request(command, this); UpdateBookingEntryState(); number = null; break; } isSuccess = true; } catch (Exception) { throw; } finally { if (command != null) { cpnReceiptVoucherEditingForm.JSProperties.Add("cpCallbackArgs", String.Format("{{ \"transition\": \"{0}\", \"success\": {1} }}", command, isSuccess.ToString().ToLower())); } } }
public void ASPxCallbackPanel1_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { gridLookupItem.GridView.Selection.SelectAll(); }
protected void cpReportViewer_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { }
protected void cpLineProduct_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { /* * String[] aParam = e.Parameter.Split('|'); * * switch (aParam[0]) * { * case "new": * * * Session["url"] = Guid.NewGuid(); * * uow = new UnitOfWork(ConnectionHelper.GetDataLayer(DevExpress.Xpo.DB.AutoCreateOption.SchemaAlreadyExists)); * * ProductSupplierXDS.Session = uow; * ProductSupplierXDS.Criteria = "[Language] = 'VN' And [ProductId] = @ProductId"; * ProductSupplierXDS.CriteriaParameters.Add("@ProductId", System.Data.DbType.Guid, "00000000-0000-0000-0000-000000000000"); * * //grdSupplier.DataBind(); * * * break; * * case "edit": * * * viewProduct = (ViewProduct)Session["productMode"]; * if (viewProduct != null) * { * txtCode.Text = viewProduct.Code; * txtDescription.Text = viewProduct.Description; * txtName.Text = viewProduct.Name; * * cboManufacturer.Value = viewProduct.ManufacturerCode; * * cboRowStatus.Value = viewProduct.RowStatus.ToString(); * * * uow = new UnitOfWork(ConnectionHelper.GetDataLayer(DevExpress.Xpo.DB.AutoCreateOption.SchemaAlreadyExists)); * * ProductSupplierXDS.Session = uow; * ProductSupplierXDS.Criteria = "[Language] = 'VN' And [ProductId] = @ProductId"; * * ProductSupplierXDS.CriteriaParameters.Clear(); * ProductSupplierXDS.CriteriaParameters.Add("@ProductId", System.Data.DbType.Guid, viewProduct.ProductId.ToString()); * * //grdProductSupplier.DataSource = ProductSupplierXDS; * grdProductSupplier.DataBind(); * * for (int i = 0; i < grdProductSupplier.VisibleRowCount; i++) * { * String suppliercode = grdProductSupplier.GetRowValues(i, "SupplierCode").ToString(); * } * * //grdSupplier.DataBind(); * * } * * break; * * case "save": * * if (!validate()) * { * return; * } * * using (uow = new ExplicitUnitOfWork(ConnectionHelper.GetDataLayer(DevExpress.Xpo.DB.AutoCreateOption.SchemaAlreadyExists))) * { * manufacturer = uow.FindObject<Manufacturer>(new BinaryOperator("Code", cboManufacturer.Value)); * * if (manufacturer == null) * { * return; * } * * if (Session["productMode"] == null) * { * XPCollection<ProductSupplier> lproductSupplier = new XPCollection<ProductSupplier>(); * //productSupplier = uow.FindObject<ProductSupplier>(new BinaryOperator("")); * * * product = new Product(uow); * product.ProductId = Guid.NewGuid(); * product.Code = txtCode.Text; * //product.ManufacturerId = manufacturer; * product.RowCreationTimeStamp = DateTime.Now; * product.RowStatus = Char.Parse(cboRowStatus.Value.ToString()); * * for (int i = 0; i < grdProductSupplier.VisibleRowCount; i++) * { * String suppliercode = grdProductSupplier.GetRowValues(i, "SupplierCode").ToString(); * supplier = uow.FindObject<Supplier>(new BinaryOperator("Code", suppliercode)); * * if (supplier != null) * { * productSupplier = new ProductSupplier(uow); * productSupplier.SupplierId = supplier; * productSupplier.ProductId = product; * * * } * * //lproductSupplier.Add(productSupplier); * } * * * * //for (int i = 0; i < grdSupplier.VisibleRowCount; i++) * //{ * // supplier = uow.FindObject<Supplier>(new BinaryOperator("SupplierCode", grdSupplier.GetRowValues(i, "SupplierCode"))); * * // productSupplier = new ProductSupplier(uow); * // productSupplier.SupplierId = supplier; * * // product.ProductSuppliers.Add(productSupplier); * //} * * productProperty = new ProductProperty(uow); * productProperty.ProductId = product; * productProperty.Language = "VN"; * productProperty.Name = txtName.Text; * productProperty.Description = txtDescription.Text; * * productProperty = new ProductProperty(uow); * productProperty.ProductId = product; * productProperty.Language = "EN"; * productProperty.Name = txtName.Text; * productProperty.Description = txtDescription.Text; * * } * else * { * viewProduct = (ViewProduct)Session["productMode"]; * product = uow.FindObject<Product>(new BinaryOperator("ProductId", viewProduct.ProductId)); * * if (product != null) * { * product.Code = txtCode.Text; * //product.ManufacturerId = manufacturer; * product.RowStatus = Char.Parse(cboRowStatus.Value.ToString()); * * CriteriaOperator co = CriteriaOperator.Parse("[ProductId] = ? And Language = ?", viewProduct.ProductId, "VN"); * productProperty = uow.FindObject<ProductProperty>(new BinaryOperator("ProductId", product)); * * if (productProperty != null) * { * productProperty.Name = txtName.Text; * productProperty.Description = txtDescription.Text; * } * } * } * * uow.CommitChanges(); * * Session["productMode"] = null; * * formProductEdit.ShowOnPageLoad = false; * } * * break; * * case "view": * uow = new UnitOfWork(ConnectionHelper.GetDataLayer(DevExpress.Xpo.DB.AutoCreateOption.SchemaAlreadyExists)); * Guid guid = new Guid(aParam[1]); * * viewProduct = uow.FindObject<ViewProduct>(new BinaryOperator("ProductId", guid)); * * if (viewProduct != null) * { * txtCode.Text = viewProduct.Code; * txtDescription.Text = viewProduct.Description; * txtName.Text = viewProduct.Name; * * cboRowStatus.Value = viewProduct.RowStatus; * cboManufacturer.Value = viewProduct.ManufacturerCode; * * txtCode.ReadOnly = true; * txtDescription.ReadOnly = true; * txtName.ReadOnly = true; * cboRowStatus.ReadOnly = true; * cboManufacturer.ReadOnly = true; * buttonAccept.Enabled = false; * } * * formProductEdit.ShowOnPageLoad = true; * * break; * default: * break; * } */ }
protected void cpnNASCustomFieldTypeMultiSelectionListControl_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { string[] para = e.Parameter.Split(','); if (para[0].Equals("Update")) { List <object> selectedRows = grdlookupItemMenu.GridView.GetSelectedFieldValues("CustomFieldDataId"); List <Guid> selectedItems = new List <Guid>(); foreach (object row in selectedRows) { selectedItems.Add(Guid.Parse(row.ToString())); } if (BO.UpdateSelecteCustomFieldAllDataItems(ObjectCustomFieldId, selectedItems)) { if (DataUpdated != null) { ObjectCustomField objectCustomField = session.GetObjectByKey <ObjectCustomField>(ObjectCustomFieldId); //Raise DataUpdated event DataUpdated(this, new CustomFieldControlEventArgs( ObjectCustomFieldId, objectCustomField.ObjectTypeCustomFieldId.ObjectTypeCustomFieldId, objectCustomField.ObjectId.ObjectId, objectCustomField.ObjectTypeCustomFieldId.CustomFieldId.CustomFieldId, CustomFieldControlEventArgs.CustomFieldCategoryEnum.LIST, null, BasicCustomFieldTypeEnum.NONE, null, selectedItems)); } } } if (para[0].ToUpper().Equals("EDIT")) { if (BeforeDataEditing != null) { BeforeDataEditing(this, new EventArgs()); } } GUIContext.Request(para[0], this); }
//protected void pcBalanceItems_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) //{ // loadBalanceInfo(Guid.Parse(Session["InventorySelected"].ToString()), Guid.Parse(e.Parameter.ToString())); //} protected void cpReportProduct_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { loadBalanceInfo(Guid.Parse(Session["InventorySelected"].ToString()), Guid.Parse(e.Parameter.ToString())); }
protected void cpnNASCustomFieldTypeSingleSelectionListControl_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { string[] para = e.Parameter.Split(','); if (para[0].ToUpper().Equals("CLEAR")) { BO.UpdateCustomFieldData(ObjectCustomFieldId, Guid.Empty); GUIContext.State = new NASCustomFieldTypeSingleSelectionListControlDataViewingState(this); return; } else if (para[0].ToUpper().Equals("UPDATE")) { Guid stringCustomFieldDataId = Guid.Parse(cboSingleSelectionList.Value.ToString()); if (BO.UpdateCustomFieldData(ObjectCustomFieldId, stringCustomFieldDataId)) { if (DataUpdated != null) { ObjectCustomField objectCustomField = session.GetObjectByKey <ObjectCustomField>(ObjectCustomFieldId); List <Guid> IdList = new List <Guid>(); IdList.Add(Guid.Parse(cboSingleSelectionList.Value.ToString())); //Raise DataUpdated event DataUpdated(this, new CustomFieldControlEventArgs( ObjectCustomFieldId, objectCustomField.ObjectTypeCustomFieldId.ObjectTypeCustomFieldId, objectCustomField.ObjectId.ObjectId, objectCustomField.ObjectTypeCustomFieldId.CustomFieldId.CustomFieldId, CustomFieldControlEventArgs.CustomFieldCategoryEnum.LIST, null, BasicCustomFieldTypeEnum.NONE, null, IdList)); } } } else if (para[0].ToUpper().Equals("EDIT")) { if (BeforeDataEditing != null) { BeforeDataEditing(this, new EventArgs()); } } GUIContext.Request(para[0], this); }
protected void CPNumberString_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { lbl_text_NumberToString(); }
protected void cmbQLNhaNuoc_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { BinhQLNN(Convert.ToInt32(e.Parameter.ToString())); }
protected void cpItemEdit_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { throw new Exception("Hello world!"); }
protected void panel1_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { gridCategories.Visible = true; gridCategories.DataBind(); }
protected void listNhanVienChon_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { }
protected void cbb_Location_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { FillLocation(e.Parameter); }
protected void cmb_capkhenthuong_OnCallback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { load_combo_capkhenthuong(); }
protected void cpLineUnit_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { }
public void ASPxCallbackPanel1_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { CurrentValue = e.Parameter; //UserEventArgs args = new UserEventArgs() { Value = CurrentValue }; //Fresh(sender, args); }
protected void cmb_khoadaotao_OnCallback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { load_combokhoadaotao(e.Parameter); }
protected void cbUsuario_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { PreencheddlUsuario(cbSetorDesconto.SelectedItem.Value.ToString()); }
protected void dxcbpodfiles_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { try { string _folderpath = ""; //int _orderno = 0; int _ordernocount = 0; Int32 _folderid = 0; bool _uploaded = false; //flagged if uploaded completed ok _folderpath = return_selected_folder(); _folderid = return_selected_folderid(_folderpath); _uploaded = this.dxhfmanager.Contains("upld") ? (bool)this.dxhfmanager.Get("upld") : false; //09012011 stored in ilist to save casting datatable for IN query //05012011 multiple order no's are stored in data table //_ordernocount = _ol.Rows.Count; //_orderno = wwi_func.vint(this.dxlblorderno1.Text.ToString()); //this.dxhfmanager.Contains("ord") ? wwi_func.vint(wwi_security.DecryptString(this.dxhfmanager.Get("ord").ToString(), "publiship")) : 0; //DataTable _ol = (DataTable)Session["orderlist"]; IList <Int32> _ol = (IList <Int32>)Session["orderlist"]; _ordernocount = _ol.Count; if (_uploaded & _folderid > 0 && _ordernocount > 0) //if (_uploaded & _folderid > 0 && _orderno > 0) { //copy files from temporary folder string _uid = wwi_security.DecryptString(this.dxhfmanager.Get("uid").ToString(), "publiship"); string _tempdir = DateTime.Now.ToShortDateString().Replace("/", "") + _uid; string _sourcepath = System.IO.Path.Combine("~\\documents\\not found", _tempdir); int _copies = file_transfer(_sourcepath, _folderpath, true); if (_copies > 0) { //update order table //save quote id to order table //if (_ordernocount == 1) //{ // //(DataRow)_ol.Rows[0][0] // SubSonic.Update upd2 = new SubSonic.Update(DAL.Logistics.Schemas.OrderTable); // recordsaffected = upd2.Set("document_folder").EqualTo(_folderid) // .Where("OrderNumber").IsEqualTo(_ol[0]) // .Execute(); //} //else //{ //string _csv = wwi_func.datatable_to_string(_ol, ","); string _csv = string.Join(",", _ol.Select(i => i.ToString()).ToArray()); //establish connection ConnectionStringSettings _cs = ConfigurationManager.ConnectionStrings["PublishipSQLConnectionString"]; SqlConnection _cn = new SqlConnection(_cs.ConnectionString); //create a sql data adapter System.Data.SqlClient.SqlDataAdapter _adapter = new System.Data.SqlClient.SqlDataAdapter(); //instantiate event handler _adapter.RowUpdated += new SqlRowUpdatedEventHandler(adapter_RowUpdated); _adapter.SelectCommand = new SqlCommand("SELECT [document_folder], [orderNumber] FROM OrderTable WHERE [OrderNumber] IN (" + _csv + ")", _cn); //populate datatable using selected order numbers DataTable _dt = new DataTable(); _adapter.Fill(_dt); //update document folder for each order number in _dt for (int ix = 0; ix < _dt.Rows.Count; ix++) { _dt.Rows[ix]["document_folder"] = _folderid; } //update command _adapter.UpdateCommand = new SqlCommand("UPDATE OrderTable SET [document_folder] = @document_folder WHERE [OrderNumber] = @OrderNumber;", _cn); _adapter.UpdateCommand.Parameters.Add("@OrderNumber", SqlDbType.Int).SourceColumn = "OrderNumber"; _adapter.UpdateCommand.Parameters.Add("@document_folder", SqlDbType.Int).SourceColumn = "document_folder"; _adapter.UpdateBatchSize = 5; //_ordernocount; _adapter.UpdateCommand.UpdatedRowSource = UpdateRowSource.None; _adapter.Update(_dt); _adapter.Dispose(); _cn.Close(); //} if (_countUpdated > 0) //countupdated will return the number of batches sent NOT the number of records updated { //disable session expiration which occurs when a directory is deleted //uses System.Reflection PropertyInfo p = typeof(System.Web.HttpRuntime).GetProperty("FileChangesMonitor", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static); object o = p.GetValue(null, null); FieldInfo f = o.GetType().GetField("_dirMonSubdirs", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.IgnoreCase); object monitor = f.GetValue(o); MethodInfo m = monitor.GetType().GetMethod("StopMonitoring", BindingFlags.Instance | BindingFlags.NonPublic); m.Invoke(monitor, new object[] { }); //kill temp folder System.IO.Directory.Delete(Server.MapPath(_sourcepath), true); this.dxlblinfo2.Text += _copies + " files have been uploaded to folder " + _folderid + " and linked to order numbers(s) " + _csv; this.dxpnlinfo.Visible = true; } else { this.dxlblerr.Text = "We have not been able to link order number(s) to online folder " + _folderid + " please refer to Publiship I.T."; this.dxpnlerr.Visible = true; } //end check records affected } } //end update order table } catch (Exception ex) { this.dxlblerr.Text = ex.Message.ToString(); this.dxpnlerr.Visible = true; } }
protected void cpUnitEdit_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { String[] p = e.Parameter.Split('|'); UnitOfWork uow; //ViewProductUnit pu; ASPxHtmlEditor htmlDescription; switch (p[0]) { case "new": cboUnitEditRowStatus.Value = "A"; formUnitEdit.HeaderText = "Thông tin đơn vị tính - Thêm mới"; htmlDescription = (ASPxHtmlEditor)nbUnitEdit.Items[0].FindControl("htmlDescription"); htmlDescription.Html = ""; break; case "edit": //formUnitEdit.HeaderText = "Thông tin đơn vị tính - " + hUnitEditId.Get("id").ToString(); //uow = XpoHelpers.GetNewUnitOfWork(); //pu = uow.GetObjectByKey<ViewProductUnit>(long.Parse(hUnitEditId.Get("id").ToString())); //txtUnitEditCode.Text = pu.Code; //txtUnitEditName.Text = pu.Name; //cboUnitEditRowStatus.Value = Convert.ToString(pu.RowStatus); //htmlDescription = (ASPxHtmlEditor)nbUnitEdit.Items[0].FindControl("htmlDescription"); //htmlDescription.Html = pu.Description; break; //case "save": // if (!validate()) // { // return; // } //using (uow = XpoHelpers.GetNewUnitOfWork()) //{ // htmlDescription = (ASPxHtmlEditor)nbUnitEdit.Items[0].FindControl("htmlDescription"); // ProductUnitEntity pue = new ProductUnitEntity(); // pue.Code = txtUnitEditCode.Text; // pue.Name = txtUnitEditName.Text; // pue.Description = htmlDescription.Html; // if (hUnitEditId.Count > 0) // { // pu = uow.GetObjectByKey<ViewProductUnit>(long.Parse(hUnitEditId.Get("id").ToString())); // pue.ProductUnitId = pu.ProductUnitId; // pue.ProductUnitPropertyId = pu.ProductUnitPropertyId; // pue.RowStatus = char.Parse(cboUnitEditRowStatus.Value.ToString()); // ProductUnitBLO.updateProductUnit(pue); // } // else // { // pue.RowCreationTimeStamp = DateTime.Now; // pue.Language = Constant.LANG_DEFAULT; // pue.RowStatus = Constant.ROWSTATUS_ACTIVE; // ProductUnitBLO.insertProductUnit(pue); // } // } // hUnitEditId.Clear(); // formUnitEdit.ShowOnPageLoad = false; // cpUnitEdit.JSProperties.Add("cpRefresh", "resfresh"); break; default: break; } }
protected void panelInvoiceEditingForm_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { string[] args = e.Parameter.Split('|'); string command = args[0]; PurchaseInvoiceBO purchaseInvoiceBO = new PurchaseInvoiceBO(); Bill bill = null; switch (command) { case "Create": GUIContext.State = new PurchaseInvoiceCreating(this); billDetails.InitState(); break; case "Edit": if (args.Length < 2) { throw new Exception("Invalid parameters"); } BillId = Guid.Parse(args[1]); //Determine bill status hfBillId["BillId"] = BillId.ToString(); bill = purchaseInvoiceBO.GetBillById(session, BillId); if (bill.RowStatus.Equals(Utility.Constant.ROWSTATUS_BOOKED_ENTRY)) { GUIContext.State = new PurchaseInvoiceLocked(this); } else { GUIContext.State = new PurchaseInvoiceEditing(this); } billDetails.InitState(); break; case "Save": GUIContext.Request(command, this); bill = purchaseInvoiceBO.GetBillById(session, BillId); if (bill.RowStatus.Equals(Utility.Constant.ROWSTATUS_BOOKED_ENTRY)) { GUIContext.State = new PurchaseInvoiceLocked(this); } break; case "Cancel": GUIContext.Request(command, this); panelInvoiceEditingForm.JSProperties["cpEvent"] = "Closing"; break; case "Refresh": bill = purchaseInvoiceBO.GetBillById(session, BillId); if (bill.RowStatus.Equals(Utility.Constant.ROWSTATUS_BOOKED_ENTRY)) { GUIContext.State = new PurchaseInvoiceLocked(this); } else { GUIContext.State = new PurchaseInvoiceEditing(this); } break; default: break; } uEdittingInputInventoryCommand1.SettingInit <NAS.DAL.Invoice.PurchaseInvoice>(BillId, ButtonCreateInventoryCommand); }
protected void cbpTxtEmployerNo_Callback(object source, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { }