Exemplo n.º 1
0
        public async Task <ReturnedSaveFuncInfo> SaveAsync(ReceptionNaqdBussines item, SqlTransaction tr)
        {
            var res = new ReturnedSaveFuncInfo();

            try
            {
                var cmd = new SqlCommand("sp_ReceptionNaqd_Insert", tr.Connection, tr)
                {
                    CommandType = CommandType.StoredProcedure
                };
                cmd.Parameters.AddWithValue("@guid", item.Guid);
                cmd.Parameters.AddWithValue("@modif", item.Modified);
                cmd.Parameters.AddWithValue("@desc", item.Description ?? "");
                cmd.Parameters.AddWithValue("@dateM", item.DateM);
                cmd.Parameters.AddWithValue("@masterGuid", item.MasterGuid);
                cmd.Parameters.AddWithValue("@price", item.Price);
                cmd.Parameters.AddWithValue("@sandouqTafsilGuid", item.SandouqTafsilGuid);
                cmd.Parameters.AddWithValue("@sandouqMoeinGuid", ParentDefaults.MoeinCoding.CLSMoein10102);
                cmd.Parameters.AddWithValue("@serverSt", (short)item.ServerStatus);
                cmd.Parameters.AddWithValue("@serverDate", item.ServerDeliveryDate);

                await cmd.ExecuteNonQueryAsync();
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
                res.AddReturnedValue(ex);
            }

            return(res);
        }
Exemplo n.º 2
0
        private object GetRowInfo(int index)
        {
            try
            {
                var o = new object();
                if (index > DGrid.RowCount - 1)
                {
                    return(null);
                }

                if (DGrid[DGType.Index, index].Value.ToString() == "نقد")
                {
                    var temp = new ReceptionNaqdBussines()
                    {
                        Guid              = (Guid)(DGrid[DgGuid.Index, index].Value),
                        Price             = (DGrid[DGPrice.Index, index].Value.ToString().ParseToDecimal()),
                        SandouqTafsilGuid = (Guid)(DGrid[DGTafsilGuid.Index, index].Value),
                        DateM             = (DateTime)(DGrid[DGDate.Index, index].Value),
                        Description       = DGrid[DG_TempDescription.Index, index].Value.ToString()
                    };
                    o = temp;
                }
                else if (DGrid[DGType.Index, index].Value.ToString() == "چک")
                {
                    var temp = new ReceptionCheckBussines()
                    {
                        Guid              = (Guid)(DGrid[DgGuid.Index, index].Value),
                        Price             = (DGrid[DGPrice.Index, index].Value.ToString().ParseToDecimal()),
                        BankName          = DGrid[DGCheckBankName.Index, index].Value.ToString(),
                        DateM             = (DateTime)(DGrid[DGDate.Index, index].Value),
                        CheckNumber       = DGrid[DGNumber.Index, index].Value.ToString(),
                        CheckStatus       = (EnCheckM)(DGrid[DGCheckStatus.Index, index].Value),
                        PoshtNomre        = DGrid[DGPoshtNomre.Index, index].Value.ToString(),
                        Description       = DGrid[DG_TempDescription.Index, index].Value.ToString(),
                        SandouqTafsilGuid = (Guid)(DGrid[DGTafsilGuid.Index, index].Value),
                        DateSarResid      = (DateTime)(DGrid[DGDateSarresid.Index, index].Value)
                    };
                    o = temp;
                }
                else if (DGrid[DGType.Index, index].Value.ToString() == "حواله")
                {
                    var temp = new ReceptionHavaleBussines()
                    {
                        Guid           = (Guid)(DGrid[DgGuid.Index, index].Value),
                        Price          = (DGrid[DGPrice.Index, index].Value.ToString().ParseToDecimal()),
                        BankTafsilGuid = (Guid)(DGrid[DGTafsilGuid.Index, index].Value),
                        DateM          = (DateTime)(DGrid[DGDate.Index, index].Value),
                        PeygiriNumber  = DGrid[DGNumber.Index, index].Value.ToString(),
                        Description    = DGrid[DG_TempDescription.Index, index].Value.ToString(),
                    };
                    o = temp;
                }
                return(o);
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
                return(null);
            }
        }
        private ReceptionBussines LoadData(SqlDataReader dr)
        {
            var item = new ReceptionBussines();

            try
            {
                item.Guid               = (Guid)dr["Guid"];
                item.Modified           = (DateTime)dr["Modified"];
                item.DateM              = (DateTime)dr["DateM"];
                item.Description        = dr["Description"].ToString();
                item.Number             = (long)dr["Number"];
                item.TafsilGuid         = (Guid)dr["TafsilGuid"];
                item.MoeinGuid          = (Guid)dr["MoeinGuid"];
                item.UserGuid           = (Guid)dr["UserGuid"];
                item.SanadNumber        = (long)dr["SanadNumber"];
                item.TafsilName         = dr["TafsilName"].ToString();
                item.UserName           = dr["UserName"].ToString();
                item.ServerDeliveryDate = (DateTime)dr["ServerDeliveryDate"];
                item.ServerStatus       = (ServerStatus)dr["ServerStatus"];
                item.IsModified         = true;
                item.CheckList          = AsyncContext.Run(() => ReceptionCheckBussines.GetAllAsync(item.Guid));
                item.HavaleList         = AsyncContext.Run(() => ReceptionHavaleBussines.GetAllAsync(item.Guid));
                item.NaqdList           = AsyncContext.Run(() => ReceptionNaqdBussines.GetAllAsync(item.Guid));
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
            }

            return(item);
        }
Exemplo n.º 4
0
        private ReceptionNaqdBussines LoadData(SqlDataReader dr)
        {
            var item = new ReceptionNaqdBussines();

            try
            {
                item.Guid               = (Guid)dr["Guid"];
                item.Modified           = (DateTime)dr["Modified"];
                item.DateM              = (DateTime)dr["DateM"];
                item.MasterGuid         = (Guid)dr["MasterGuid"];
                item.Description        = dr["Description"].ToString();
                item.Price              = (decimal)dr["Price"];
                item.SandouqTafsilGuid  = (Guid)dr["SandouqTafsilGuid"];
                item.SandouqMoeinGuid   = (Guid)dr["SandouqMoeinGuid"];
                item.ServerDeliveryDate = (DateTime)dr["ServerDeliveryDate"];
                item.ServerStatus       = (ServerStatus)dr["ServerStatus"];
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
            }

            return(item);
        }
Exemplo n.º 5
0
 public frmReceptionNaqd(ReceptionNaqdBussines temp)
 {
     InitializeComponent();
     cls           = temp ?? new ReceptionNaqdBussines();
     ucHeader.Text = "دریافت نقدی";
 }