예제 #1
0
        public JsonResult Delete(int?id)
        {
            if (Session["LOGGEDIN"] != null)
            {
                try
                {
                    if (id > 0)
                    {
                        objthirdTierproperty     = new thirdTier_Property();
                        objthirdTierproperty.idx = int.Parse(id.ToString());
                        //objDepartmentsBLL = new Departments_BLL(id);
                        objthirdTierbll = new thirdTier_BLL(objthirdTierproperty);

                        bool flag = objthirdTierbll.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));
            }
        }
        public ActionResult AddReceipt(int?id)
        {
            if (Session["LOGGEDIN"] != null)
            {
                objvoucherVM = new LP_Voucher_ViewModel();
                if (objvoucherVM.idx > 0)
                {
                }
                else
                {
                    thirdTier_BLL subheadBLL = new thirdTier_BLL();
                    var           allSubhead = subheadBLL.ViewAll();
                    objvoucherVM.vouchertypelist = Helper.ConvertDataTable <thirdTier_Property>(subheadBLL.ViewAll());
                    objvoucherVM.date_created    = DateTime.Now;
                    //objvoucherVM.vouchertypelist = Helper.ConvertDataTable<LP_Transaction_Type_Property>(GetAllTransactionType());
                    objvoucherVM.voucher_amount = 0.00m;
                    objvoucherVM.description    = "";
                    objvoucherVM.banklist       = Helper.ConvertDataTable <Company_Bank_Property>(GetAllCompanyBanks());
                    objvoucherVM.customerlist   = Helper.ConvertDataTable <Customers_Property>(GetAllCustomers());

                    LP_GenerateTransNumber_Property objtransnumber = new LP_GenerateTransNumber_Property();
                    objtransnumber.TableName         = "Voucher";
                    objtransnumber.Identityfieldname = "idx";
                    objtransnumber.userid            = Session["UID"].ToString();
                    objVoucherBll           = new LP_Voucher_BLL();
                    objvoucherVM.voucher_no = objVoucherBll.GenerateTransNo(objtransnumber);
                }

                return(View("_AddReceipt", objvoucherVM));
            }
            else
            {
                return(RedirectToAction("Login", "Account"));
            }
        }
예제 #3
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"));
     }
 }
예제 #4
0
 public JsonResult GetAllthirdTiers()
 {
     if (Session["LOGGEDIN"] != null)
     {
         try
         {
             objthirdTierbll = new thirdTier_BLL(objthirdTierproperty);
             var Data = JsonConvert.SerializeObject(objthirdTierbll.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(thirdTier_Property objcomapnybank)
        {
            if (Session["LOGGEDIN"] != null)
            {
                try
                {
                    objthirdTierproperty                       = new thirdTier_Property();
                    objthirdTierproperty                       = objcomapnybank;
                    objthirdTierproperty.visible               = 1;
                    objthirdTierproperty.createdByUserIdx      = Convert.ToInt32(Session["UID"].ToString());
                    objthirdTierproperty.creationDate          = DateTime.Now;
                    objthirdTierproperty.lastModifiedByUserIdx = Convert.ToInt32(Session["UID"].ToString());
                    objthirdTierproperty.lasModificationDate   = DateTime.Now.ToString("yyyy-MM-dd");
                    objthirdTierbll = new thirdTier_BLL(objthirdTierproperty);

                    bool flag;
                    if (objcomapnybank.idx > 0)
                    {
                        //update
                        flag = objthirdTierbll.Update();
                        return(Json(new { data = objcomapnybank, success = flag, msg = "Success", statuscode = 200, count = 0 }, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        //add
                        flag = objthirdTierbll.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));
            }
        }
      public ActionResult AddVoucher(int?id)
      {
          if (Session["LOGGEDIN"] != null)
          {
              objvoucherVM = new LP_Voucher_ViewModel();
              if (objvoucherVM.idx > 0)
              {
              }
              else
              {
                  LP_PInvoice_BLL objbll = new LP_PInvoice_BLL();
                  objvoucherVM.PInvoiceLST = Helper.ConvertDataTable <LP_P_Invoice_Property>(objbll.SelectAll()); //JsonConvert.SerializeObject(GetAllPIByDate(objsearchPI));
                  thirdTier_BLL subheadBLL = new thirdTier_BLL();
                  var           allSubhead = subheadBLL.ViewAll();
                  objvoucherVM.date_created = DateTime.Now;

                  objvoucherVM.vouchertypelist = Helper.ConvertDataTable <thirdTier_Property>(subheadBLL.ViewAll());
                  objvoucherVM.voucher_amount  = 0.00m;
                  objvoucherVM.description     = "";
                  objvoucherVM.banklist        = Helper.ConvertDataTable <Company_Bank_Property>(GetAllCompanyBanks());
                  objvoucherVM.vendorlist      = Helper.ConvertDataTable <Vendors_Property>(GetAllVendors());

                  LP_GenerateTransNumber_Property objtransnumber = new LP_GenerateTransNumber_Property();
                  objtransnumber.TableName         = "Voucher";
                  objtransnumber.Identityfieldname = "idx";
                  objtransnumber.userid            = Session["UID"].ToString();
                  objVoucherBll           = new LP_Voucher_BLL();
                  objvoucherVM.voucher_no = objVoucherBll.GenerateTransNo(objtransnumber);
              }

              return(View("_AddVoucher", objvoucherVM));
          }
          else
          {
              return(RedirectToAction("Login", "Account"));
          }
      }