/// <summary> /// Insert invoice bucket discount /// </summary> /// <param name="bucketInvoiceModel"></param> /// <returns></returns> public int InsertFinoInvoiceBucketDiscountDet(BucketInvoiceModel bucketInvoiceModel) { int result = 0; string InvoiceIdStr = bucketInvoiceModel.InvoiceIDStr.TrimEnd(','); DateTime PaymentDate = Convert.ToDateTime(bucketInvoiceModel.ValidToDate.TrimEnd(',')); try { IFormatProvider culture = new CultureInfo("en-US", true); RepositoryService <BucketInvoiceModel> objBucketInvoiceModel = new RepositoryService <BucketInvoiceModel>(_vContext); ICollection <SqlParameter> parameters = new List <SqlParameter>(); parameters.Add(SQLHelper.SqlInputParam("@BucketId", bucketInvoiceModel.BucketID == null ? 0 : bucketInvoiceModel.BucketID, System.Data.SqlDbType.BigInt)); parameters.Add(SQLHelper.SqlInputParam("@BucketName", bucketInvoiceModel.BucketName, System.Data.SqlDbType.VarChar)); parameters.Add(SQLHelper.SqlInputParam("@BucketStatus", bucketInvoiceModel.BucketStatus == null ? 4 : bucketInvoiceModel.BucketStatus, System.Data.SqlDbType.Int)); parameters.Add(SQLHelper.SqlInputParam("@Discount", bucketInvoiceModel.DiscountPercentage, System.Data.SqlDbType.Decimal)); parameters.Add(SQLHelper.SqlInputParam("@UserId", bucketInvoiceModel.UserId, System.Data.SqlDbType.BigInt)); parameters.Add(SQLHelper.SqlInputParam("@ValidToDate", PaymentDate, System.Data.SqlDbType.VarChar)); parameters.Add(SQLHelper.SqlInputParam("@InvoiceIdString", InvoiceIdStr, System.Data.SqlDbType.VarChar)); result = objBucketInvoiceModel.ExecuteSqlCommand("Proc_InsertFinoInvoiceBucketDet @BucketId,@BucketName, @BucketStatus, @Discount, @UserId, @ValidToDate,@InvoiceIdString", parameters.ToArray()); } catch (Exception ex) { throw ex; } return(result); }
public int SendNotification(BucketInvoiceModel bucketInvoiceModel, Int32?UserId, Int32?VendorId) { int result = 0; string InvoiceIdStr = bucketInvoiceModel.InvoiceIDStr.TrimEnd(','); try { RepositoryService <BucketInvoiceModel> objBucketInvoiceModel = new RepositoryService <BucketInvoiceModel>(_vContext); ICollection <SqlParameter> parameters = new List <SqlParameter>(); parameters.Add(SQLHelper.SqlInputParam("@RoleID", 1, System.Data.SqlDbType.BigInt)); parameters.Add(SQLHelper.SqlInputParam("@UserID", UserId, System.Data.SqlDbType.BigInt)); parameters.Add(SQLHelper.SqlInputParam("@VendorID", VendorId, System.Data.SqlDbType.BigInt)); parameters.Add(SQLHelper.SqlInputParam("@InvoiceIdString", InvoiceIdStr, System.Data.SqlDbType.VarChar)); parameters.Add(SQLHelper.SqlInputParam("@Discount", bucketInvoiceModel.DiscountPercentage, System.Data.SqlDbType.Decimal)); result = objBucketInvoiceModel.ExecuteSqlCommand("Proc_InsertAnchorNotify @RoleID,@UserID,@VendorID,@InvoiceIdString,@Discount", parameters.ToArray()); } catch (Exception ex) { throw ex; } return(result); }