public ActionResult AddNewTaxes(int?id) { if (Session["LOGGEDIN"] != null) { objTaxesProperty = new Taxes_Property(); objTaxesProperty.idx = Convert.ToInt32(id); objTaxes = new Taxes_BLL(objTaxesProperty); if (id > 0 && id != null) { var dt = objTaxes.GetById(); //objTaxesProperty.companyIdx = 1; objTaxesProperty.idx = int.Parse(dt.Rows[0]["idx"].ToString()); objTaxesProperty.taxName = (dt.Rows[0]["taxName"].ToString()); objTaxesProperty.taxPercent = decimal.Parse(dt.Rows[0]["taxPercent"].ToString()); objTaxesProperty.IsClaimble = Convert.ToBoolean(dt.Rows[0]["IsClaimble"].ToString()); //objTaxesProperty.contactNumber = dt.Rows[0]["contactNumber"].ToString(); //objTaxesProperty.isMainBranch = int.Parse(dt.Rows[0]["isMainBranch"].ToString()); //objTaxesProperty.address = dt.Rows[0]["address"].ToString(); } return(PartialView("_AddNewTaxes", objTaxesProperty)); } else { return(RedirectToAction("Login", "Account")); } }
public ActionResult ReturnSales(int?id) { if (Session["LOGGEDIN"] != null) { objSalesOrderVM_Property = new SalesOrderVM_Property(); Customers_Property vendor = new Customers_Property(); Product_Property product = new Product_Property(); Customers_BLL objcustomerbll = new Customers_BLL(); Product_BLL objProductbll = new Product_BLL(); LP_Quotation_BLL objQuotationbll = new LP_Quotation_BLL(); WareHouse_BLL objWareHouseBLL = new WareHouse_BLL(); objSalesOrderVM_Property.idx = Convert.ToInt32(id); objSalesOrderVM_Property.QSList = Helper.ConvertDataTable <LP_Quotation_Master_Property>(objQuotationbll.SelectQS()); objSalesOrderVM_Property.CustomerLST = Helper.ConvertDataTable <Customers_Property>(objcustomerbll.ViewAllCustomers()); objSalesOrderVM_Property.ProductList = Helper.ConvertDataTable <Product_Property>(objProductbll.ViewAll()); objSalesOrderVM_Property.BankList = Helper.ConvertDataTable <Company_Bank_Property>(GetAllCompanyBanks()); objSalesOrderVM_Property.wareHouseList = Helper.ConvertDataTable <WareHouse_Property>(objWareHouseBLL.SelectAll()); objSalesOrderVM_Property.salesorderDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")); Taxes_Property obj = new Taxes_Property(); Taxes_BLL objtaxBLL = new Taxes_BLL(obj); ViewBag.TaxList = Helper.ConvertDataTable <Taxes_Property>(objtaxBLL.GetTaxesForCheckBox()); //objPInvoiceVM = new LP_PI_ViewModel(); //objPIProperty = new LP_P_Invoice_Property(); //objPIProperty.idx = Convert.ToInt32(id); //objPIBLL = new LP_PInvoice_BLL(objPIProperty); //objPInvoiceVM.TaxesList = Helper.ConvertDataTable<Taxes_Property>(GetAllTaxes()); //objPInvoiceVM.ProductList = Helper.ConvertDataTable<Product_Property>(ViewAllProducts()); //objPInvoiceVM.BankList = Helper.ConvertDataTable<Company_Bank_Property>(GetAllCompanyBanks()); DataSet DS = objSalesOrderBll.SelectSIWithDetailData(objSalesOrderVM_Property.idx); //DataSet DS = objPIBLL.SelectPIWithDetailData(objPIProperty.idx); if (DS.Tables.Count > 0) { ViewBag.isReturn = 1; objSalesOrderVM_Property.SalesOrderDetailLST = Helper.ConvertDataTable <SalesOrdersDetails_Property>(DS.Tables[0]); if (DS.Tables[1].Rows.Count > 0) { objSalesOrderVM_Property.salesTaxesLST = Helper.ConvertDataTable <LP_salesTaxes_Property>(DS.Tables[1]); } } return(View("AddNewSalesOrder", objSalesOrderVM_Property)); } else { return(RedirectToAction("Login", "Account")); } }
public JsonResult GetAllTaxes() { if (Session["LOGGEDIN"] != null) { try { objTaxesProperty = new Taxes_Property(); objTaxes = new Taxes_BLL(objTaxesProperty); var Data = JsonConvert.SerializeObject(objTaxes.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)); } }
public JsonResult DeleteTaxes(int?id) { if (Session["LOGGEDIN"] != null) { try { if (id > 0) { Taxes_Property branchProperty = new Taxes_Property(); branchProperty.idx = int.Parse(id.ToString()); objTaxes = new Taxes_BLL(id); Taxes_BLL branhcBll = new Taxes_BLL(branchProperty); //var flag1 = branhcBll.GetById(); //if (flag1.Rows.Count > 0) //{ // if (int.Parse(flag1.Rows[0]["isMainBranch"].ToString()) == 0) // { bool flag = objTaxes.Delete(id); return(Json(new { data = "Deleted", success = flag, statuscode = 200 }, JsonRequestBehavior.AllowGet)); //} //else //{ // return Json(new { data = "Mian Branch Cannot be Delete ", success = false, statuscode = 400, count = 0 }, JsonRequestBehavior.AllowGet); //} } return(Json(new { data = "Process Completed ", success = true, statuscode = 200 }, 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 JsonResult AddUpdate(Taxes_Property obj_Taxes) { if (Session["LOGGEDIN"] != null) { try { if (obj_Taxes.idx > 0) { obj_Taxes.lastModifiedByUserIdx = Convert.ToInt32(Session["UID"].ToString()); obj_Taxes.lastModificationDate = DateTime.Now.ToString("dd/MM/yyyy"); objTaxes = new Taxes_BLL(obj_Taxes); bool flag = objTaxes.Update(); return(Json(new { data = "Updated", success = flag, statuscode = 200 }, JsonRequestBehavior.AllowGet)); } else { //obj_Taxes.companyIdx = 1; obj_Taxes.createdByUserIdx = Convert.ToInt32(Session["UID"].ToString()); objTaxes = new Taxes_BLL(obj_Taxes); bool flag = objTaxes.Insert(); return(Json(new { data = "Inserted", success = flag, statuscode = 200 }, 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 AddQuotaion(int?id) { if (Session["LOGGEDIN"] != null) { objQuotationVM_Property = new QuotationVM_Property(); Customers_Property customer = new Customers_Property(); Product_Property product = new Product_Property(); Customers_BLL objcustomerbll = new Customers_BLL(); Product_BLL objProductbll = new Product_BLL(); objQuotationVM_Property.CustomerLST = Helper.ConvertDataTable <Customers_Property>(objcustomerbll.ViewAllCustomers()); objQuotationVM_Property.ProductList = Helper.ConvertDataTable <Product_Property>(objProductbll.ViewAll()); Taxes_Property obj = new Taxes_Property(); Taxes_BLL objtaxBLL = new Taxes_BLL(obj); ViewBag.TaxList = Helper.ConvertDataTable <Taxes_Property>(objtaxBLL.GetTaxesForCheckBox()); //objQuotationVM_Property.QuotationDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")); ////objQuotationVM_Property.poNumber = "Po-001"; if (id > 0) { LP_Quotation_Detail_Property objmQuotationdetail; objQuotationProperty = new LP_Quotation_Master_Property(); objQuotationProperty.idx = Convert.ToInt16(id); objquotationBll = new LP_Quotation_BLL(objQuotationProperty); DataTable dt = objquotationBll.SelectOne(); objQuotationVM_Property.idx = Convert.ToInt16(dt.Rows[0]["quotationIdx"].ToString()); objQuotationVM_Property.customerIdx = Convert.ToInt16(dt.Rows[0]["customerIdx"].ToString()); objQuotationVM_Property.qsNumber = dt.Rows[0]["qsNumber"].ToString(); objQuotationVM_Property.description = dt.Rows[0]["description"].ToString(); objQuotationVM_Property.totalAmount = Convert.ToDecimal(dt.Rows[0]["totalAmount"].ToString()); string pdate = (dt.Rows[0]["quotationDate"].ToString()).ToString(); string ndate = DateTime.Parse(pdate).ToString("yyyy-MM-dd"); objQuotationVM_Property.quotationDate = Convert.ToDateTime(ndate);// DateTime.Parse(dt.Rows[0]["mrnDate"].ToString()).ToString("yyyy-MM-dd"); //DateTime.Parse(dt.Rows[0]["mrnDate"].ToString()).ToString("yyyy-MM-dd"); //foreach(DataRow dr in dt.Rows) //{ // objmrndetail //} ViewBag.DetailData = Helper.ConvertDataTable <QuotationVM_Property>(dt); //update return(View("AddQuotaion", objQuotationVM_Property));//objQuotationVM_Property } else { objQuotationVM_Property.createdByUserIdx = Convert.ToInt16(Session["UID"].ToString()); objquotationBll = new LP_Quotation_BLL(); LP_GenerateTransNumber_Property objtrans = new LP_GenerateTransNumber_Property(); objtrans.TableName = "quotation"; objtrans.Identityfieldname = "idx"; objtrans.userid = Session["UID"].ToString(); objQuotationVM_Property.qsNumber = objquotationBll.GeneratePO(objtrans); return(View("AddQuotaion", objQuotationVM_Property));//, objQuotationVM_Property } } else { return(RedirectToAction("Login", "Account")); } }
public Taxes_BLL(Taxes_Property objTaxes_Property) { objTaxesProperty = objTaxes_Property; }
public ActionResult AddNewSalesOrder(int?id) { if (Session["LOGGEDIN"] != null) { objSalesOrderVM_Property = new SalesOrderVM_Property(); Customers_Property vendor = new Customers_Property(); Product_Property product = new Product_Property(); Customers_BLL objcustomerbll = new Customers_BLL(); Product_BLL objProductbll = new Product_BLL(); LP_Quotation_BLL objQuotationbll = new LP_Quotation_BLL(); WareHouse_BLL objWareHouseBLL = new WareHouse_BLL(); objSalesOrderVM_Property.QSList = Helper.ConvertDataTable <LP_Quotation_Master_Property>(objQuotationbll.SelectQS()); objSalesOrderVM_Property.CustomerLST = Helper.ConvertDataTable <Customers_Property>(objcustomerbll.ViewAllCustomers()); objSalesOrderVM_Property.ProductList = Helper.ConvertDataTable <Product_Property>(objProductbll.ViewAll()); objSalesOrderVM_Property.BankList = Helper.ConvertDataTable <Company_Bank_Property>(GetAllCompanyBanks()); objSalesOrderVM_Property.wareHouseList = Helper.ConvertDataTable <WareHouse_Property>(objWareHouseBLL.SelectAll()); objSalesOrderVM_Property.salesorderDate = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd")); Taxes_Property obj = new Taxes_Property(); Taxes_BLL objtaxBLL = new Taxes_BLL(obj); ViewBag.TaxList = Helper.ConvertDataTable <Taxes_Property>(objtaxBLL.GetTaxesForCheckBox()); //objSalesOrderVM_Property.poNumber = "Po-001"; 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"); //DateTime.Parse(dt.Rows[0]["mrnDate"].ToString()).ToString("yyyy-MM-dd"); //foreach(DataRow dr in dt.Rows) //{ // objmrndetail //} ViewBag.DetailData = Helper.ConvertDataTable <SalesOrderVM_Property>(dt); //update return(View("AddNewSalesOrder", objSalesOrderVM_Property)); } else { //objSalesOrderProperty = new LP_SalesOrder_Master_Property(); objSalesOrderVM_Property.createdByUserIdx = Convert.ToInt16(Session["UID"].ToString()); objSalesOrderBll = new LP_SalesOrder_BLL(); LP_GenerateTransNumber_Property objtrans = new LP_GenerateTransNumber_Property(); objtrans.TableName = "SalesOrder"; objtrans.Identityfieldname = "idx"; objtrans.userid = Session["UID"].ToString(); objSalesOrderVM_Property.soNumber = objSalesOrderBll.GenerateSO(objtrans); //objSalesOrderProperty.poNumber = ""; //objSalesOrderBll = new LP_SalesOrder_BLL(objSalesOrderProperty); //objSalesOrderVM_Property.poNumber = objSalesOrderBll.GeneratePO();// "PO-001"; // string po = objSalesOrderBll.GeneratePO(); return(View("AddNewSalesOrder", objSalesOrderVM_Property)); } } else { return(RedirectToAction("Login", "Account")); } }