private void reloadData() { Common.BLL.Entity.GasStation.Owner model = new Common.BLL.Entity.GasStation.Owner() { nationalCode = nationalCodeMaskedTextBox.Text.Trim() }; Common.BLL.Logic.GasStation.Owner lOwner = new Common.BLL.Logic.GasStation.Owner(Common.Enum.EDatabase.GasStation); CommandResult opResult = lOwner.read(model, "nationalCode"); if (opResult.status == BaseDAL.Base.EnumCommandStatus.success) { searchGrid.DataSource = opResult.model; searchGrid.loadHeader("CustomerViewForm_Search"); } }
private void reloadOwnerByNationalcode(string natioanlcode) { Common.BLL.Entity.GasStation.Owner model = new Common.BLL.Entity.GasStation.Owner() { nationalCode = natioanlcode }; Common.BLL.Logic.GasStation.Owner lOwner = new Common.BLL.Logic.GasStation.Owner(Common.Enum.EDatabase.GasStation); CommandResult opResult = lOwner.read(model, "nationalCode"); if (opResult.status == BaseDAL.Base.EnumCommandStatus.success) { UserControls.OwnerUserControl owner = new UserControls.OwnerUserControl(opResult.model); ownerTabPage.Controls.Add(owner); } }
/// <summary> /// Prepare /// </summary> private void prepare() { model = new Common.BLL.Entity.GasStation.Owner() { nationalCode = nationalcode }; Common.BLL.Logic.GasStation.Owner lOwner = new Common.BLL.Logic.GasStation.Owner(Common.Enum.EDatabase.GasStation); CommandResult opResult = lOwner.read(model, "nationalCode"); if (opResult.status == BaseDAL.Base.EnumCommandStatus.success) { // Fill Controls BaseBLL.General.FormModelHelper <Common.BLL.Entity.GasStation.Owner> .fillControl(ownerDataGroupBox, model); birthdateLabel.Text = Convert.ToDateTime(model.birthdate).ToString("yyyy/MM/dd"); } }
private bool deleteOwner(int ownerId) { bool result = false; Common.BLL.Entity.GasStation.Owner model = new Common.BLL.Entity.GasStation.Owner() { id = ownerId }; Common.BLL.Logic.GasStation.Owner lOwner = new Common.BLL.Logic.GasStation.Owner(Common.Enum.EDatabase.GasStation); CommandResult opResult = lOwner.delete(model); if (opResult.status == BaseDAL.Base.EnumCommandStatus.success) { result = true; } return(result); }
/// <summary> /// save Data /// </summary> /// <param name="owner"></param> /// <param name="plate"></param> /// <param name="user"></param> /// <returns></returns> public CommandResult saveData(Common.BLL.Entity.GasStation.Owner owner, Common.BLL.Entity.GasStation.Plate plate, Common.BLL.Entity.GasStation.User user) //Common.BLL.Entity.GasStation.Car car, //Common.BLL.Entity.GasStation.LegalOwner legalOwner) { CommandResult result; if (null != owner && null != user) { result = BaseDAL.DBaseHelper.executeCommand(BaseDAL.Base.EnumExecuteType.procedureReader, connection, C_spSaveData, true, new KeyValuePair("@nationalCode", owner.nationalCode), new KeyValuePair("@name", owner.name), new KeyValuePair("@lastname", owner.lastname), new KeyValuePair("@birthdate", owner.birthdate), new KeyValuePair("@birthdatelocal", owner.birthdatelocal), new KeyValuePair("@gen", owner.gen), new KeyValuePair("@mobile", owner.mobile), new KeyValuePair("@address", owner.address), new KeyValuePair("@phone", owner.phone), new KeyValuePair("@plate", plate.plate), new KeyValuePair("@palteCityId", plate.plateCityId), new KeyValuePair("@palteTypeId", plate.plateTypeId), new KeyValuePair("@insertedById", user.id) ); } else { result = CommandResult.makeNullDataResult(); } return(result); }