protected override void FillData() { if (CommonMethod.IsNullOrEmpty(this.Period) && CommonMethod.IsNullOrEmpty(this.WarehouseCode)) { base.FillData(); } else { DataTable dtResult = new DataTable(); CommonBl commonBl = new CommonBl(); ST_CountSheetHeaderDto dto = new ST_CountSheetHeaderDto(); dto.Period = this.Period; dto.WarehouseCode = this.WarehouseCode; dto.PhysicalInventoryStatus = this.PhysicalInventoryStatus; commonBl.SelectCountSheetData(dto, out dtResult); if (dtResult.Columns.Count > 0) { if (this.HasNull) { DataRow newRow = dtResult.NewRow(); //newRow[0] = CommonData.StringEmpty; dtResult.Rows.InsertAt(newRow, 0); } } this.Properties.DataSource = dtResult; this.Properties.NullText = CommonData.StringEmpty; //this.EditValue = CommonData.StringEmpty; } }
public ActionResult Login(LoginModel model)//, string returnUrl) { if (ModelState.IsValid) { // UserSession.UserCode = model.UserName; UserSession.Pw = model.Password; //UserSession.LangId = dto.LangId.ConvertLanguageDBToCulture(); CommonBl commonBl = new CommonBl(); List <SYS_FunctionModel> lstGroupMenu = commonBl.GetGroupMenu(); Session["GroupMenu"] = lstGroupMenu; FormsAuthentication.SetAuthCookie(model.UserName, true); return(RedirectToAction("Index", "Home")); } //if (ModelState.IsValid && WebSecurity.Login(model.UserName, model.Password, persistCookie: model.RememberMe)) //{ //return RedirectToLocal(returnUrl); //} // If we got this far, something failed, redisplay form //ModelState.AddModelError("", "The user name or password provided is incorrect."); return(View("_Login", model)); }
/// <summary> /// Get data from database and assign to datasource of LookUp /// </summary> protected virtual void FillData() { //Select data CommonBl commonBl = new CommonBl(); commonBl.SelectDataForControl(this._code, out dtResult); }
protected override void FillData() { DataTable dtResult = new DataTable(); CommonBl commonBl = new CommonBl(); ST_StockTransactionMasterDto dto = new ST_StockTransactionMasterDto(); dto.PeriodCdn = this.Period; dto.WarehouseCnd = this.WarehouseCode; dto.DocumentTypeCdn = this.DocumentType; dto.SampleShippingFlg = this.SampleShippingFlg; dto.TransactionSubCodeCnd = this.TransactionSubCode; dto.CompanyCodeCnd = this.CompanyCode; dto.IsCustomerCnd = this.IsCompleted; dto.OrderByDesc = this.OrderByDesc; commonBl.SelectDocumentData(dto, this.CheckAuthorization, out dtResult); if (dtResult.Columns.Count > 0) { if (this.HasNull) { DataRow newRow = dtResult.NewRow(); //newRow[0] = CommonData.StringEmpty; dtResult.Rows.InsertAt(newRow, 0); } } this.Properties.DataSource = dtResult; this.Properties.NullText = CommonData.StringEmpty; //this.EditValue = CommonData.StringEmpty; //base.FillData(); }
protected override void FillData() { DataTable dtResult = new DataTable(); CommonBl commonBl = new CommonBl(); MS_CompanyDto dto = new MS_CompanyDto() { IsCustomer = this.IsCustomer, IsSupplier = this.IsSupplier, IsVendor = this.IsVendor, Status = this.Status, }; commonBl.SelectCompanyData(dto, out dtResult); if (dtResult.Columns.Count > 0) { if (this.HasNull) { DataRow newRow = dtResult.NewRow(); //newRow[0] = CommonData.StringEmpty; dtResult.Rows.InsertAt(newRow, 0); } } this.Properties.DataSource = dtResult; this.Properties.NullText = CommonData.StringEmpty; }
/// <summary> /// Get data from database and assign to datasource of LookUp /// </summary> protected override void FillData() { System.Data.DataTable dtResult = new System.Data.DataTable(); System.Collections.Hashtable htCond = new System.Collections.Hashtable(); htCond.Add(CommonData.CommonCode, Code); CommonBl commonBl = new CommonBl(); commonBl.SelectCommonData(htCond, out dtResult); if (dtResult.Columns.Count > 0) { if (HasNull) { dtResult.Rows.InsertAt(dtResult.NewRow(), 0); } } this.DataSource = dtResult; this.Columns.Clear(); IvsLookUpColumnInfo lookupColumn = new IvsLookUpColumnInfo(CommonData.CommonValue); this.Columns.Add(lookupColumn); this.Columns[CommonData.CommonValue].Caption = CommonData.StringEmpty; this.DisplayMember = CommonData.CommonValue; this.ValueMember = CommonData.CommonKey; this.NullText = CommonData.StringEmpty; if (this.DropDownRows > dtResult.Rows.Count) { this.DropDownRows = dtResult.Rows.Count + 1; } }
protected override void FillData() { DataTable dtResult = new DataTable(); CommonBl commonBl = new CommonBl(); INV_InvoiceHeaderDto dto = new INV_InvoiceHeaderDto(); dto.Status = this.Status; dto.CompanyCode = this.CompanyCode; commonBl.SelectInvoiceData(dto, out dtResult); if (dtResult.Columns.Count > 0) { if (this.HasNull) { DataRow newRow = dtResult.NewRow(); //newRow[0] = CommonData.StringEmpty; dtResult.Rows.InsertAt(newRow, 0); } } this.Properties.DataSource = dtResult; this.Properties.NullText = CommonData.StringEmpty; //this.EditValue = CommonData.StringEmpty; //base.FillData(); }
protected override void FillData() { DataTable dtResult = new System.Data.DataTable(); CommonBl commonBl = new CommonBl(); ST_MontlyProcessDto aa = new ST_MontlyProcessDto() { ProcessingFlg = this.ProcessingFlg, NumberOfRow = this.NumberOfRow, OrderByDesc = this.OrderByDesc, LessOrEqualCurrentPeriod = this.LessOrEqualCurrentPeriod, }; commonBl.SelectInventoryPeriodDataForControl(aa, out dtResult); if (this.HasNull && dtResult.Columns.Count > 0) { DataRow newRow = dtResult.NewRow(); //newRow[0] = CommonData.StringEmpty; dtResult.Rows.InsertAt(newRow, 0); } this.Properties.DataSource = dtResult; this.Properties.NullText = CommonData.StringEmpty; //this.EditValue = CommonData.StringEmpty; //this.Properties.NullText = CommonData.StringEmpty; }
protected override void FillData() { //Select employees data DataTable dtResult = new System.Data.DataTable(); CommonBl commonBl = new CommonBl(); MS_EmployeeDto empDto = new MS_EmployeeDto() { DepartmentCode = this.DepartmentCode, }; commonBl.SelectEmployeeData(empDto, out dtResult); if (dtResult.Columns.Count > 0) { if (this.HasNull) { DataRow newRow = dtResult.NewRow(); //newRow[0] = CommonData.StringEmpty; dtResult.Rows.InsertAt(newRow, 0); } } this.Properties.DataSource = dtResult; this.Properties.NullText = CommonData.StringEmpty; //this.EditValue = CommonData.StringEmpty; //this.SetLanguage(); }
/// <summary> /// Get data from database and assign to datasource of LookUp /// </summary> private void FillData() { System.Data.DataTable dtResult = new System.Data.DataTable(); System.Collections.Hashtable htCond = new System.Collections.Hashtable(); htCond.Add(CommonData.CommonCode, Code); CommonBl commonBl = new CommonBl(); commonBl.SelectCommonData(htCond, out dtResult); if (dtResult.Columns.Count > 0) { if (HasNull) { DataRow newRow = dtResult.NewRow(); //newRow[0] = CommonData.StringEmpty; dtResult.Rows.InsertAt(newRow, 0); } } this.Properties.DataSource = dtResult; this.Properties.Columns.Clear(); IvsLookUpColumnInfo lookupColumn = new IvsLookUpColumnInfo(CommonData.CommonValue); this.Properties.Columns.Add(lookupColumn); this.Properties.Columns[CommonData.CommonValue].Caption = CommonData.StringEmpty; this.Properties.DisplayMember = CommonData.CommonValue; this.Properties.ValueMember = CommonData.CommonKey; this.EditValue = CommonData.StringEmpty; this.Properties.NullText = CommonData.StringEmpty; }
protected override void FillData() { //Select item data DataTable dtResult = new DataTable(); CommonBl commonBl = new CommonBl(); MS_ItemDto itemDto = new MS_ItemDto() { GroupCode = this.ItemGroupCode, ItemType = this.ItemType }; commonBl.SelectProductData(itemDto, out dtResult); if (dtResult.Columns.Count > 0) { if (this.HasNull) { DataRow newRow = dtResult.NewRow(); newRow[1] = CommonData.StringEmpty; dtResult.Rows.InsertAt(newRow, 0); } } this.Properties.DataSource = dtResult; this.Properties.NullText = CommonData.StringEmpty; //this.EditValue = CommonData.StringEmpty; //this.SetLanguage(); }
protected virtual void SetAuthorityControl() { CommonBl commonBl = new CommonBl(); if (!CommonMethod.IsNullOrEmpty(this.FunctionGrp)) { CommonData.IsAuthority viewAuthority = commonBl.IsAuthority(this.FunctionGrp, CommonData.OperId.View); CommonData.IsAuthority newAuthority = commonBl.IsAuthority(this.FunctionGrp, CommonData.OperId.Add); CommonData.IsAuthority editAuthority = commonBl.IsAuthority(this.FunctionGrp, CommonData.OperId.Edit); CommonData.IsAuthority deleteAuthority = commonBl.IsAuthority(this.FunctionGrp, CommonData.OperId.Delete); CommonData.IsAuthority exportAuthority = commonBl.IsAuthority(this.FunctionGrp, CommonData.OperId.Export); CommonData.IsAuthority printAuthority = commonBl.IsAuthority(this.FunctionGrp, CommonData.OperId.Print); CommonData.IsAuthority importAuthority = commonBl.IsAuthority(this.FunctionGrp, CommonData.OperId.Import); this.AuthorityDictionary = new Dictionary <CommonData.ButtonCategory, CommonData.IsAuthority>(); this.AuthorityDictionary.Add(CommonData.ButtonCategory.Search, viewAuthority); this.AuthorityDictionary.Add(CommonData.ButtonCategory.Add, newAuthority); this.AuthorityDictionary.Add(CommonData.ButtonCategory.Copy, newAuthority); this.AuthorityDictionary.Add(CommonData.ButtonCategory.Edit, editAuthority); this.AuthorityDictionary.Add(CommonData.ButtonCategory.Delete, deleteAuthority); this.AuthorityDictionary.Add(CommonData.ButtonCategory.Export, exportAuthority); this.AuthorityDictionary.Add(CommonData.ButtonCategory.Print, printAuthority); this.AuthorityDictionary.Add(CommonData.ButtonCategory.Import, importAuthority); } }
void dtpDate_EditValueChanged(object sender, EventArgs e) { IvsDateEdit dtpDate = (IvsDateEdit)sender; if (CommonMethod.ParseDate(dtpDate.EditValue) > CommonBl.GetSystemDate()) { dtpDate.EditValue = CommonBl.GetSystemDate(); } }
/// <summary> /// Initalize controls /// </summary> public override void InitControl() { base.InitControl(); #region Events this.cboDepartment.EditValueChanged += new EventHandler(cboDepartment_EditValueChanged); this.dtpTransferDate.Properties.MaxValue = CommonBl.GetSystemDate(); #endregion }
protected override void FillData() { if (this.CheckAuthorization) { DataTable dtResult = new System.Data.DataTable(); CommonBl commonBl = new CommonBl(); commonBl.SelectWarehouseByUser(UserSession.UserCode, out dtResult); if (dtResult.Columns.Count > 0) { if (this.HasNull) { DataRow newRow = dtResult.NewRow(); //newRow[CommonKey.Code] = CommonData.StringEmpty; //newRow[CommonKey.Name1] = "Tất cả"; //newRow[CommonKey.Name2] = "All"; //newRow[CommonKey.Name3] = "All"; //newRow[CommonKey.Name] = UserSession.LangId.Equals(CommonData.Language.English) // ? "All" // : UserSession.LangId.Equals(CommonData.Language.VietNamese) // ? "Tất cả" // : "All"; dtResult.Rows.InsertAt(newRow, 0); } } this.Properties.DataSource = dtResult; this.Properties.NullText = CommonData.StringEmpty; } else { DataTable dtResult = new DataTable(); CommonBl commonBl = new CommonBl(); MS_WarehouseDTO dto = new MS_WarehouseDTO() { Status = this.Status, }; commonBl.SelectWarehouseData(dto, out dtResult); if (dtResult.Columns.Count > 0) { if (this.HasNull) { DataRow newRow = dtResult.NewRow(); //newRow[0] = CommonData.StringEmpty; dtResult.Rows.InsertAt(newRow, 0); } } this.Properties.DataSource = dtResult; this.Properties.NullText = CommonData.StringEmpty; //base.FillData(); } }
public object SelectWarehousesByGroup(IDto selectDto) { #region Format outputed Datatable DataTable dtResult = new DataTable(); dtResult.Columns.Add("Code"); dtResult.Columns.Add("Name"); dtResult.Columns.Add("All", typeof(bool)); #endregion //Get all data from sy_function table (FunctionID, FunctionName) DataTable dtWHs = new DataTable(); CommonBl commonBl = new CommonBl(); int returnCode = commonBl.SelectWarehouses(out dtWHs); //Select warehouse assign data DataTable dtWHsAssign = new DataTable(); MS_WarehouseAssignDao warehouseAssignDao = new MS_WarehouseAssignDao(); SYS_UserGroupsDto dto = (SYS_UserGroupsDto)selectDto; warehouseAssignDao.SelectDataByGroupCode(dto.Code, out dtWHsAssign); ////Select function mapping data //DataTable dtWHsMapping = new DataTable(); //MS_WarehouseMappingDao whMappingDao = new MS_WarehouseMappingDao(); //whMappingDao.SelectMappingInfo(CommonData.StringEmpty, CommonData.StringEmpty, out dtWHsMapping); ////Select permission assign data //DataTable dtPermissionsAssign = new DataTable(); //SYS_PermissionAssignDao permissionsAssignDao = new SYS_PermissionAssignDao(); //SYS_UserGroupsDto dto = (SYS_UserGroupsDto)selectDto; //permissionsAssignDao.SelectDataByGroupCode(dto.Code, out dtPermissionsAssign); //Select function mapping data //DataTable dtFunctionsMapping = new DataTable(); //SYS_FunctionMappingDao functionMappingDao = new SYS_FunctionMappingDao(); //functionMappingDao.SelectMappingInfo(CommonData.StringEmpty, CommonData.StringEmpty, out dtFunctionsMapping); foreach (DataRow whRow in dtWHs.Rows) { DataRow dr = dtResult.NewRow(); dr["Code"] = whRow["Code"]; dr["Name"] = whRow["Name"]; dr["All"] = false; //Check assign warehouse on group DataRow[] whAssignRows = dtWHsAssign.Select("WarehouseCode = '" + whRow["Code"].ParseStrQuery() + "'"); if (whAssignRows.Length > 0) { dr["All"] = true; } dtResult.Rows.Add(dr); } return(dtResult); }
/// <summary> /// Initalize controls /// </summary> public override void InitControl() { base.InitControl(); #region Events this.cboDepartment.EditValueChanged += new EventHandler(cboDepartment_EditValueChanged); //this.rdoShipping.CheckedChanged += new EventHandler(rdoShipping_CheckedChanged); this.dtpDocumentDate.Properties.MaxValue = CommonBl.GetSystemDate(); #endregion }
protected override void InitControl() { base.InitControl(); this.bar2.Visible = false; this.bar3.Visible = false; this.btnOK.Click += new EventHandler(btnOK_Click); this.btnCancel.Click += new EventHandler(btnCancel_Click); this.dtpDate.EditValue = CommonBl.GetSystemDate(); this.txtReason.Focus(); }
/// <summary> /// Get data from database and assign to datasource of LookUp /// </summary> private void FillData() { //System.Data.DataTable dtResult = new System.Data.DataTable(); System.Data.DataTable dtResult = new System.Data.DataTable(); CommonBl commonBl = new CommonBl(); //get data list by Code commonBl.SelectDataForControl(this._code, out dtResult); this.DataSource = dtResult; }
/// <summary> /// Check authorization for warehouse /// </summary> protected CommonData.IsAuthority IsWarehouseAuthority(string warehouseCode, string operId) { CommonData.IsAuthority returnCode; CommonBl commonBl = new CommonBl(); returnCode = commonBl.CheckAuthority(CommonData.FunctionGr.ST_StockOverview, CommonData.OperId.All, warehouseCode); if (returnCode == CommonData.IsAuthority.Deny) { returnCode = commonBl.CheckAuthority(CommonData.FunctionGr.ST_StockOverview, operId, warehouseCode); } return(returnCode); }
/// <summary> /// Set authority for screen /// </summary> protected virtual CommonData.IsAuthority IsAuthority(string functionGr, string operId) { CommonData.IsAuthority returnCode = CommonData.IsAuthority.Allow; CommonBl commonBl = new CommonBl(); returnCode = commonBl.CheckAuthority(functionGr, CommonData.OperId.All); if (returnCode == CommonData.IsAuthority.Deny) { returnCode = commonBl.CheckAuthority(functionGr, operId); } return(returnCode); }
/// <summary> /// Initalize controls /// </summary> public override void InitControl() { base.InitControl(); #region Events this.cboDepartment.EditValueChanged += new EventHandler(cboDepartment_EditValueChanged); this.cboSupplier.EditValueChanged += new EventHandler(cboSupplier_EditValueChanged); this.cboQualityStatus.EditValueChanged += new EventHandler(cboQualityStatus_EditValueChanged); this.dtpShippingDate.Properties.MaxValue = CommonBl.GetSystemDate(); #endregion Events }
/// <summary> /// Initalize controls /// </summary> public override void InitControl() { base.InitControl(); #region Events this.cboDepartment.EditValueChanged += new EventHandler(cboDepartment_EditValueChanged); btnAddItem.Click += new EventHandler(AddItem); this.dtpDocumentDate.Properties.MaxValue = CommonBl.GetSystemDate(); this.SetControl(); #endregion ProcessType = CommonData.ProcessType.RM; }
protected override void FillData() { DataTable dtResult = new DataTable(); CommonBl commonBl = new CommonBl(); commonBl.SelectDocumentByWarehouse(out dtResult, TransactionType, TransactionSubCode, Warehouse); if (dtResult.Columns.Count > 0) { if (this.HasNull) { dtResult.Rows.InsertAt(dtResult.NewRow(), 0); } } this.Properties.DataSource = dtResult; }
protected override void FillData() { if (this.CheckAuthorization) { DataTable dtResult = new System.Data.DataTable(); CommonBl commonBl = new CommonBl(); commonBl.SelectWarehouseByUser(UserSession.UserCode, out dtResult); if (dtResult.Columns.Count > 0) { if (this.HasNull) { DataRow newRow = dtResult.NewRow(); dtResult.Rows.InsertAt(newRow, 0); } } this.Properties.DataSource = dtResult; this.Properties.NullText = CommonData.StringEmpty; } else { DataTable dtResult = new DataTable(); CommonBl commonBl = new CommonBl(); MS_WarehouseDTO dto = new MS_WarehouseDTO() { Status = this.Status, }; commonBl.SelectWarehouseData(dto, out dtResult); if (dtResult.Columns.Count > 0) { if (this.HasNull) { DataRow newRow = dtResult.NewRow(); //newRow[0] = CommonData.StringEmpty; dtResult.Rows.InsertAt(newRow, 0); } } this.Properties.DataSource = dtResult; this.Properties.NullText = CommonData.StringEmpty; //base.FillData(); } }
public override void InitControl() { base.InitControl(); SetControl(); #region Events cboQualityStatus.EditValueChanged += new EventHandler(cboQualityStatus_EditValueChanged); cboDocumentNo.EditValueChanged += new EventHandler(cboDocumentNo_EditValueChanged); btnSearch.Click += new EventHandler(cboDocumentNo_EditValueChanged); this.dtpShippingDate.Properties.MaxValue = CommonBl.GetSystemDate(); this.dtpArrivingDate.Properties.MaxValue = CommonBl.GetSystemDate(); #endregion Events }
protected override void FillData() { DataTable dtResult = new System.Data.DataTable(); CommonBl commonBl = new CommonBl(); commonBl.SelectDataForControl(CommonData.FunctionGr.MS_ProductionLines, out dtResult); if (dtResult.Columns.Count > 0) { if (this.ShowFG) { DataRow newRow = dtResult.NewRow(); newRow[CommonKey.Code] = CommonData.FG_RMCode; newRow[CommonKey.Name1] = "Thành Phẩm/Nguyên Liệu"; newRow[CommonKey.Name2] = "FG/RM"; newRow[CommonKey.Name3] = "FG/RM"; //newRow[0] = CommonData.StringEmpty; dtResult.Rows.InsertAt(newRow, 0); } if (this.ShowBlank) { DataRow newRow = dtResult.NewRow(); newRow[CommonKey.Code] = Ivs.Core.Common.CommonData.ProductionLineBlank.Code; newRow[CommonKey.Name1] = Ivs.Core.Common.CommonData.ProductionLineBlank.Name1; newRow[CommonKey.Name2] = Ivs.Core.Common.CommonData.ProductionLineBlank.Name2; newRow[CommonKey.Name3] = Ivs.Core.Common.CommonData.ProductionLineBlank.Name3; //newRow[0] = CommonData.StringEmpty; dtResult.Rows.InsertAt(newRow, 0); } if (this.HasNull) { DataRow newRow = dtResult.NewRow(); //newRow[0] = CommonData.StringEmpty; dtResult.Rows.InsertAt(newRow, 0); } } this.Properties.DataSource = dtResult; this.EditValue = CommonData.StringEmpty; this.Properties.NullText = CommonData.StringEmpty; }
/// <summary> /// Get data from database and assign to datasource of LookUp /// </summary> protected virtual void FillData() { DataTable dtResult = new System.Data.DataTable(); CommonBl commonBl = new CommonBl(); commonBl.SelectDataForControl(this._code, out dtResult); if (this.HasNull && dtResult.Columns.Count > 0) { DataRow newRow = dtResult.NewRow(); //newRow[0] = CommonData.StringEmpty; dtResult.Rows.InsertAt(newRow, 0); } this.Properties.DataSource = dtResult; this.EditValue = CommonData.StringEmpty; this.Properties.NullText = CommonData.StringEmpty; }
/// <summary> /// Get data from database and assign to datasource of LookUp /// </summary> public SelectList FillData() { List <IModel> lstResult = new List <IModel>(); if (!CommonMethod.IsNullOrEmpty(this.Code)) { CommonBl commonBl = new CommonBl(); commonBl.SelectCommonData(this.Code, out lstResult); } if (this.HasNull && lstResult != null) { lstResult.Insert(0, default(IModel)); } this.DataSource = lstResult; this.SetLanguage(); return(new SelectList(this.DataSource, this.ValueMember, this.DisplayMember, this.SelectedValue)); }
protected override void FillData() { if (CommonMethod.IsNullOrEmpty(this.ItemType) && CommonMethod.IsNullOrEmpty(this.DocumentNo)) { base.FillData(); } else { CommonBl commonBl = new CommonBl(); if (!CommonMethod.IsNullOrEmpty(this.ItemType)) { MS_ItemDto itemDto = new MS_ItemDto() { ItemType = this.ItemType, }; commonBl.SelectItemData(itemDto, out dtNewSource); } if (!CommonMethod.IsNullOrEmpty(this.DocumentNo)) { ST_StockTransactionDetailDto stockDetailDto = new ST_StockTransactionDetailDto() { DocumentNumber = this.DocumentNo, }; commonBl.SelectItemDataByDocument(stockDetailDto, out dtNewSource); } if (dtNewSource.Columns.Count > 0) { if (this.HasNull) { dtNewSource.Rows.InsertAt(dtNewSource.NewRow(), 0); } } this.DataSource = dtNewSource; // this.EditValue = CommonData.StringEmpty; this.NullText = CommonData.StringEmpty; } }