Exemplo n.º 1
0
        public List <TyreSizeMaster> Bindtyresize()
        {
            using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
            {
                List <TyreSizeMaster> obj1 = new List <TyreSizeMaster>();

                obj1 = (from obj in db.TyreSizeMasters
                        orderby obj.TyreSize
                        select obj).ToList();

                return(obj1);
            }
        }
Exemplo n.º 2
0
        public List <tblItemMastPur> BindItemName()
        {
            using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
            {
                List <tblItemMastPur> objItemMast = new List <tblItemMastPur>();

                objItemMast = (from obj in db.tblItemMastPurs where obj.ItemType == 1 && obj.ItemType != null
                               orderby obj.Item_Name
                               select obj).ToList();

                return(objItemMast);
            }
        }
Exemplo n.º 3
0
 public Int64 CheckInvoiceDetails(Int64 GRHeadIdno)
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         Int64 InvoiceNo = 0;
         InvoiceNo = Convert.ToInt64((from a in db.TblGrHeads
                                      join b in db.tblInvGenDetls on a.GR_Idno equals b.GR_Idno
                                      join c in db.tblInvGenHeads on b.InvGenHead_Idno equals c.Inv_Idno
                                      where a.GR_Idno == GRHeadIdno && a.Chln_Idno > 0 && a.Billed == true
                                      select c.Inv_No).FirstOrDefault());
         return(InvoiceNo);
     }
 }
Exemplo n.º 4
0
 public IList CheckDuplicateGrNo(Int64 intGrNo, Int32 FromCityIdno, Int32 intYearIdno)
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         var lst = (from m in db.TblGrHeads
                    where m.Gr_No == intGrNo && m.Year_Idno == intYearIdno && m.GR_Frm == "BK" && m.From_City == FromCityIdno
                    select new
         {
             m.Gr_No,
         }).ToList();
         return(lst);
     }
 }
        public IList <tblFrmCityDetl> SelectFromCityIdno(int UserId)
        {
            using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
            {
                var lst = (from obj in db.tblFrmCityDetls
                           join CM in db.tblCityMasters on obj.FrmCity_Idno equals CM.City_Idno
                           where obj.User_Idno == UserId
                           select obj

                           ).ToList();
                return(lst);
            }
        }
Exemplo n.º 6
0
 public IList CheckItemExistInOtherMaster(string RcptGoodId)
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         return((from obj in db.TblGrHeads
                 where obj.AgnstRcpt_No == RcptGoodId
                 select new
         {
             GoodId = obj.AgnstRcpt_No
         }
                 ).ToList());
     }
 }
 public Int64 SelectTotal()
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         var lst = (from mast in db.tblGradeMasters
                    orderby mast.Grade_Name ascending
                    select new
         {
             mast
         }).Count();
         return(lst);
     }
 }
        public List <tblUserMast> Select()
        {
            using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
            {
                var lst = (from u in db.tblUserMasts
                           //where u.Status == true && u.DOJ != null && u.Admin_Idno == 0
                           where u.Status == true && u.DOJ != null && u.User_Idno == 0
                           orderby u.User_Name
                           select u).ToList();

                return(lst);
            }
        }
Exemplo n.º 9
0
 public IList CheckTyreExistInOtherMaster(Int32 tyreid)
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         return((from obj in db.tblItemMastPurs
                 where obj.Tyre_Type == tyreid
                 select new
         {
             tyrIDNO = obj.Item_Idno
         }
                 ).ToList());
     }
 }
Exemplo n.º 10
0
 public IList CheckItemExistInOtherMaster(Int32 MiscIdno)
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         return((from obj in db.tblGrRetailerHeads
                 where obj.Misc_Idno == MiscIdno
                 select new
         {
             MiscGrp = obj.Misc_Idno
         }
                 ).ToList());
     }
 }
Exemplo n.º 11
0
        //public List<LocAreaMast> SelectLocArea()
        //{
        //    using (TransportMandiEntities db = new TransportMandiEntities())
        //    {
        //        return (from LA in db.LocAreaMasts select LA).ToList();
        //    }
        //}

        public IList SelectLocation(Int32 intLocAreaIdno)
        {
            using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
            {
                return((from LM in db.tblLocMasts
                        where LM.Status == true
                        select new
                {
                    LM.Loc_Idno,
                    LM.Loc_Name
                }).ToList());
            }
        }
Exemplo n.º 12
0
 public IList SelectPartyName()
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         return((from LM in db.LorryMasts
                 join AM in db.AcntMasts on LM.Prty_Idno equals AM.Acnt_Idno
                 select new
         {
             AM.Acnt_Idno,
             AM.Acnt_Name
         }).OrderBy(a => a.Acnt_Idno).GroupBy(x => x.Acnt_Idno).Select(x => x.FirstOrDefault()).ToList());
     }
 }
Exemplo n.º 13
0
        /// <summary>
        /// Insert records in tblItemMastPur
        /// </summary>
        /// <param name="strUOMName"></param>
        /// <param name="strItemDesc"></param>
        /// <param name="bStatus"></param>
        /// <returns></returns>
        public Int64 Insert(string strItemName, string strItemNameHindi, string strItemDesc, Int64 GrpType, Int64 ItemUnit, Double PurRate, Double VATTaxPer, Double CSTTaxPer, bool bStatus, Int64 ItemType, Int64 TyreIdno, string Companyname, string ModelName, Int32 empIdno, double sgst, double cgst, double igst, double itemmrp)
        {
            Int64 intValue    = 0;
            Int32 intCompIdno = 1;

            try
            {
                using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
                {
                    tblItemMastPur objItemMast = new tblItemMastPur();
                    objItemMast.Item_Name       = strItemName;
                    objItemMast.ItemNamel_Hindi = strItemNameHindi;
                    objItemMast.Item_Desc       = strItemDesc;
                    objItemMast.Status          = bStatus;
                    objItemMast.IGrp_Idno       = GrpType;
                    objItemMast.Unit_Idno       = ItemUnit;
                    objItemMast.Pur_Rate        = PurRate;
                    objItemMast.VATTax_Per      = VATTaxPer;
                    objItemMast.CSTTax_Per      = CSTTaxPer;
                    objItemMast.Comp_Idno       = intCompIdno;
                    objItemMast.Emp_Idno        = empIdno;

                    objItemMast.ItemType   = ItemType;
                    objItemMast.Tyre_Type  = TyreIdno;
                    objItemMast.Comp_Name  = Companyname;
                    objItemMast.Model_Name = ModelName;

                    objItemMast.SGST     = sgst;
                    objItemMast.CGST     = cgst;
                    objItemMast.IGST     = igst;
                    objItemMast.Item_MRP = itemmrp;

                    objItemMast.Date_Added = System.DateTime.Now;
                    if (IsExists(strItemName, 0) == true)
                    {
                        intValue = -1;
                    }
                    else
                    {
                        db.tblItemMastPurs.AddObject(objItemMast);
                        db.SaveChanges();
                        intValue = objItemMast.Item_Idno;
                    }
                }
            }
            catch (Exception ex)
            {
                //ApplicationFunction.ErrorLog(ex.ToString());
            }
            return(intValue);
        }
Exemplo n.º 14
0
 public IList SelectForSearch(DateTime?DateFrom, DateTime?DateTo, string strSBillNo, Int64 intPrtyIdno, Int64 intFromLocation, Int64 intYearIdno)
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         var lst = (from SBH in db.tblSBillHeads
                    join SBD in db.tblSBillDetls on SBH.SBillHead_Idno equals SBD.SBillHead_Idno
                    join acnts in db.AcntMasts on SBH.Prty_Idno equals acnts.Acnt_Idno
                    join cifrom in db.tblCityMasters on SBH.FromLoc_Idno equals cifrom.City_Idno
                    join stck in db.Stckdetls on SBD.Item_Idno equals stck.SerlDetl_id
                    where (SBD.Claim_Idno == 0 || SBD.Claim_Idno == null)
                    select new
         {
             SbillHeadIdno = SBH.SBillHead_Idno,
             SerialNo = stck.SerialNo,
             SerialIdno = stck.SerlDetl_id,
             PrefNo = SBH.Prefix_No,
             SbillNo = SBH.SBill_No,
             SBillDate = SBH.SBillHead_Date,
             Location = SBH.FromLoc_Idno,
             CityName = cifrom.City_Name,
             PartyName = acnts.Acnt_Name,
             PartyIdno = acnts.Acnt_Idno,
             YearIdno = SBH.Year_Idno
         }).ToList();
         if (intYearIdno > 0)
         {
             lst = (from l in lst where l.YearIdno == intYearIdno select l).ToList();
         }
         if (intFromLocation > 0)
         {
             lst = (from l in lst where l.Location == intFromLocation select l).ToList();
         }
         if (DateFrom != null)
         {
             lst = lst.Where(l => Convert.ToDateTime(l.SBillDate).Date >= Convert.ToDateTime(DateFrom).Date).ToList();
         }
         if (DateTo != null)
         {
             lst = lst.Where(l => Convert.ToDateTime(l.SBillDate).Date <= Convert.ToDateTime(DateTo).Date).ToList();
         }
         if (intPrtyIdno > 0)
         {
             lst = (from l in lst where l.PartyIdno == intPrtyIdno select l).ToList();
         }
         if (strSBillNo != "")
         {
             lst = (from l in lst where ((l.PrefNo) + "" + (l.SbillNo)) == strSBillNo select l).ToList();
         }
         return(lst);
     }
 }
Exemplo n.º 15
0
        /// <summary>
        /// Insert records in VchrHead table
        /// </summary>
        public Int64 InsertInVchrHead(DateTime VchrDate, byte VchrType, Int64 VchrMode, string VchrNarr, bool VchrHidn, byte VchrSusp, string
                                      VchrFrm, Int64 AcntIdno, Int16 Printed, Int64 SbillNo, DateTime?SbillDate, Int64 VchrNo, double DcnNo, int YearIdno, int CompIdno, int UserIdno
                                      )
        {
            Int64    intValue    = 0;
            VchrHead objVchrHead = new VchrHead();

            objVchrHead.Vchr_Date  = VchrDate;
            objVchrHead.Vchr_Type  = VchrType;
            objVchrHead.Vchr_Mode  = VchrMode;
            objVchrHead.Vchr_Narr  = VchrNarr;
            objVchrHead.Vchr_Hidn  = VchrHidn;
            objVchrHead.Vchr_Susp  = VchrSusp;
            objVchrHead.Vchr_Frm   = VchrFrm;
            objVchrHead.Acnt_Idno  = AcntIdno;
            objVchrHead.Printed    = Printed;
            objVchrHead.Sbill_No   = 0;
            objVchrHead.Sbill_Date = null;
            if (VchrNo > 0)
            {
                objVchrHead.Vchr_No = VchrNo;
            }
            else
            {
                objVchrHead.Vchr_No = this.GetMaxVchrNo(VchrType, CompIdno, YearIdno);
            }
            objVchrHead.Dcn_No        = DcnNo;
            objVchrHead.Year_Idno     = YearIdno;
            objVchrHead.Comp_Idno     = CompIdno;
            objVchrHead.User_Idno     = UserIdno;
            objVchrHead.User_Type     = 0;
            objVchrHead.VchrFor_Idno  = 0;
            objVchrHead.VchrManual_No = "";
            objVchrHead.Date_Modified = SbillDate;
            objVchrHead.Date_Added    = VchrDate;// ApplicationFunction.GetIndianDateTime().Date;
            using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
            {
                try
                {
                    db.VchrHeads.AddObject(objVchrHead);
                    db.SaveChanges();
                    intValue = objVchrHead.Vchr_Idno;
                }
                catch (Exception ex)
                {
                    intValue = 0;
                    //  ApplicationFunction.ErrorLog(ex.ToString());
                }
            }
            return(intValue);
        }
Exemplo n.º 16
0
 public IList SelectTrip(int TripNo, DateTime?dtfrom, DateTime?dtto, int cityfrom, int sender, Int32 yearidno, Int64 LorryIdno)
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         //var lst = db.tblManualTripHeads.Where(x=> x.Trip_No == TripNo && x.Trip_Date >= dtfrom && x.Trip_Date <= dtto && x.BaseCity_Idno == cityfrom && x.Party_Idno == sender && x.Year_Idno == yearidno).ToList();
         var lst = (from mt in db.tblManualTripHeads
                    join am in db.AcntMasts on mt.Party_Idno equals am.Acnt_Idno
                    join cm in db.tblCityMasters on mt.BaseCity_Idno equals cm.City_Idno
                    join lm in db.LorryMasts on mt.Truck_Idno equals lm.Lorry_Idno
                    where mt.Trip_Date >= dtfrom &&
                    mt.Year_Idno == yearidno select new{
             mt.Party_Idno,
             mt.BaseCity_Idno,
             mt.Trip_Idno,
             mt.Trip_No,
             mt.Trip_Date,
             mt.TotalParty_Adv,
             mt.TotalParty_Bal,
             mt.TotalVeh_Amnt,
             mt.Driver_Name,
             mt.EndKms,
             mt.StartKms,
             mt.Freight_Amnt,
             mt.Gross_Weight,
             mt.Item_Name,
             mt.NetTrip_Profit,
             mt.Quantity,
             lm.Lorry_No,
             am.Acnt_Name,
             cm.City_Name,
             mt.Truck_Idno
         }).ToList();
         if (cityfrom != 0)
         {
             lst = lst.Where(x => x.BaseCity_Idno == cityfrom).ToList();
         }
         if (sender != 0)
         {
             lst = lst.Where(x => x.Party_Idno == sender).ToList();
         }
         if (TripNo != 0)
         {
             lst = lst.Where(x => x.Trip_No == TripNo).ToList();
         }
         if (LorryIdno != 0)
         {
             lst = lst.Where(x => x.Truck_Idno == LorryIdno).ToList();
         }
         return(lst);
     }
 }
 public IList CheckCategoryExistInLedgerMaster(Int32 categoryId)
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         return((from obj in db.AcntMasts
                 where obj.Category_Idno == categoryId
                 select new
         {
             obj.Category_Idno
         }
                 ).ToList()
                );
     }
 }
Exemplo n.º 18
0
        public List <AcntMast> BindBank()
        {
            using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
            {
                List <AcntMast> objacntmast = new List <AcntMast>();

                objacntmast = (from obj in db.AcntMasts
                               where obj.Acnt_Type == 4
                               orderby obj.Acnt_Name
                               select obj).ToList();

                return(objacntmast);
            }
        }
Exemplo n.º 19
0
        public double FetchLedgerOpCl(string ConString, string Action, int opentype, string acnt_idno, int yearid)
        {
            using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
            {
                SqlParameter[] objSqlPara = new SqlParameter[4];
                objSqlPara[0] = new SqlParameter("@Action", Action);
                objSqlPara[1] = new SqlParameter("@OpenType", opentype);
                objSqlPara[2] = new SqlParameter("@AcntIdno", acnt_idno);
                objSqlPara[3] = new SqlParameter("@YearIdno", yearid);
                var Temp = SqlHelper.ExecuteScalar(ConString, CommandType.StoredProcedure, "spAcntOpen", objSqlPara);

                return(Convert.ToDouble(Temp));
            }
        }
Exemplo n.º 20
0
        public double FetchLedgerBal(string ConString, string Action, int amnttype, string acnt_idno, int yearid)
        {
            using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
            {
                SqlParameter[] objSqlPara = new SqlParameter[4];
                objSqlPara[0] = new SqlParameter("@Action", Action);
                objSqlPara[1] = new SqlParameter("@AMNTTYPE", amnttype);
                objSqlPara[2] = new SqlParameter("@ACNTIDNO", acnt_idno);
                objSqlPara[3] = new SqlParameter("@YEARIDNO", yearid);
                var Temp = SqlHelper.ExecuteScalar(ConString, CommandType.StoredProcedure, "spVoucherEntry", objSqlPara);

                return(Convert.ToDouble(Temp));
            }
        }
Exemplo n.º 21
0
        public Int64 Countall()
        {
            using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
            {
                Int32 Count = 0;
                Count = (from CH in db.tblPayToOwnAccs
                         //join cifrom in db.tblCityMasters on CH.BaseCity_Idno equals cifrom.City_Idno
                         join cito in db.tblCityMasters on CH.BaseCity_Idno equals cito.City_Idno
                         join AM in db.AcntMasts on CH.Driver_IdNo equals AM.Acnt_Idno
                         select CH.Id).Count();

                return(Count);
            }
        }
Exemplo n.º 22
0
 public IList CheckItemExistInOtherMaster(Int32 PurBillIdno, Int32 ItemIdno)
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         return((from obj in db.tblPBillDetls
                 join obj1 in db.Stckdetls on obj.PBillHead_Idno equals obj1.PBillIdno
                 where obj.PBillHead_Idno == PurBillIdno && obj.Item_Idno == ItemIdno
                 orderby obj1.SerialNo
                 select new
         {
             SerialIdo = obj1.SerlDetl_id,
         }).ToList());
     }
 }
Exemplo n.º 23
0
        public Int64 Select_PurchaseBillCount(Int32 yearIdno, DateTime?DateFrom, DateTime?DateTo)
        {
            using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
            {
                Int64 lst = (from PBH in db.tblPBillHeads
                             join cifrom in db.tblCityMasters on PBH.Loc_Idno equals cifrom.City_Idno
                             join acnts in db.AcntMasts on PBH.Prty_Idno equals acnts.Acnt_Idno
                             where PBH.Year_Idno == yearIdno && PBH.PBillHead_Date >= DateFrom &&
                             PBH.PBillHead_Date <= DateTo
                             select PBH).Count();

                return(lst);
            }
        }
Exemplo n.º 24
0
        public List <tblCityMaster> BindCityAll()
        {
            using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
            {
                List <tblCityMaster> objCityMasterList = new List <tblCityMaster>();

                objCityMasterList = (from obj in db.tblCityMasters
                                     where obj.Status == true
                                     orderby obj.City_Name
                                     select obj).ToList();

                return(objCityMasterList);
            }
        }
 public DataSet UpdateGrDetl(string Constring, string Action, Int64 Qty, double Weight, Int64 Grno, Int64 Locid)
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         SqlParameter[] objSqlParameter = new SqlParameter[6];
         objSqlParameter[0] = new SqlParameter("@Action", Action);
         objSqlParameter[1] = new SqlParameter("@Qty", Qty);
         objSqlParameter[2] = new SqlParameter("@Weight", Weight);
         objSqlParameter[3] = new SqlParameter("@GrNO", Grno);
         objSqlParameter[4] = new SqlParameter("@Locid", Locid);
         DataSet ds = SqlHelper.ExecuteDataset(Constring, CommandType.StoredProcedure, "spUpdateGr", objSqlParameter);
         return(ds);
     }
 }
Exemplo n.º 26
0
 public IList TyreSerialFromLoc(Int32 ItemIdno, Int64 LocIdno, Int64 tyresizeidno)
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         var Lst = (from N in db.Stckdetls
                    where N.Is_Issued == false && N.MtrlIssue_Idno == 0 && N.ItemIdno == ItemIdno && N.TyresizeIdno == tyresizeidno && (N.Billed == false || N.Billed == null) && (N.Loc_Idno == LocIdno) && (N.Item_from != "CP")
                    select new
         {
             StckId = N.SerlDetl_id,
             SerialNo = N.SerialNo
         }).ToList();
         return(Lst);
     }
 }
 public IList BindTollPump(Int64[] Ids)
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         return((from obj in db.tbltollmasters
                 where obj.Status == true && Ids.Contains(obj.Toll_id)
                 select new
         {
             TollName = obj.Tolltax_name,
             TollIdno = obj.Toll_id,
             Amount = obj.Amount
         }).ToList());
     }
 }
Exemplo n.º 28
0
        public bool Insert(DataTable dT, Int32 itemidno, string strRateType, Int32 FrmCityIdno, Int32 ToCityIdno, Int32 empIdno, string strTranType, Int64 TranTypeID)
        {
            bool value = true;

            using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
            {
                try
                {
                    for (int i = 0; i < dT.Rows.Count; i++)
                    {
                        tblRateMastRetailer obj = new tblRateMastRetailer();
                        obj.Item_Idno       = itemidno;
                        obj.FrmCity_Idno    = FrmCityIdno;
                        obj.ToCity_Idno     = ToCityIdno;
                        obj.Emp_Idno        = empIdno;
                        obj.Rate_Type       = Convert.ToString(dT.Rows[i]["Rate_Type"]);
                        obj.Rate_Date       = Convert.ToDateTime(dT.Rows[i]["Rate_Date"]);
                        obj.Item_Rate       = Convert.ToDouble(dT.Rows[i]["Item_Rate"]);
                        obj.Item_WghtRate   = Convert.ToDouble(dT.Rows[i]["Item_WghtRate"]);
                        obj.ToCity_Idno     = Convert.ToInt32(dT.Rows[i]["ToCity_Idno"]);
                        obj.Cityvia_Idno    = Convert.ToInt32(dT.Rows[i]["CityVia_Idno"]);
                        obj.QtyShrtg_Limit  = Convert.ToDouble(dT.Rows[i]["QtyShrtg_Limit"]);
                        obj.QtyShrtg_Rate   = string.IsNullOrEmpty(Convert.ToString(dT.Rows[i]["QtyShrtg_Rate"])) ? 0 : Convert.ToDouble(dT.Rows[i]["QtyShrtg_Rate"]);
                        obj.WghtShrtg_Limit = string.IsNullOrEmpty(Convert.ToString(dT.Rows[i]["WghtShrtg_Limit"])) ? 0 : Convert.ToDouble(dT.Rows[i]["WghtShrtg_Limit"]);
                        obj.WghtShrtg_Rate  = string.IsNullOrEmpty(Convert.ToString(dT.Rows[i]["WghtShrtg_Rate"])) ? 0 : Convert.ToDouble(dT.Rows[i]["WghtShrtg_Rate"]);
                        obj.Item_Rate2      = string.IsNullOrEmpty(Convert.ToString(dT.Rows[i]["Item_Rate2"])) ? 0 : Convert.ToDouble(dT.Rows[i]["Item_Rate2"]);
                        obj.Item_Rate3      = string.IsNullOrEmpty(Convert.ToString(dT.Rows[i]["Item_Rate3"])) ? 0 : Convert.ToDouble(dT.Rows[i]["Item_Rate3"]);
                        obj.ItemRate_Type   = string.IsNullOrEmpty(Convert.ToString(dT.Rows[i]["ItemRateType_Idno"])) ? 0 : Convert.ToInt32(dT.Rows[i]["ItemRateType_Idno"]);
                        obj.Dist_Km         = string.IsNullOrEmpty(Convert.ToString(dT.Rows[i]["Dist_km"])) ? 0 : Convert.ToDouble(dT.Rows[i]["Dist_km"]);
                        obj.DistMast_Idno   = string.IsNullOrEmpty(Convert.ToString(dT.Rows[i]["DistanceIdno"])) ? 0 : Convert.ToInt64(dT.Rows[i]["DistanceIdno"]);
                        obj.Con_Size        = string.IsNullOrEmpty(Convert.ToString(dT.Rows[i]["ConSize"])) ? "0" : Convert.ToString(dT.Rows[i]["ConSize"]);
                        obj.Con_Weight      = string.IsNullOrEmpty(Convert.ToString(dT.Rows[i]["ConWeight"])) ? 0 : Convert.ToDouble(dT.Rows[i]["ConWeight"]);
                        obj.ConSize_ID      = string.IsNullOrEmpty(Convert.ToString(dT.Rows[i]["ConSizeID"])) ? 0 : Convert.ToInt32(dT.Rows[i]["ConSizeID"]);
                        obj.Item_Weight     = string.IsNullOrEmpty(Convert.ToString(dT.Rows[i]["Item_Weight"])) ? 0 : Convert.ToDecimal(dT.Rows[i]["Item_Weight"]);
                        obj.IsWeight        = string.IsNullOrEmpty(Convert.ToString(dT.Rows[i]["Item_Weight"])) ? false : Convert.ToBoolean(dT.Rows[i]["IsWeight"]);
                        obj.TranType        = strTranType;
                        obj.TranType_Idno   = TranTypeID;
                        obj.Status          = true;
                        obj.Date_Added      = DateTime.Now; obj.Date_Modified = DateTime.Now;
                        db.tblRateMastRetailers.AddObject(obj);
                        db.SaveChanges();
                    }
                }
                catch (Exception Ex)
                {
                    value = false;
                }
            }
            return(value);
        }
Exemplo n.º 29
0
        public Int64 UpdateForRecvd(tblClaimToComHead obj, Int32 Head_Idno, DataTable Dttemp)
        {
            Int64 ClaimHeadIdno = 0;

            using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
            {
                db.Connection.Open();
                try
                {
                    tblClaimToComHead CHead = db.tblClaimToComHeads.Where(ch => ch.ClaimToComHead_Idno == Head_Idno).FirstOrDefault();
                    if (CHead != null)
                    {
                        CHead.ClaimToComRec_Date = obj.ClaimToComRec_Date;
                        CHead.Against            = obj.Against;
                        db.SaveChanges();
                        ClaimHeadIdno = CHead.ClaimToComHead_Idno;

                        List <tblClaimToComDetl> ClaimDetl = db.tblClaimToComDetls.Where(cd => cd.ClaimToComHead_Idno == Head_Idno).ToList();
                        foreach (tblClaimToComDetl tcd in ClaimDetl)
                        {
                            for (int i = 0; i < Dttemp.Rows.Count; i++)
                            {
                                Int64 Value = Convert.ToInt64(Dttemp.Rows[i]["ClaimDetailsIdno"]);
                                List <tblClaimToComDetl> ClaimDetls = db.tblClaimToComDetls.Where(cd => cd.ClaimToComDetl_Idno == Value).ToList();
                                foreach (tblClaimToComDetl tcds in ClaimDetls)
                                {
                                    tcds.Status       = Convert.ToInt64(Dttemp.Rows[i]["Status"]);
                                    tcds.New_SerialNo = Convert.ToString(Dttemp.Rows[i]["NewSerialNo"]);
                                    tcds.Remark       = Convert.ToString(Dttemp.Rows[i]["Remark"]);
                                    db.SaveChanges();

                                    string NewSerialNo = Dttemp.Rows[i]["NewSerialNo"].ToString();
                                    if (string.IsNullOrEmpty(NewSerialNo) == false)
                                    {
                                        Stckdetl SD = db.Stckdetls.Where(d => d.SerialNo == NewSerialNo).FirstOrDefault();
                                        tcds.NewStckDetl_Idno = SD.SerlDetl_id;
                                        db.SaveChanges();
                                    }
                                }
                            }
                        }
                    }
                }
                catch
                {
                    ClaimHeadIdno = 0;
                }
            }
            return(ClaimHeadIdno);
        }
        public Int64 TotalRecords()
        {
            using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
            {
                Int32 Count = 0;
                Count = (from hd in db.tblSummaryRegisters
                         join cito in db.tblCityMasters on hd.FromCity_Idno equals cito.City_Idno
                         join trk in db.LorryMasts on hd.Truck_Idno equals trk.Lorry_Idno

                         select hd.SumReg_Idno).Count();

                return(Count);
            }
        }