Esempio n. 1
0
        public Int64 InsertInGrExcel(DateTime?date, Int64 GRNo, DateTime?Chln_date, Int64 ChNo, string fromcity, string Tocity, string LoryNo, string OName, string Panno, Int64 dspQty, double Rate, double amount, Int64 Year_idno)
        {
            using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
            {
                Int64 value = 0;
                try
                {
                    tblGrPrepOntoHire Obj = new tblGrPrepOntoHire();
                    Obj.Gr_Date    = date;
                    Obj.Gr_No      = GRNo;
                    Obj.Chln_Date  = Chln_date;
                    Obj.Chln_No    = ChNo;
                    Obj.From_City  = fromcity;
                    Obj.To_City    = Tocity;
                    Obj.Lorry_No   = LoryNo;
                    Obj.Owner_Name = OName;
                    Obj.Pan_no     = Panno;
                    Obj.Dsp_Qty    = dspQty;
                    Obj.Rate       = Rate;
                    Obj.Total_Amnt = amount;
                    Obj.Year_Idno  = Year_idno;
                    db.tblGrPrepOntoHires.AddObject(Obj);

                    db.SaveChanges();
                    value = Obj.Gr_Idno;
                }
                catch (Exception Exe)
                {
                    value = -1;
                }
                return(value);
            }
        }
Esempio n. 2
0
        public int DeleteHireGrDetail(int Gr_idno)
        {
            int value = 0;

            using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
            {
                tblGrPrepOntoHire IH = db.tblGrPrepOntoHires.Where(h => h.Gr_Idno == Gr_idno).FirstOrDefault();
                if (IH != null)
                {
                    db.tblGrPrepOntoHires.DeleteObject(IH);
                    db.SaveChanges();
                    value = 1;
                }
            }
            return(value);
        }