Exemplo n.º 1
0
 public ActionResult list(Recivables rs)
 {
     if (HttpContext.Session.GetString("Adm") != null)
     {
         try
         {
             var        sl = Convert.ToInt32(TempData["sid"].ToString());
             Sales      a  = (from abc in con.Sale where abc.id.Equals(sl) select abc).FirstOrDefault();
             Recivables rd = new Recivables()
             {
                 CustomerID = a.CustomerId,
                 SalesID    = a.id,
                 dateadd    = DateTime.Now.ToLocalTime(),
                 SlipNo     = rs.SlipNo,
                 Status     = rs.Status
             };
             con.Recivable.Add(rd);
             con.SaveChanges();
             return(View((from abc in con.Sale select abc).ToList()));
         }
         catch (Exception ex)
         {
             ex.Message.ToString();
             return(View((from abc in con.Sale select abc).ToList()));
         }
     }
     else
     {
         return(RedirectToAction("Login", controllerName: "Home"));
     }
 }
Exemplo n.º 2
0
        public ActionResult Recivableedt1(Recivables rs)
        {
            var a = (from abc in con.Recivable where abc.Id.Equals(rs.Id) select abc).FirstOrDefault();

            a.SalesID    = rs.SalesID;
            a.SlipNo     = rs.SlipNo;
            a.Status     = rs.Status;
            a.updatedate = DateTime.Now.ToLocalTime();
            Recivableedt(a);
            con.SaveChanges();

            return(RedirectToAction("Recivablelist", controllerName: "Admin"));
        }
Exemplo n.º 3
0
        public ActionResult Index(Sales sl)
        {
            if (TryValidateModel(sl))
            {
                var a = (from abc in con.Stocks where abc.Name.Equals(sl.Name.ToString()) && abc.Quantity > 0 select abc).FirstOrDefault();
                if (a != null)
                {
                    con.Sale.Add(sl);
                    con.SaveChanges();
                    Recivables rss = new Recivables()
                    {
                        CustomerID = sl.CustomerId,
                        SalesID    = sl.id,
                        dateadd    = DateTime.Now.ToLocalTime(),
                    };


                    return(RedirectToAction("Stockupd", new { Id = sl.id, st = a.id }));
                }
                else
                {
                    return(View("Not present Stock"));
                    // con.Sale.Add(sl);
                    //con.SaveChanges();
                    //Stock st = new Stock()
                    //{
                    //  id=0,
                    // Name =sl.Name,
                    // Quantity =sl.Quantity,
                    // Category =sl.Category,
                    //UnitPriceavg =sl.Price,


                    //};
                    //con.Stocks.Add(st);
                    //con.SaveChanges();
                }


                //return RedirectToAction("Index", controllerName: "Sales");
            }

            {
                return(View());
            }
        }
Exemplo n.º 4
0
 public ActionResult Recivabledel(Recivables rs)
 {
     con.Recivable.Remove(rs);
     con.SaveChanges();
     return(RedirectToAction("Recivablelist", controllerName: "Admin"));
 }
Exemplo n.º 5
0
        public ActionResult Recivableedt(Recivables rs)
        {
            var a = (from abc in con.Recivable where abc.Id.Equals(rs.Id) select abc).FirstOrDefault();

            return(View(a));
        }