Ejemplo n.º 1
0
        public JsonResult AddUpdateOP(OpenigEntryVM objVoucher)

        {
            try
            {
                bool flag = false;
                objOP                  = new OpenigEntryVM();
                objOP.voucherNo        = objVoucher.voucherNo;
                objOP.voucherDate      = objVoucher.voucherDate;
                objOP.openingType      = objVoucher.openingType;
                objOP.accountIdx       = objVoucher.accountIdx;
                objOP.totalAmount      = objVoucher.totalAmount;
                objOP.Amount           = objVoucher.Amount;
                objOP.paidAmount       = objVoucher.paidAmount;
                objOP.balance          = objVoucher.balance;
                objOP.memo             = objVoucher.memo;
                objOP.createDate       = DateTime.Parse(Convert.ToDateTime(objVoucher.voucherDate).ToString("yyyy-MM-dd"));
                objOP.createdByUserIdx = int.Parse(Session["UID"].ToString());
                if (objOP.idx > 0)
                {
                    //objSalesOrderProperty.idx = objSalesOrder.idx;
                    //objSalesOrderProperty.creationDate = DateTime.Now;
                    //objSalesOrderProperty.visible = 1;
                    //objSalesOrderProperty.createdByUserIdx = Convert.ToInt16(Session["UID"].ToString());
                    //objSalesOrderProperty.visible = 1;
                    //objSalesOrderProperty.status = "0";
                    //objSalesOrderProperty.TableName = "SalesOrderDetails";
                    objOPBLL = new LP_Opening_BLL(objOP);
                    flag     = objOPBLL.Insert();
                    //update
                }
                else
                {
                    //add

                    objOPBLL = new LP_Opening_BLL(objOP);
                    flag     = objOPBLL.Insert();
                    //var inventory = objSalesOrderBll.ProcessSalesInvoice();
                }



                return(Json(new { data = "", success = true, msg = true == true ? "Successfull" : "Failed", statuscode = true == true ? 200 : 401 }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                return(Json(new { data = ex.Message, success = false, statuscode = 400, count = 0 }, JsonRequestBehavior.AllowGet));
            }
        }
Ejemplo n.º 2
0
        public ActionResult opening()
        {
            string actionName     = this.ControllerContext.RouteData.Values["action"].ToString();
            string controllerName = this.ControllerContext.RouteData.Values["controller"].ToString();
            string pagename       = @"/" + controllerName + @"/" + actionName;
            var    page           = (List <LP_Pages_Property>)Session["PageList"];

            if (Session["LoggedIn"] != null && Helper.CheckPageAccess(pagename, page) && Session["ISADMIN"] != null && Convert.ToBoolean(Session["ISADMIN"].ToString()) == true)
            {
                OpenigEntryVM objOpeningVM = new OpenigEntryVM();
                if (objOpeningVM.idx > 0)
                {
                }
                else
                {
                    LP_Opening_BLL objbll = new LP_Opening_BLL(objOpeningVM);
                    LP_GenerateTransNumber_Property objtrans = new LP_GenerateTransNumber_Property();
                    objtrans.TableName            = "accountMasterGL";
                    objtrans.Identityfieldname    = "idxx";
                    objtrans.userid               = (Session["UID"].ToString());
                    objOpeningVM.voucherNo        = objbll.GenerateSO(objtrans);
                    objOpeningVM.voucherDate      = DateTime.Now.ToString("yyyy-MM-dd");
                    objOpeningVM.createdByUserIdx = Convert.ToInt16(Session["UID"].ToString());
                }

                return(View("opening", objOpeningVM));
            }
            else
            {
                if (Session["LoggedIn"] == null)
                {
                    return(RedirectToAction("Login", "Account"));
                }
                else
                {
                    return(RedirectToAction("NotAuthorized", "Account"));
                }
            }
        }