public static async Task <ReturnedSaveFuncInfo> BargashtAsync(ReceptionCheckBussines cls) { var res = new ReturnedSaveFuncInfo(); try { cls.CheckStatus = EnCheckM.Bargashti; cls.Modified = DateTime.Now; res.AddReturnedValue(await cls.SaveAsync()); var reception = await ReceptionBussines.GetAsync(cls.MasterGuid.Value); var pardazande = await TafsilBussines.GetAsync(reception.TafsilGuid); var sanad = new SanadBussines() { Guid = Guid.NewGuid(), Modified = DateTime.Now, Description = $"برگشت زدن چک دریافتنی * شناره: {cls.CheckNumber} بانک صادرکننده: {cls.BankName} * پردازنده: {pardazande.Name}", DateM = DateTime.Now, Number = await SanadBussines.NextNumberAsync(), SanadStatus = EnSanadStatus.Temporary, SanadType = EnSanadType.Auto, UserGuid = UserBussines.CurrentUser.Guid }; //بستانکار--اسناد sanad.AddToListSanad(new SanadDetailBussines() { Guid = Guid.NewGuid(), Modified = DateTime.Now, Description = $"برگشت زدن چک {cls.CheckNumber} {cls.BankName} * پردازنده: {pardazande.Name}", Debit = 0, Credit = cls.Price, TafsilGuid = cls.SandouqTafsilGuid, MasterGuid = sanad.Guid, MoeinGuid = cls.SandouqMoeinGuid }); //بدهکار--شخص sanad.AddToListSanad(new SanadDetailBussines() { Guid = Guid.NewGuid(), Modified = DateTime.Now, Description = $"برگشت زدن چک {cls.CheckNumber} {cls.BankName} * پردازنده: {pardazande.Name}", Debit = cls.Price, Credit = 0, TafsilGuid = pardazande.Guid, MasterGuid = sanad.Guid, MoeinGuid = ParentDefaults.MoeinCoding.CLSMoein10304 }); res.AddReturnedValue(await sanad.SaveAsync()); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); res.AddReturnedValue(ex); } return(res); }
private static async Task <ReturnedSaveFuncInfo> NaqdBargashtAsync(PardakhtCheckShakhsiBussines cls, SanadBussines sanad) { var res = new ReturnedSaveFuncInfo(); try { var checkPage = await CheckPageBussines.GetAsync(cls.CheckPageGuid); var dasteCheck = await DasteCheckBussines.GetAsync(checkPage.CheckGuid); var bank = await TafsilBussines.GetAsync(dasteCheck.BankGuid); var pardakht = await PardakhtBussines.GetAsync(cls.MasterGuid); var girande = await TafsilBussines.GetAsync(pardakht.TafsilGuid); //بستانکار--اسناد sanad.AddToListSanad(new SanadDetailBussines() { Guid = Guid.NewGuid(), Modified = DateTime.Now, Description = $"استرداد چک پرداختنی * شماره: {checkPage.Number} بانک صادرکننده: {bank.Name} * گیرنده: {girande.Name}", Debit = 0, Credit = cls.Price, TafsilGuid = bank.Guid, MasterGuid = sanad.Guid, MoeinGuid = ParentDefaults.MoeinCoding.CLSMoein30101 }); //بدهکار--شخص sanad.AddToListSanad(new SanadDetailBussines() { Guid = Guid.NewGuid(), Modified = DateTime.Now, Description = $"استرداد چک پرداختنی * شماره: {checkPage.Number} بانک صادرکننده: {bank.Name} * گیرنده: {girande.Name}", Debit = cls.Price, Credit = 0, TafsilGuid = pardakht.TafsilGuid, MasterGuid = sanad.Guid, MoeinGuid = pardakht.MoeinGuid }); res.AddReturnedValue(await sanad.SaveAsync()); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); res.AddReturnedValue(ex); } return(res); }
private void btnSaveArticle_Click(object sender, EventArgs e) { var res = new ReturnedSaveFuncInfo(); try { mnuDelete.PerformClick(); res.AddReturnedValue(cls.AddToListSanad(GenerateDet())); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); res.AddReturnedValue(ex); } finally { if (res.HasError) { this.ShowError(res, "خطا در ثبت اقلام سند"); } else { ClearArticle(); FillDetails(); SetLables(); } } }
private static async Task <ReturnedSaveFuncInfo> NaqdBargashtAvalDoreAsync(ReceptionCheckAvalDoreBussines cls, SanadBussines sanad) { var res = new ReturnedSaveFuncInfo(); try { cls.CheckStatus = EnCheckM.Bargashti; cls.Modified = DateTime.Now; res.AddReturnedValue(await cls.SaveAsync(false)); var pardazande = await TafsilBussines.GetAsync(cls.TafsilGuid); //بستانکار--شخص sanad.AddToListSanad(new SanadDetailBussines() { Guid = Guid.NewGuid(), Modified = DateTime.Now, Description = $"استرداد چک {cls.CheckNumber} {cls.BankName} * پردازنده: {pardazande.Name}", Debit = 0, Credit = cls.Price, TafsilGuid = pardazande.Guid, MasterGuid = sanad.Guid, MoeinGuid = ParentDefaults.MoeinCoding.CLSMoein10304 }); //بدهکار--اسناد sanad.AddToListSanad(new SanadDetailBussines() { Guid = Guid.NewGuid(), Modified = DateTime.Now, Description = $"استرداد چک {cls.CheckNumber} {cls.BankName} * پردازنده: {pardazande.Name}", Debit = cls.Price, Credit = 0, TafsilGuid = cls.SandouqTafsilGuid, MasterGuid = sanad.Guid, MoeinGuid = cls.SandouqMoeinGuid }); res.AddReturnedValue(await sanad.SaveAsync()); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); res.AddReturnedValue(ex); } return(res); }
public static async Task <ReturnedSaveFuncInfo> NaqdAvalDoreAsync(PardakhtCheckAvalDoreBussines cls) { var res = new ReturnedSaveFuncInfo(); try { var checkPage = await CheckPageBussines.GetAsync(cls.CheckPageGuid); var dasteCheck = await DasteCheckBussines.GetAsync(checkPage.CheckGuid); var bank = await TafsilBussines.GetAsync(dasteCheck.BankGuid); var girande = await TafsilBussines.GetAsync(cls.TafsilGuid); var sanad = new SanadBussines() { Guid = Guid.NewGuid(), Modified = DateTime.Now, Description = $"نقد کردن چک پرداختنی * شماره: {checkPage.Number} بانک صادر کننده: {bank.Name} * گیرنده: {girande.Name}", DateM = DateTime.Now, Number = await SanadBussines.NextNumberAsync(), SanadStatus = EnSanadStatus.Temporary, SanadType = EnSanadType.Auto, UserGuid = UserBussines.CurrentUser.Guid }; if (checkPage.CheckStatus == EnCheckSh.Bargashti) { res.AddReturnedValue(await NaqdBargashtAvalDoreAsync(cls, sanad)); if (res.HasError) { return(res); } } //بستانکار--موجودی sanad.AddToListSanad(new SanadDetailBussines() { Guid = Guid.NewGuid(), Modified = DateTime.Now, Description = $"نقد کردن چک {checkPage.Number} {bank.Name} * گیرنده: {girande.Name}", Debit = 0, Credit = cls.Price, TafsilGuid = bank.Guid, MasterGuid = sanad.Guid, MoeinGuid = ParentDefaults.MoeinCoding.CLSMoein10101 }); //بدهکار--اسناد sanad.AddToListSanad(new SanadDetailBussines() { Guid = Guid.NewGuid(), Modified = DateTime.Now, Description = $"نقد کردن چک {checkPage.Number} {bank.Name} * گیرنده: {girande.Name}", Debit = cls.Price, Credit = 0, TafsilGuid = bank.Guid, MasterGuid = sanad.Guid, MoeinGuid = ParentDefaults.MoeinCoding.CLSMoein30101 }); res.AddReturnedValue(await sanad.SaveAsync()); checkPage.CheckStatus = EnCheckSh.Pass; checkPage.Modified = DateTime.Now; res.AddReturnedValue(await checkPage.SaveAsync()); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); res.AddReturnedValue(ex); } return(res); }
public static async Task <ReturnedSaveFuncInfo> NaqdAvalDoreAsync(ReceptionCheckAvalDoreBussines cls) { var res = new ReturnedSaveFuncInfo(); try { var tafsil = await TafsilBussines.GetAsync(cls.SandouqTafsilGuid); var moeinGuid = tafsil.HesabType == HesabType.Bank ? ParentDefaults.MoeinCoding.CLSMoein10101 : ParentDefaults.MoeinCoding.CLSMoein10102; var pardazande = await TafsilBussines.GetAsync(cls.TafsilGuid); var sanad = new SanadBussines() { Guid = Guid.NewGuid(), Modified = DateTime.Now, Description = $"نقد کردن چک دریافتنی * شماره: {cls.CheckNumber} بانک صادرکننده: {cls.BankName} * پردازنده: {pardazande.Name}", DateM = DateTime.Now, Number = await SanadBussines.NextNumberAsync(), SanadStatus = EnSanadStatus.Temporary, SanadType = EnSanadType.Auto, UserGuid = UserBussines.CurrentUser.Guid }; if (cls.CheckStatus == EnCheckM.Bargashti) { res.AddReturnedValue(await NaqdBargashtAvalDoreAsync(cls, sanad)); if (res.HasError) { return(res); } } //بستانکار--اسناد sanad.AddToListSanad(new SanadDetailBussines() { Guid = Guid.NewGuid(), Modified = DateTime.Now, Description = $"نقد کردن چک {cls.CheckNumber} {cls.BankName} * پردازنده: {pardazande.Name}", Debit = 0, Credit = cls.Price, TafsilGuid = cls.SandouqTafsilGuid, MasterGuid = sanad.Guid, MoeinGuid = cls.SandouqMoeinGuid }); //بدهکار--موجودی sanad.AddToListSanad(new SanadDetailBussines() { Guid = Guid.NewGuid(), Modified = DateTime.Now, Description = $"نقد کردن چک {cls.CheckNumber} {cls.BankName} * پردازنده: {pardazande.Name}", Debit = cls.Price, Credit = 0, TafsilGuid = tafsil.Guid, MasterGuid = sanad.Guid, MoeinGuid = moeinGuid }); res.AddReturnedValue(await sanad.SaveAsync()); cls.CheckStatus = EnCheckM.Naqd; cls.Modified = DateTime.Now; res.AddReturnedValue(await cls.SaveAsync(false)); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); res.AddReturnedValue(ex); } return(res); }
public static async Task <ReturnedSaveFuncInfo> VagozarBankAvalDore(ReceptionCheckAvalDoreBussines cls, TafsilBussines newBank) { var res = new ReturnedSaveFuncInfo(); try { var pardazande = await TafsilBussines.GetAsync(cls.TafsilGuid); var sanad = new SanadBussines() { Guid = Guid.NewGuid(), Modified = DateTime.Now, Description = $"واگذار کردن چک دریافتنی * شماره: {cls.CheckNumber} بانک صادرکننده: {cls.BankName} * پردازنده: {pardazande.Name}", DateM = DateTime.Now, Number = await SanadBussines.NextNumberAsync(), SanadStatus = EnSanadStatus.Temporary, SanadType = EnSanadType.Auto, UserGuid = UserBussines.CurrentUser.Guid }; //بستانکار--اسناد قبلی sanad.AddToListSanad(new SanadDetailBussines() { Guid = Guid.NewGuid(), Modified = DateTime.Now, Description = $"واگذار کردن چک {cls.CheckNumber} {cls.BankName} * پردازنده: {pardazande.Name}", Debit = 0, Credit = cls.Price, TafsilGuid = cls.SandouqTafsilGuid, MasterGuid = sanad.Guid, MoeinGuid = cls.SandouqMoeinGuid }); //بدهکار--اسناد جدید sanad.AddToListSanad(new SanadDetailBussines() { Guid = Guid.NewGuid(), Modified = DateTime.Now, Description = $"واگذار کردن چک {cls.CheckNumber} {cls.BankName} * پردازنده: {pardazande.Name}", Debit = cls.Price, Credit = 0, TafsilGuid = newBank.Guid, MasterGuid = sanad.Guid, MoeinGuid = ParentDefaults.MoeinCoding.CLSMoein10105 }); res.AddReturnedValue(await sanad.SaveAsync()); cls.CheckStatus = EnCheckM.Vagozar; cls.Modified = DateTime.Now; cls.SandouqTafsilGuid = newBank.Guid; cls.SandouqMoeinGuid = ParentDefaults.MoeinCoding.CLSMoein10105; res.AddReturnedValue(await cls.SaveAsync(false)); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); res.AddReturnedValue(ex); } return(res); }