Example #1
0
 public JsonResult GetAllfourthTiers()
 {
     if (Session["LOGGEDIN"] != null)
     {
         try
         {
             objfourthTierbll = new fourthTier_BLL(objfourthTierproperty);
             var Data = JsonConvert.SerializeObject(objfourthTierbll.ViewAll());
             return(Json(new { data = Data, success = true, statuscode = 200, count = Data.Length }, JsonRequestBehavior.AllowGet));
         }
         catch (Exception ex)
         {
             return(Json(new { data = ex.Message, success = false, statuscode = 400, count = 0 }, JsonRequestBehavior.AllowGet));
         }
     }
     else
     {
         return(Json(new { data = "Session Expired", success = false, statuscode = 400, count = 0 }, JsonRequestBehavior.AllowGet));
     }
 }
Example #2
0
        // GET: Finance
        public ActionResult GeneralVoucher(int?id)
        {
            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)
            {
                objGV    = new LP_GeneralVoucher_Property();
                objGVBLL = new LP_GeneralVoucher_BLL();
                fourthTier_Property objPropertyChildHead = new fourthTier_Property();
                fourthTier_BLL      objLastBLL           = new fourthTier_BLL(objPropertyChildHead);
                objGV.AccountLST = Helper.ConvertDataTable <fourthTier_Property>(objLastBLL.ViewAll());

                objSalesOrderVM_Property = new SalesOrderVM_Property();

                if (id > 0)
                {
                    LP_SalesOrder_Detail_Property objmSalesOrderdetail;
                    objSalesOrderProperty     = new LP_SalesOrder_Master_Property();
                    objSalesOrderProperty.idx = Convert.ToInt16(id);

                    objSalesOrderBll = new LP_SalesOrder_BLL(objSalesOrderProperty);
                    DataTable dt = objSalesOrderBll.SelectOne();
                    objSalesOrderVM_Property.idx         = Convert.ToInt16(dt.Rows[0]["salesorderIdx"].ToString());
                    objSalesOrderVM_Property.customerIdx = Convert.ToInt32(dt.Rows[0]["customerIdx"].ToString());
                    objSalesOrderVM_Property.soNumber    = dt.Rows[0]["soNumber"].ToString();
                    objSalesOrderVM_Property.description = dt.Rows[0]["description"].ToString();
                    objSalesOrderVM_Property.qsIdx       = Convert.ToInt16(dt.Rows[0]["qsIdx"].ToString());
                    objSalesOrderVM_Property.totalAmount = Convert.ToDecimal(dt.Rows[0]["totalAmount"].ToString());
                    string pdate = (dt.Rows[0]["salesorderdate"].ToString()).ToString();
                    string ndate = DateTime.Parse(pdate).ToString("yyyy-MM-dd");
                    objSalesOrderVM_Property.salesorderDate = Convert.ToDateTime(ndate);// DateTime.Parse(dt.Rows[0]["mrnDate"].ToString()).ToString("yyyy-MM-dd");
                    ViewBag.DetailData = Helper.ConvertDataTable <SalesOrderVM_Property>(dt);
                    //update
                    return(View("AddNewSalesOrder", objSalesOrderVM_Property));
                }
                else
                {
                    LP_GenerateTransNumber_Property objtrans = new LP_GenerateTransNumber_Property();
                    objtrans.TableName         = "accountMasterGL";
                    objtrans.Identityfieldname = "idxx";
                    objtrans.userid            = Session["UID"].ToString();
                    objGV.voucherNo            = objGVBLL.GenerateSO(objtrans);
                    objGV.voucherDate          = DateTime.Now.ToString("yyyy-MM-dd");
                    objSalesOrderVM_Property.createdByUserIdx = Convert.ToInt16(Session["UID"].ToString());

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