예제 #1
0
 public void UpdateDistributorSaleAPI(DistributorSaleDTO DistributorTrans)
 {
     try
     {
         con.Open();
         var para = new DynamicParameters();
         //para.Add("@PaperRate", DistributorTrans.PaperRate);
         //para.Add("@PaperQuantity", DistributorTrans.PaperQuantity);
         //para.Add("@TotalPrice", DistributorTrans.TotalPrice);
         //para.Add("@PamphletQuantity", DistributorTrans.PamphletQuantity);
         //para.Add("@PamphletRate", DistributorTrans.PamphletRate);
         //para.Add("@TotalPamphletAmount", DistributorTrans.TotalPamphletAmount);
         para.Add("@SaleOrder", DistributorTrans.SaleOrder);
         para.Add("@TotalFinalAmount", DistributorTrans.TotalFinalAmount);
         para.Add("@PaidAmount", DistributorTrans.PaidAmount);
         para.Add("@BalanceAmount", DistributorTrans.BalanceAmount);
         para.Add("@PrvBalanceAmount", DistributorTrans.PrvBalanceAmount);
         para.Add("@FinalBalaceAmount", DistributorTrans.FinalBalaceAmount);
         para.Add("@DistributorId", DistributorTrans.ModifiedBy);
         para.Add("@ModifiedDate", DistributorTrans.ModifiedDate);
         para.Add("@ModifiedBy", DistributorTrans.ModifiedBy);
         para.Add("@DeleteStatus", "COMPLETE");
         var value = con.Query <int>("SP_Update_MainDistributorSale", para, null, true, 0, CommandType.StoredProcedure);
         // con.Close();
     }
     catch (Exception)
     {
         throw;
     }
     finally { con.Close(); }
 }
예제 #2
0
 public void InsertDistributorSaleProductAPI(DistributorSaleDTO DistributorSaleProduct)
 {
     try {
         con.Open();
         var para = new DynamicParameters();
         para.Add("@DistributorSaleProductId", DistributorSaleProduct.DistributorSaleProductId); // Normal Parameters
         para.Add("@SaleOrder", DistributorSaleProduct.SaleOrder);
         para.Add("@PaperId", DistributorSaleProduct.PaperId);
         para.Add("@PaperRate", DistributorSaleProduct.PaperRate);
         para.Add("@PaperQuantity", DistributorSaleProduct.PaperQuantity);
         para.Add("@TotalPrice", DistributorSaleProduct.TotalPrice);
         para.Add("@PamphletQuantity", DistributorSaleProduct.PamphletQuantity);
         para.Add("@PamphletRate", DistributorSaleProduct.PamphletRate);
         para.Add("@TotalPamphletAmount", DistributorSaleProduct.TotalPamphletAmount);
         para.Add("@TotalFinalAmount", DistributorSaleProduct.TotalFinalAmount);
         para.Add("@DistributorId", DistributorSaleProduct.CreatedBy);
         para.Add("@CreatedDate", DistributorSaleProduct.CreatedDate);
         para.Add("@CreatedBy", DistributorSaleProduct.CreatedBy);
         para.Add("@ModifiedDate", DistributorSaleProduct.ModifiedDate);
         para.Add("@ModifiedBy", DistributorSaleProduct.ModifiedBy);
         para.Add("@DeleteStatus", "ACTIVE");
         var value = con.Query <int>("SP_Insert_DistributorSaleProduct", para, null, true, 0, CommandType.StoredProcedure);
         //con.Close();
     } catch (Exception)
     {
         throw;
     }
     finally { con.Close(); }
 }
예제 #3
0
 public void InsertDistributorSale(DistributorSaleDTO Distributorsale)
 {
     try
     {
         con.Open();
         var para = new DynamicParameters();
         para.Add("@DistributorSaleId", Distributorsale.DistributorSaleId); // Normal Parameters
         para.Add("@SaleOrder", Distributorsale.SaleOrder);
         para.Add("@RetailerId", Distributorsale.RetailerId);
         para.Add("@TransDate", Distributorsale.TransDate);
         //para.Add("@PaperRate", DistributorTrans.PaperRate);
         //para.Add("@PaperQuantity", DistributorTrans.PaperQuantity);
         //para.Add("@TotalPrice", DistributorTrans.TotalPrice);
         //para.Add("@PamphletQuantity", DistributorTrans.PamphletQuantity);
         //para.Add("@PamphletRate", DistributorTrans.PamphletRate);
         //para.Add("@TotalPamphletAmount", DistributorTrans.TotalPamphletAmount);
         //para.Add("@TotalFinalAmount", DistributorTrans.TotalFinalAmount);
         //para.Add("@PaidAmount", DistributorTrans.PaidAmount);
         //para.Add("@BalanceAmount", DistributorTrans.BalanceAmount);
         //para.Add("@PrvBalanceAmount", DistributorTrans.PrvBalanceAmount);
         //para.Add("@FinalBalaceAmount", DistributorTrans.FinalBalaceAmount);
         para.Add("@DistributorId", Distributorsale.CreatedBy);
         para.Add("@CreatedDate", Distributorsale.CreatedDate);
         para.Add("@CreatedBy", Distributorsale.CreatedBy);
         //para.Add("@ModifiedDate", DistributorTrans.ModifiedDate);
         //para.Add("@ModifiedBy", DistributorTrans.ModifiedBy);
         para.Add("@DeleteStatus", "ACTIVE");
         var value = con.Query <int>("SP_Insert_MainDistributorSale", para, null, true, 0, CommandType.StoredProcedure);
     }
     catch (Exception) { throw; }
     finally { con.Close(); }
 }
예제 #4
0
        public ActionResult AddProduct()
        {
            DistributorSaleDTO model = new DistributorSaleDTO();

            //model.SaleOrder = Session["VSaleOrder"].ToString();
            //model.TransDate = Convert.ToDateTime(Session["VTrnDate"].ToString());
            //model.RetailerId =Convert.ToInt32(Session["VRetailerId"]);
            return(PartialView("AddProduct", model));
        }
예제 #5
0
        public ActionResult Create(string tri)

        {
            DistributorSaleDTO objDS = new DistributorSaleDTO();

            objDS.ListRetailer = BindListRetailer_DSale(tri);
            //BindListRetailer(objDT.DistributorId.ToString());
            ViewData["SelectedRetailer"] = string.Empty;


            return(View(objDS));
        }
예제 #6
0
        public ActionResult UpdateDistTrans(string tri)

        {
            DistributorSaleDTO objDS = new DistributorSaleDTO();

            // objDS.ListRetailer = BindListRetailer_DSale(tri);
            //BindListRetailer(objDT.DistributorId.ToString());
            ViewData["SelectedRetailer"] = string.Empty;
            var TotalFinalAMT = GetFinalAmount_By_SaleOrder(tri);

            TempData["TFianlAMT"] = TotalFinalAMT;
            return(View(objDS));
        }
예제 #7
0
        public ActionResult Create(DistributorSaleDTO obj, FormCollection frm, string tri)
        {
            try
            {
                if (string.IsNullOrEmpty(Convert.ToString(obj.RetailerId)))
                {
                    ModelState.AddModelError("Error", "Please Select Retailer");
                }
                else
                {
                    obj.DistributorSaleId = 0;
                    obj.CreatedBy         = Convert.ToInt32(Session["UserID"]);

                    DateTime     timeUtc = System.DateTime.UtcNow;
                    TimeZoneInfo cstZone = TimeZoneInfo.FindSystemTimeZoneById("India Standard Time");
                    DateTime     cstTime = TimeZoneInfo.ConvertTimeFromUtc(timeUtc, cstZone);
                    obj.CreatedDate = cstTime;


                    objdistributorsale.InsertDistributorSale(obj);
                    TempData["MessageRegistration"] = "Data Saved Successfully!";
                    //  ViewData["VSaleOrder"]= obj.SaleOrder;
                    TempData["AddPaperTrn"]       = "AddPapaerTrn";
                    Session["TransDate"]          = obj.TransDate.ToShortDateString();
                    ViewBag.VRetailerId           = obj.RetailerId;
                    Session["SaleOrder"]          = obj.SaleOrder;
                    Session["RetailerId"]         = obj.RetailerId;
                    Session["PrvBalanceRetailer"] = obj.PrvBalanceAmount;
                    return(RedirectToAction("AddProductT"));
                }
                obj.ListRetailer = BindListRetailer_DSale(tri);
                // obj.ListPaperbyCityId = BindListPaper(tri);
                //obj.ListCity = BindListCity();
                ViewData["SelectedrRetailer"] = obj.RetailerId;
                //ViewData["SelectedPaper"] = obj.PaperId;
                //ViewData["SelectedCity"] = obj.CityId;
                return(View(obj));
            }
            catch (Exception)
            {
                throw;
            }
        }
예제 #8
0
        public List <DistributorSaleDTO> BindListRetailer_DSale(string distId)
        {
            List <DistributorSaleDTO> listritailer = new List <DistributorSaleDTO>()
            {
                new DistributorSaleDTO  {
                    RetailerId = 0, RetailerName = "Select"
                }
            };

            foreach (var item in objdistributorsale.GetRetailerByDistributerId(distId))
            {
                DistributorSaleDTO RT = new DistributorSaleDTO();
                RT.RetailerId   = item.RetailerId;
                RT.RetailerName = item.RetailerName;
                listritailer.Add(RT);
            }

            return(listritailer);
        }
 public HttpResponseMessage CRMainOrder([FromBody] DistributorSaleDTO Distributorsale)
 {
     try
     {
         objDistributorSale.InsertDistributorSale(Distributorsale);
         var message = Request.CreateResponse <DistributorSaleDTO>(HttpStatusCode.Created, Distributorsale);
         message.Headers.Location = new Uri(Request.RequestUri + Distributorsale.DistributorSaleId.ToString());
         return(message);
         //string uri = Url.Link("DefaultApi", new { orderID = order.OrderId });
         //response.Headers.Location = new Uri(uri);
         //return response;
         //return Request.CreateResponse(HttpStatusCode.Created);
     }
     catch (Exception ex)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex));
         // return 0;
     }
 }
예제 #10
0
        public ActionResult UpdateDistTrans(DistributorSaleDTO obj, FormCollection frm, string tri)
        {
            try
            {
                if (string.IsNullOrEmpty(Convert.ToString(obj.PaperId)))
                {
                    ModelState.AddModelError("Error", "Please Select Paper Name");
                }
                else
                {
                    obj.DistributorSaleProductId = 0;
                    obj.CreatedBy = Convert.ToInt32(Session["UserID"]);

                    DateTime     timeUtc = System.DateTime.UtcNow;
                    TimeZoneInfo cstZone = TimeZoneInfo.FindSystemTimeZoneById("India Standard Time");
                    DateTime     cstTime = TimeZoneInfo.ConvertTimeFromUtc(timeUtc, cstZone);
                    obj.CreatedDate = cstTime;


                    objdistributorsale.UpdateDistributorSale(obj);

                    TempData["MessageRegistration"] = "Data Saved Successfully!";
                    TempData["AddPaperTrn"]         = "AddPapaerTrn";
                    TempData["UpdtDistTrn"]         = "UpdtDistTrn";
                    // DistributorSaleDTO DS = new DistributorSaleDTO();
                    return(RedirectToAction("Details"));
                }
                // obj.ListRetailer = BindListRetailer(tri);
                // obj.ListPaperbyDistId = BindListPaperL(tri);
                //obj.ListCity = BindListCity();
                // ViewData["SelectedrRetailer"] = obj.RetailerId;
                // ViewData["SelectedPaper"] = obj.PaperId;
                //ViewData["SelectedCity"] = obj.CityId;
                return(PartialView("Create", objdistributorsale));
            }
            catch (Exception)
            {
                throw;
            }
        }