예제 #1
0
 public ActionResult AddNew(int?id)
 {
     if (Session["LOGGEDIN"] != null)
     {
         objfourthTierproperty = new fourthTier_Property();
         //objBanlBLL = new Bank_BLL();
         //firstTier_Property headAccounts = new firstTier_Property() ;
         thirdTier_BLL headAccountBLL = new thirdTier_BLL();
         var           data           = headAccountBLL.ViewAll();
         objfourthTierproperty.headLST = Helper.ConvertDataTable <thirdTier_Property>(data);
         try
         {
             if (id > 0)
             {
                 objfourthTierproperty.idx = Convert.ToInt32(id);
                 objfourthTierbll          = new fourthTier_BLL(objfourthTierproperty);
                 var dt = objfourthTierbll.GetfourthTierById();
                 objfourthTierproperty.subHeadIdx    = int.Parse(dt.Rows[0]["subHeadIdx"].ToString());
                 objfourthTierproperty.childHeadName = dt.Rows[0]["childHeadName"].ToString();
             }
             else
             {
             }
         }
         catch (Exception ex)
         {
         }
         return(PartialView("_AddNew", objfourthTierproperty));
     }
     else
     {
         return(RedirectToAction("Login", "Account"));
     }
 }
예제 #2
0
        public JsonResult Delete(int?id)
        {
            if (Session["LOGGEDIN"] != null)
            {
                try
                {
                    if (id > 0)
                    {
                        objfourthTierproperty     = new fourthTier_Property();
                        objfourthTierproperty.idx = int.Parse(id.ToString());
                        //objDepartmentsBLL = new Departments_BLL(id);
                        objfourthTierbll = new fourthTier_BLL(objfourthTierproperty);

                        bool flag = objfourthTierbll.DeleteAccount();
                        return(Json(new { data = "Deleted", success = flag, statuscode = 200 }, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        return(Json(new { data = "Error Occur", success = false, statuscode = 400, count = 0 }, 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));
            }
        }
예제 #3
0
        public virtual JsonResult getVendors()
        {
            fourthTier_Property objProperty = new fourthTier_Property();

            objProperty.idx = 2;
            fourthTier_BLL objbll = new fourthTier_BLL(objProperty);
            var            Data   = Helper.ConvertDataTable <fourthTier_Property>(objbll.getAlCustomersOrVendors());//JsonConvert.SerializeObject(GetAllPIByDate(objsearchPI));

            return(Json(new { data = Data, success = true, statuscode = 200 }, JsonRequestBehavior.AllowGet));
        }
예제 #4
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));
     }
 }
예제 #5
0
        public JsonResult AddUpdate(fourthTier_Property objcomapnybank)
        {
            if (Session["LOGGEDIN"] != null)
            {
                try
                {
                    objfourthTierproperty                       = new fourthTier_Property();
                    objfourthTierproperty                       = objcomapnybank;
                    objfourthTierproperty.visible               = 1;
                    objfourthTierproperty.createdByUserIdx      = Convert.ToInt32(Session["UID"].ToString());
                    objfourthTierproperty.creationDate          = DateTime.Now;
                    objfourthTierproperty.lastModifiedByUserIdx = Convert.ToInt32(Session["UID"].ToString());
                    objfourthTierproperty.lasModificationDate   = DateTime.Now.ToString("yyyy-MM-dd");
                    objfourthTierbll = new fourthTier_BLL(objfourthTierproperty);

                    bool flag;
                    if (objcomapnybank.idx > 0)
                    {
                        //update
                        flag = objfourthTierbll.Update();
                        return(Json(new { data = objcomapnybank, success = flag, msg = "Success", statuscode = 200, count = 0 }, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        //add
                        flag = objfourthTierbll.Insert();
                        return(Json(new { data = objcomapnybank, success = flag, msg = "Success", statuscode = 200, count = 0 }, 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));
            }
        }
예제 #6
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"));
                }
            }
        }