protected void CV_ServerValidate(object source, ServerValidateEventArgs args) { CustomValidator cv = (CustomValidator)source; switch (cv.ID) { case "cvBinCode": string binCode = args.Value.Trim(); if (TheStorageBinMgr.LoadStorageBin(binCode) != null) { ShowErrorMessage("MasterData.Location.Bin.IsExist", binCode); args.IsValid = false; } break; case "cvAreaCode": string areaCode = args.Value.Trim(); if (TheStorageAreaMgr.LoadStorageArea(areaCode) == null) { ShowErrorMessage("MasterData.Location.Area.IsNotExist", areaCode); args.IsValid = false; } break; default: break; } }
protected void lbtnEdit_Click(object sender, EventArgs e) { string code = ((LinkButton)sender).CommandArgument; StorageArea storageArea = TheStorageAreaMgr.LoadStorageArea(code); this.ucEdit.InitPageParameter(storageArea); this.ucEdit.Visible = true; this.divAreaList.Visible = false; this.EditEvent((object)code, e); }
protected void GV_Bin_RowUpdating(object sender, GridViewUpdateEventArgs e) { StorageBin storageBin = new StorageBin(); if (this.AreaCode != null && this.AreaCode != string.Empty) { storageBin.Area = TheStorageAreaMgr.LoadStorageArea(this.AreaCode); } storageBin.Code = ((Literal)this.GV_Bin.Rows[e.RowIndex].FindControl("ltlCode")).Text.Trim(); storageBin.Description = ((TextBox)this.GV_Bin.Rows[e.RowIndex].FindControl("tbDescription")).Text.Trim(); storageBin.IsActive = ((CheckBox)this.GV_Bin.Rows[e.RowIndex].FindControl("cbActive")).Checked; storageBin.IsIsolation = ((CheckBox)this.GV_Bin.Rows[e.RowIndex].FindControl("cbIsIsolation")).Checked; TheStorageBinMgr.UpdateStorageBin(storageBin); this.GV_Bin.EditIndex = -1; this.DoSearch(); ShowSuccessMessage("MasterData.Location.UpdataBin.Successfully", storageBin.Code); }
//新增库格 protected void ODS_StorageBin_Inserting(object source, ObjectDataSourceMethodEventArgs e) { StorageBin storageBin = (StorageBin)e.InputParameters[0]; string binCode = ((TextBox)(this.FV_StorageBin.FindControl("tbBinCode"))).Text.Trim(); string binDescription = ((TextBox)(this.FV_StorageBin.FindControl("tbBinDescription"))).Text.Trim(); string areaCode = ((Controls_TextBox)(this.FV_StorageBin.FindControl("tbAreaCode"))).Text; if (binCode == null || binCode == string.Empty) { ShowErrorMessage("MasterData.Location.Bin.Required.Code"); e.Cancel = true; return; } storageBin.Code = binCode; storageBin.Description = binDescription; storageBin.Area = TheStorageAreaMgr.LoadStorageArea(areaCode); ShowSuccessMessage("MasterData.Location.Bin.AddBin.Successfully", binCode); }