Example #1
0
        public ActionResult Create()
        {
            MainApplication model = new MainApplication();

            model.CatalogueDetails = new Catalogue();
            var details = _CatalogueService.GetLastCatalogue();
            int Catval  = 0;
            int length  = 0;

            if (details != null)
            {
                string bn = details.BookNumber;
                Catval = Convert.ToInt32(bn.Substring(2));
                Catval = Catval + 1;
                length = Catval.ToString().Length;
            }
            else
            {
                Catval = 1;
                length = 1;
            }
            string bookno = _UtilityService.getName("BN", length, Catval);

            model.CatalogueDetails.BookNumber = bookno;

            model.userCredentialList = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _iIModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;
            return(View(model));
        }
Example #2
0
        public ActionResult Create()
        {
            MainApplication model = new MainApplication()
            {
                ShopDetails = new ShopMaster(),
            };
            var shopmaster = _shopService.GetLastShop();
            int shopVal    = 0;
            int length     = 0;

            if (shopmaster != null)
            {
                shopVal = shopmaster.ShopId;
                shopVal = shopVal + 1;
                length  = shopVal.ToString().Length;
            }
            else
            {
                shopVal = 1;
                length  = 1;
            }
            string shopCode = _utilityService.getName("SH", length, shopVal);

            model.ShopDetails.ShopCode = shopCode;
            model.EmpList            = _employeeMasterService.getAllemployees();
            model.userCredentialList = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _iIModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;
            return(View(model));
        }
        public ActionResult Details(string id)
        {
            MainApplication model = new MainApplication()
            {
                TransportDetails     = new TransportMaster(),
                TransportBankDetails = new TransportBankDetail(),
            };
            int Id = Decode(id);

            model.TransportDetails        = _TransportMasterService.getById(Id);
            model.TransportBankDetailList = _TransportBankDetailService.GetDetailsFromBank(model.TransportDetails.TransportCode);
            model.userCredentialList      = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist    = _iIModuleService.getAllModules();
            model.CompanyCode   = CompanyCode;
            model.CompanyName   = CompanyName;
            model.FinancialYear = FinancialYear;

            string previoustransport = TempData["transportcode"].ToString();

            if (previoustransport != model.TransportDetails.TransportCode)
            {
                ViewData["transportchanged"] = previoustransport + " is replaced with " + model.TransportDetails.TransportCode + " because " + previoustransport + " is acquired by another person";
            }
            TempData["transportcode"] = previoustransport;

            return(View(model));
        }
        public ActionResult Details(string id)
        {
            MainApplication model = new MainApplication()
            {
                SupplierDetails     = new SupplierMaster(),
                SupplierBankDetails = new SupplierBankDetail(),
            };

            int Id = Decode(id);

            model.ItemCategoryList       = _itemcategoryservice.GetAllItemCategories();
            model.userCredentialList     = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist             = _iIModuleService.getAllModules();
            model.SupplierDetails        = _suppliermasterservice.getById(Id);
            model.SupplierBankDetailList = _SupplierBankDetailService.GetDetailsFromBank(model.SupplierDetails.SupplierCode);
            model.CompanyCode            = CompanyCode;
            model.CompanyName            = CompanyName;
            model.FinancialYear          = FinancialYear;

            string previoussupplier = TempData["suppliercode"].ToString();

            if (previoussupplier != model.SupplierDetails.SupplierCode)
            {
                ViewData["supplierchanged"] = previoussupplier + " is replaced with " + model.SupplierDetails.SupplierCode + " because " + previoussupplier + " is acquired by another person";
            }
            TempData["suppliercode"] = previoussupplier;

            return(View(model));
        }
Example #5
0
        public ActionResult Create()
        {
            MainApplication model = new MainApplication();

            model.userCredentialList = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _iIModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;
            return(View(model));
        }
        public ActionResult JobWorkStockReport()
        {
            DatabaseName = CompanyName + " " + FinancialYear;
            MainApplication model = new MainApplication();

            model.userCredentialList = _UserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _ModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;
            return(View(model));
        }
        public ActionResult Create()
        {
            DatabaseName = CompanyName + " " + FinancialYear;
            MainApplication model = new MainApplication();

            model.ItemCategoryList    = _itemcategoryService.GetAllItemCategories();
            model.ItemSubCategoryList = _itemsubcategoryservice.getSubCategory();
            model.StateList           = _StateService.GetAll();
            model.CityList            = _cityservice.getAllCities();
            model.userCredentialList  = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist          = _iIModuleService.getAllModules();
            model.CompanyCode         = CompanyCode;
            model.CompanyName         = CompanyName;
            model.FinancialYear       = FinancialYear;
            return(View(model));
        }
Example #8
0
        public ActionResult Create()
        {
            DatabaseName = CompanyName + " " + FinancialYear;
            MainApplication model = new MainApplication()
            {
                GodownDetails = new GodownMaster(),
            };
            var details = _godownService.getGodownLast();
            int lastid  = 0;
            int length  = 0;

            if (details != null)
            {
                lastid = details.GodownId;
                lastid = lastid + 1;
                length = lastid.ToString().Length;
            }
            else
            {
                lastid = 1;
                length = 1;
            }
            string Godowncode = _utilityService.getName("GD", length, lastid);

            _godownaddresService.DeleteGoDownAddr(Godowncode);
            model.GodownDetails.GdCode = Godowncode;
            //model.CityList = _cityService.getAllCities();

            var EmployeeList = _employeemasterService.getAllemployees();
            List <EmployeeMaster> emplist = new List <EmployeeMaster>();

            foreach (var item in EmployeeList)
            {
                EmployeeMaster empData = new EmployeeMaster();
                empData.Name  = item.Name;
                empData.EmpId = item.EmpId;
                emplist.Add(empData);
            }
            model.EmpList            = emplist;
            model.userCredentialList = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _iIModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;
            return(View(model));
        }
Example #9
0
        public ActionResult UserRights()
        {
            DatabaseName = CompanyName + " " + FinancialYear;
            MainApplication model = new MainApplication()
            {
                EmployeeDetails = new EmployeeMaster(),
                usercredential  = new UserCredential(),
            };

            model.userCredentialList = _iusercredentailservice.GetUserCredentialsByEmail("*****@*****.**");
            model.modulelist         = _iIModuleService.getAllModules();
            model.EmpList            = _iemployeeservice.getActiveEmployee();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;
            return(View(model));
        }
Example #10
0
        public ActionResult StockDistribution()
        {
            DatabaseName = CompanyName + " " + FinancialYear;
            MainApplication model = new MainApplication()
            {
                StockDistributionDetails = new StockDistribution(),
            };

            //CREATE STOCK DISTRIBUTION CODE
            string year = FinancialYear;

            string[] yr    = year.Split(' ', '-');
            string   FinYr = "/" + yr[2].Substring(2) + "-" + yr[6].Substring(2);
            string   stockdistributioncode = string.Empty;

            var StkDisData = _stockdistributionservice.GetLastStockDisByFinYr(FinYr);
            int StkDisVal  = 0;
            int length     = 0;

            if (StkDisData != null)
            {
                stockdistributioncode = StkDisData.StockDistributionCode.Substring(3, 6);
                length    = (Convert.ToInt32(stockdistributioncode) + 1).ToString().Length;
                StkDisVal = Convert.ToInt32(stockdistributioncode) + 1;
            }
            else
            {
                StkDisVal = 1;
                length    = 1;
            }
            stockdistributioncode = _utilityservice.getName("SDS", length, StkDisVal);
            stockdistributioncode = stockdistributioncode + FinYr;
            model.StockDistributionDetails.StockDistributionCode = stockdistributioncode;
            TempData["PreviousStkDisNo"] = stockdistributioncode;

            model.GodownMasterList   = _godownservice.GetGodownNames();
            model.ShopList           = _shopservice.GetAll();
            model.ItemCategoryList   = _itemcategoryservice.GetAllItemCategories();
            model.userCredentialList = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _iIModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;
            return(View(model));
        }
        public ActionResult CreateDiscount()
        {
            DatabaseName = CompanyName + " " + FinancialYear;
            MainApplication model = new MainApplication()
            {
                DiscountMasterDetails = new DiscountMaster(),
            };

            string year = FinancialYear;

            string[] yr       = year.Split(' ', '-');
            string   FinYr    = "/" + yr[2].Substring(2) + "-" + yr[6].Substring(2);
            string   DiscCode = string.Empty;
            var      details  = _DiscountMasterService.GetLastRowrByFinYr(FinYr);
            int      discval  = 0;
            int      length   = 0;

            if (details != null)
            {
                DiscCode = details.DiscountCode.Substring(4, 6);
                length   = (Convert.ToInt32(DiscCode) + 1).ToString().Length;
                discval  = Convert.ToInt32(DiscCode) + 1;
                discval  = details.Id;
                discval  = discval + 1;
                length   = discval.ToString().Length;
            }
            else
            {
                discval = 1;
                length  = 1;
            }
            DiscCode = _UtilityService.getName("DISC", length, discval);
            DiscCode = DiscCode + FinYr;
            model.DiscountMasterDetails.DiscountCode = DiscCode;
            TempData["PreviousDiscountCode"]         = DiscCode;

            model.BrandMasterList    = _BrandMasterService.GetAllBrands();
            model.userCredentialList = _UserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _ModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;
            return(View(model));
        }
        public ActionResult Create()
        {
            MainApplication model = new MainApplication()
            {
                EmployeeDetails = new EmployeeMaster(),
            };
            EmployeeMaster emp    = _EmployeeMasterService.getLastInsertedEmp();
            int            lastid = 0;
            int            length = 0;

            if (emp != null)
            {
                lastid = emp.EmpId;
                lastid = lastid + 1;
                length = lastid.ToString().Length;
            }
            else
            {
                lastid = 1;
                length = 1;
            }
            string catCode = _utilityservice.getName("EMP", length, lastid);

            model.EmployeeDetails.EmployeeCode = catCode;
            TempData["employeecode"]           = catCode;

            string mssgbox = string.Empty;

            model.BloodGroups                     = _BloodGroupService.GetBloodGroup();
            model.totalExpYears                   = _YearExperienceService.GetYearExp();
            model.totalExpmonths                  = _MonthExperienceService.GetMonthExp();
            model.TypeOfSupplierList              = _TypeOfSupplierService.GetTypeOfSuppliers();
            model.StateList                       = _stateService.GetStateByCountry(1);
            model.EmployeeDetails.deptlist        = _departmentservive.getAllDepartments();
            model.EmployeeDetails.DesignationList = _DesignationMasterService.GetDesignations();
            model.EmployeeDetails.BankNameList    = _BankNameService.getAllBankNames();
            model.EmployeeDetails.deptlist        = _departmentservive.getAllDepartments();
            model.userCredentialList              = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist                      = _iIModuleService.getAllModules();
            model.CompanyCode                     = CompanyCode;
            model.CompanyName                     = CompanyName;
            model.FinancialYear                   = FinancialYear;
            return(View(model));
        }
Example #13
0
        public ActionResult Create()
        {
            MainApplication model = new MainApplication()
            {
                DesignDetails = new DesignMaster(),
            };

            string designcode = generateCode();
            int    count      = _DesignService.getDesignsByDesignCode(designcode);

            if (count == 0)
            {
                model.DesignDetails.DesignCode = designcode;
            }
            else
            {
                model.DesignDetails.DesignCode = Convert.ToString(designcode.Reverse());
            }

            //CONCAT CATEGORYCODE AND CATEGORYNAME
            var    namelist             = _ItemCategoryService.GetAllItemCategories();
            string categories           = string.Empty;
            List <ItemCategory> catlist = new List <ItemCategory>();

            foreach (var data in namelist)
            {
                ItemCategory catdata = new ItemCategory();
                categories = data.ItemCategoryCode + "  " + data.CategoryName;
                catdata.ItemCategoryCode = categories;
                catdata.CategoryName     = data.CategoryName;
                catlist.Add(catdata);
                categories = string.Empty;
            }
            model.ItemCategoryList   = catlist;
            model.userCredentialList = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _iIModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;
            return(View(model));
        }
        public ActionResult Create()
        {
            DatabaseName = CompanyName + " " + FinancialYear;
            MainApplication model = new MainApplication()
            {
                ColorCodeDetails = new ColorCode(),
            };

            var details = _ColorCodeService.GetLastColor();

            if (details == null)
            {
                model.ColorCodeDetails.colorCode = "01";
            }
            else
            {
                if (details.colorCode.StartsWith("0"))
                {
                    details.colorCode.Substring(1);
                    model.ColorCodeDetails.colorCode = (Convert.ToInt32(details.colorCode) + 1).ToString();
                    model.ColorCodeDetails.colorCode = "0" + model.ColorCodeDetails.colorCode;
                }
                else
                {
                    model.ColorCodeDetails.colorCode = (Convert.ToInt32(details.colorCode) + 1).ToString();
                }
            }

            if (TempData["ColorList"] != null)
            {
                ViewBag.error = "Color Name Already Present";
            }
            model.userCredentialList = _UserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _ModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;
            return(View(model));
        }
        public ActionResult CreateJobWorkType()
        {
            MainApplication model = new MainApplication()
            {
                JobWorkTypeDetails = new JobWorkType(),
            };

            var details = _JobWorkTypeService.GetLastRow();
            int Typeval = 0;
            int length  = 0;

            if (details != null)
            {
                Typeval = details.Id;
                Typeval = Typeval + 1;
                length  = Typeval.ToString().Length;
            }
            else
            {
                Typeval = 1;
                length  = 1;
            }
            String code = _utilityService.getName("JWT", length, Typeval);

            model.JobWorkTypeDetails.Code   = code;
            TempData["PreviousJobWorkType"] = code;

            if (TempData["TypeList"] != null)
            {
                ViewBag.error = "Type Already Present In Database..";
            }

            model.userCredentialList = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _ModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;
            return(View(model));
        }
Example #16
0
        // CREATE ITEM CATEGORY
        public ActionResult CreateBrand()
        {
            DatabaseName = CompanyName + " " + FinancialYear;
            MainApplication model = new MainApplication()
            {
                BrandMasterDetails = new BrandMaster(),
            };

            var details  = _BrandMasterService.getLastBrand();
            int Brandval = 0;
            int length   = 0;

            if (details != null)
            {
                Brandval = details.Id;
                Brandval = Brandval + 1;
                length   = Brandval.ToString().Length;
            }
            else
            {
                Brandval = 1;
                length   = 1;
            }
            String code = _UtilityService.getName("BRD", length, Brandval);

            model.BrandMasterDetails.BrandCode = code;

            if (TempData["BrandList"] != null)
            {
                ViewBag.error = "Brand Name Already Present";
            }
            model.userCredentialList = _UserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _ModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;
            return(View(model));
        }
        // CREATE DESIGNATION
        public ActionResult CreateDesignation()
        {
            DatabaseName = CompanyName + " " + FinancialYear;
            MainApplication model = new MainApplication()
            {
                DesignationDetails = new DesignationMaster(),
            };

            var details        = _DesignationMasterService.getLastDesignation();
            int Designationval = 0;
            int length         = 0;

            if (details != null)
            {
                Designationval = details.Id;
                Designationval = Designationval + 1;
                length         = Designationval.ToString().Length;
            }
            else
            {
                Designationval = 1;
                length         = 1;
            }
            String code = _UtilityService.getName("DSG", length, Designationval);

            model.DesignationDetails.DesignationCode = code;

            if (TempData["DesignationList"] != null)
            {
                ViewBag.error = "Designation Name Already Present";
            }
            model.userCredentialList = _UserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _ModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;
            return(View(model));
        }
        public ActionResult Create()
        {
            MainApplication model = new MainApplication()
            {
                CommissionMasterDetails = new CommissionMaster()
            };

            var details = _CommissionService.GetLast();
            int lastid  = 0;
            int length  = 0;

            if (details != null)
            {
                lastid = details.CommissionId;
                lastid = lastid + 1;
                length = lastid.ToString().Length;
            }
            else
            {
                lastid = 1;
                length = 1;
            }

            string commcode = _utilityService.getName("CMS", length, lastid);

            model.CommissionMasterDetails.CommissionCode = commcode;
            TempData["commissioncode"] = commcode;

            model.userCredentialList  = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist          = _iIModuleService.getAllModules();
            model.CompanyCode         = CompanyCode;
            model.CompanyName         = CompanyName;
            model.FinancialYear       = FinancialYear;
            model.EmpList             = _EmployeeService.GetEmployeeListBySalesAndTarget();
            model.UnitList            = _UnitService.getallsize();
            model.ItemSubCategoryList = _ItemSubCategoryService.GetItemSubCategories();
            return(View(model));
        }
Example #19
0
        public ActionResult Create()
        {
            DatabaseName = CompanyName + " " + FinancialYear;
            MainApplication model = new MainApplication()
            {
                MaterialDetails = new TypeOfMaterial(),
            };
            var details = _TypeOfMaterialService.GetMaterialLast();
            int matval  = 0;
            int length  = 0;

            if (details != null)
            {
                matval = details.MaterialId;
                matval = matval + 1;
                length = matval.ToString().Length;
            }
            else
            {
                matval = 1;
                length = 1;
            }
            String MaterialCode = _utilityService.getName("TM", length, matval);

            model.MaterialDetails.MaterialCode = MaterialCode;

            if (TempData["MaterialList"] != null)
            {
                ViewBag.error = "Material Name Already Created";
            }

            model.userCredentialList = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _iIModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;
            return(View(model));
        }
Example #20
0
        public ActionResult Details(string id)
        {
            //DatabaseName = "RetailManagement";
            //CompanyName = "RetailManagement";
            //FinancialYear = "RetailManagement";
            DatabaseName  = "A2ZRetail";
            CompanyName   = "A2ZRetail";
            FinancialYear = "A2ZRetail";
            MainApplication model = new MainApplication()
            {
                companydetails = new Company(),
            };
            int Id = Decode(id);

            model.companydetails     = _companyService.getById(Id);
            model.CompanyBankList    = _compbankservice.getBankDetailsByCompanyCode(model.companydetails.CompanyCode);
            model.userCredentialList = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _iIModuleService.getAllModules();
            model.CompanyCode        = (string)HttpContext.Session["CompanyCode"];
            model.CompanyName        = (string)HttpContext.Session["CompanyName"];
            model.FinancialYear      = (string)HttpContext.Session["FinancialYear"];
            return(View(model));
        }
Example #21
0
        public ActionResult IncomeExpenseVoucherEntry()
        {
            MainApplication model = new MainApplication()
            {
                IncomeExpenseVoucherDetails = new IncomeExpenseVoucher(),
            };

            string year = FinancialYear;

            string[] yr    = year.Split(' ', '-');
            string   FinYr = "/" + yr[2].Substring(2) + "-" + yr[6].Substring(2);

            var    details = _IncomeExchangeVoucherService.GetLastRowByFinYr(FinYr);
            string Code    = string.Empty;

            int Typeval = 0;
            int length  = 0;

            if (details != null)
            {
                Code    = details.Code.Substring(4, 6);
                length  = (Convert.ToInt32(Code) + 1).ToString().Length;
                Typeval = Convert.ToInt32(Code) + 1;
            }
            else
            {
                Typeval = 1;
                length  = 1;
            }
            Code = _utilityService.getName("IEVE", length, Typeval);
            Code = Code + FinYr;
            model.IncomeExpenseVoucherDetails.Code = Code;

            //GET LOGIN USER NAME AND EMAIL
            var useremail = HttpContext.Session["UserEmail"].ToString();
            var empname   = _EmployeeMasterService.getEmpByEmail(useremail).Name;

            Session["EmpName"] = empname;

            model.userCredentialList = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _ModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;
            return(View(model));
        }
Example #22
0
        public ActionResult ReplicaCompany()
        {
            MainApplication model = new MainApplication();

            model.CmpList            = new List <Company>();
            model.CmpList            = Session["CompanyList"] as IEnumerable <Company>;
            model.userCredentialList = _UserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _ModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;

            string year = FinancialYear;

            string[] yr = year.Split(' ', '-');

            string   FromFinYr          = yr[0] + "/" + yr[1] + "/" + yr[2];
            string   ToFinYr            = yr[4] + "/" + yr[5] + "/" + yr[6];
            DateTime LoginFromFinYrDate = DateTime.ParseExact(FromFinYr, "dd/MM/yyyy", null).Date;
            DateTime LoginToFinYrDate   = DateTime.ParseExact(ToFinYr, "dd/MM/yyyy", null).Date;

            string[] CompanyNames = new string[model.CmpList.Count()];
            string[] CompanyCodes = new string[model.CmpList.Count()];
            int      count        = 0;

            foreach (var data in model.CmpList)
            {
                if (CompanyName.ToLower() == data.companyName.ToLower() & LoginFromFinYrDate.Date < Convert.ToDateTime(data.FinancialYearFrom).Date & LoginToFinYrDate.Date < Convert.ToDateTime(data.FinancialYearTo).Date & data.Replicated == "No")
                {
                    string CompanyWithFinancial = string.Empty;
                    string Name = data.companyName;
                    CompanyWithFinancial = Name + " " + Convert.ToDateTime(data.FinancialYearFrom).ToString("dd-MM-yyyy") + " To " + Convert.ToDateTime(data.FinancialYearTo).ToString("dd-MM-yyyy");
                    CompanyNames[count]  = CompanyWithFinancial;
                    CompanyCodes[count]  = data.CompanyCode;
                    count++;
                }
            }
            TempData["NewCompanyNames"] = CompanyNames;
            TempData["NewCompanyCodes"] = CompanyCodes;
            TempData["ArrayCount"]      = count;
            return(View(model));
        }
Example #23
0
        public ActionResult CostCodeCreate()
        {
            MainApplication model = new MainApplication();
            //GET LOGIN SHOP DETAILS
            var username = HttpContext.Session["UserName"].ToString();

            // IF EXCEPT SUPERADMIN LOGIN THEN SHOW SHOP OR GODOWN
            if (username != "SuperAdmin")
            {
                string shopcode        = string.Empty;
                int    modulelastcount = _ModuleService.GetLastRow().Id;
                for (int i = 96; i <= modulelastcount; i++)
                {
                    var assigndetails = _UserCredentialService.GetDetailsByEmailStatusAndModuleId(UserEmail, i);
                    if (assigndetails != null)
                    {
                        if (assigndetails.AssignRightsCode.Contains("SH"))
                        {
                            Session["LOGINSHOPGODOWNCODEOWGS"] = assigndetails.AssignRightsCode;
                            Session["SHOPGODOWNNAMEOWGS"]      = assigndetails.Modules;
                        }
                        else
                        {
                            Session["LOGINSHOPGODOWNCODEOWGS"] = assigndetails.AssignRightsCode;
                            Session["SHOPGODOWNNAMEOWGS"]      = assigndetails.Modules;
                        }
                        break;
                    }
                }
            }

            model.userCredentialList = _UserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _ModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;
            return(View(model));
        }
        public ActionResult PurchaseReturn()
        {
            MainApplication model = new MainApplication();

            model.userCredentialList = _UserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _ModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;

            var username = HttpContext.Session["UserName"].ToString();

            if (username != "SuperAdmin")
            {
                int modulelastcount = _ModuleService.GetLastRow().Id;
                for (int i = 96; i <= modulelastcount; i++)
                {
                    var assigndetails = _UserCredentialService.GetDetailsByEmailStatusAndModuleId(UserEmail, i);
                    if (assigndetails != null)
                    {
                        Session["LOGINSHOPGODOWNCODE"] = assigndetails.AssignRightsCode;
                        Session["SHOPGODOWNNAME"]      = assigndetails.Modules;
                        break;
                    }
                }
            }

            string shopcode = Session["LOGINSHOPGODOWNCODE"].ToString();

            string year = FinancialYear;

            string[] yr    = year.Split(' ', '-');
            string   FinYr = "/" + yr[2].Substring(2) + "-" + yr[6].Substring(2);
            var      LastPurchaseReturn   = _PurchaseReturnService.GetLastPurchaseByFinYr(FinYr, shopcode);
            string   PurchaseReturnCode   = string.Empty;
            int      PurchaseReturnLength = 0;
            int      PurchaseReturnNo     = 0;

            if (LastPurchaseReturn == null)
            {
                PurchaseReturnLength = 1;
                PurchaseReturnNo     = 1;
            }
            else
            {
                int PurchaseReturnIndex = LastPurchaseReturn.PurchaseReturnNo.LastIndexOf('P');
                PurchaseReturnCode   = LastPurchaseReturn.PurchaseReturnNo.Substring(PurchaseReturnIndex + 2, 6);
                PurchaseReturnLength = (Convert.ToInt32(PurchaseReturnCode) + 1).ToString().Length;
                PurchaseReturnNo     = Convert.ToInt32(PurchaseReturnCode) + 1;
            }

            string name        = Session["SHOPGODOWNNAME"] as string;
            string utilityname = string.Empty;

            if (shopcode.Contains("SH"))
            {
                var details = _ShopService.GetShopDetailsByName(name);
                utilityname = details.ShortCode + "/PR";
            }
            else
            {
                var details = _GodownService.GetGodownDetailsByName(name);
                utilityname = details.ShortCode + "/PR";
            }
            PurchaseReturnCode     = _UtilityService.getName(utilityname, PurchaseReturnLength, PurchaseReturnNo);
            PurchaseReturnCode     = PurchaseReturnCode + FinYr;
            model.PurchaseReturnNo = PurchaseReturnCode;
            TempData["PreviousPurchaseReturnNo"] = PurchaseReturnCode;

            return(View(model));
        }
        public ActionResult Dashboard()
        {
            //GET LOGIN SHOP DETAILS
            var username = HttpContext.Session["UserName"].ToString();

            // IF EXCEPT SUPERADMIN LOGIN THEN SHOW SHOP OR GODOWN
            if (username != "SuperAdmin")
            {
                int modulelastcount = _iIModuleService.GetLastRow().Id;
                var AssignRights    = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
                if (AssignRights.Count() == 0)
                {
                    TempData["NotEnoughRights"] = "Yes";
                    return(RedirectToAction("Login", "User"));
                }
                else
                {
                    int rightscount = 0;
                    for (int i = 96; i <= modulelastcount; i++)
                    {
                        var assigndetails = _IUserCredentialService.GetDetailsByEmailStatusAndModuleId(UserEmail, i);
                        if (assigndetails != null)
                        {
                            Session["LOGINSHOPGODOWNCODE"] = assigndetails.AssignRightsCode;
                            Session["SHOPGODOWNNAME"]      = assigndetails.Modules;
                            break;
                        }
                        else
                        {
                            rightscount++;
                        }
                    }
                    if (modulelastcount - 96 == rightscount)
                    {
                        Session["LOGINSHOPGODOWNCODE"] = null;
                        Session["SHOPGODOWNNAME"]      = null;
                    }
                }
            }

            MainApplication model = new MainApplication();

            model.userCredentialList = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _iIModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;

            string loggedinshopname = Session["SHOPGODOWNNAME"] as string;

            TempData["PendingPoes"]             = _IPurchaseOrderDetailService.GetPendingPo("Pending");
            TempData["Inward"]                  = _IPurchaseOrderDetailService.GetInwardDetailsByDate();
            TempData["OutwardToShop"]           = _OutwardToShopService.GetDailyOutwardsToShop();
            TempData["OutwardShopToGodown"]     = _OutwardShopToGodownService.GetDailyOutwardsToGodown();
            TempData["OutwardInterGodown"]      = _OutwardInterGodownService.GetDailyOutwardInterGodown();
            TempData["OutwardInterShop"]        = _OutwardInterShopService.GetDailyOutwardInterShop();
            TempData["OutwardToClient"]         = _IOutwardToClientService.GetOutWardToClientByDate();
            TempData["InwardWithoutPO"]         = _InwardFromSupplierService.GetDailyInwardWithoutPo();
            TempData["InwardFromGodown"]        = _InwardFromGodownService.GetDailyInwardsFromGodown();
            TempData["InwardShopToGodown"]      = _InwardFromShopToGodownService.GetDailyInwardsShopToGodown();
            TempData["InwardInterGodown"]       = _InwardInterGodownService.GetDailyInwardInterGodown();
            TempData["InwardInterShop"]         = _InwardInterShopService.GetDailyInwardInterShop();
            TempData["EntryStock"]              = _EntryStockItemService.GetAllItems();
            TempData["ShopStock"]               = _IShopStockService.GetShopStockTillDate();
            TempData["GodownStock"]             = _GodownStockService.GetGodownStockTillDate();
            TempData["RetailBill"]              = _IRetailInvoiceMasterService.GetRetailBillByDate();
            TempData["SalesBill"]               = _ISalesBillService.GetSalesBillByDate();
            TempData["Quotations"]              = _QuotationService.GetDailyQuotations();
            TempData["SalesOrders"]             = _SalesOrderService.GetDailySalesOrders();
            TempData["DeliveryChallans"]        = _DeliveryChallanService.GetDailyChallans();
            TempData["SalesReturns"]            = _SalesReturnService.GetDailySalesReturns();
            TempData["PurchaseReturns"]         = _PurchaseReturnService.GetDailyPurchaseReturns();
            TempData["CashierSalesOrder"]       = _CashierSalesOrderService.GetDailyCashierSalesOrder();
            TempData["CashierRetailBill"]       = _CashierRetailBillService.GetDailyCashierRetailBill();
            TempData["CashierTempCashMemo"]     = _CashierTemporaryCashMemoService.GetDailyCashierTempCashMemo();
            TempData["CashierSalesBill"]        = _CashierSalesBillService.GetDailyCashierSalesBill();
            TempData["CashierRefundOrder"]      = _CashierRefundOrderService.GetDailyCashierRefundOrder();
            TempData["CashHandover"]            = _CashHandoverService.GetDailyCashHandover();
            TempData["CardChequeHandover"]      = _CardChequeHandoverService.GetDailyCardChequeHandover();
            TempData["IncomeExchangeVoucher"]   = _IncomeExchangeVoucherService.GetDailyIncomeExchangeVoucher();
            TempData["Requisitionsshops"]       = _RequisitionForShopService.GetDailyRequisitionsForShops(loggedinshopname);
            TempData["Requisitionsgodowns"]     = _RequisitionForShopService.GetDailyRequisitionsForGodowns(loggedinshopname);
            TempData["Requisitionssuperadmin"]  = _RequisitionForShopService.GetDailyRequisitionsForSuperAdmin(loggedinshopname);
            TempData["Requisitionsgodowns1"]    = _RequisitionForGodownService.GetDailyRequisitionsForGodowns(loggedinshopname);
            TempData["Requisitionssuperadmin1"] = _RequisitionForGodownService.GetDailyRequisitionsForSuperAdmin(loggedinshopname);

            //DASHBOARD FOR LOGIN PERSON FOR EXCEPT SUPERADMIN
            var loginuserdetails = _EmployeeMasterService.getEmpByEmail(UserEmail);

            TempData["EmployeeDesignation"] = loginuserdetails.Designation;
            TempData["EmployeeDepartment"]  = loginuserdetails.department;
            if (loginuserdetails.Designation == "PurchaseManager")
            {
                Session["LOGINSHOPGODOWNCODE"] = "PurchaseManager";
                Session["SHOPGODOWNNAME"]      = "PurchaseManager";
            }
            return(View(model));
        }
        public ActionResult Create()
        {
            MainApplication model = new MainApplication()
            {
                OutwardToTailorDetails = new OutwardToTailor(),
            };

            string year = FinancialYear;

            string[] yr    = year.Split(' ', '-');
            string   FinYr = "/" + yr[2].Substring(2) + "-" + yr[6].Substring(2);

            string OutwardCode = string.Empty;

            var details = _OutwardToTailorService.GetLastRowrByFinYr(FinYr);
            int val     = 0;
            int length  = 0;

            if (details != null)
            {
                OutwardCode = details.OutwardCode.Substring(4, 6);
                length      = (Convert.ToInt32(OutwardCode) + 1).ToString().Length;
                val         = Convert.ToInt32(OutwardCode) + 1;

                val    = details.Id;
                val    = val + 1;
                length = val.ToString().Length;
            }
            else
            {
                val    = 1;
                length = 1;
            }
            OutwardCode = _UtilityService.getName("OWTT", length, val);
            OutwardCode = OutwardCode + FinYr;
            model.OutwardToTailorDetails.OutwardCode = OutwardCode;
            TempData["PreviousOutToTailor"]          = OutwardCode;

            //GET LOGIN SHOP DETAILS
            var username = HttpContext.Session["UserName"].ToString();

            // IF EXCEPT SUPERADMIN LOGIN THEN SHOW SHOP OR GODOWN
            if (username != "SuperAdmin")
            {
                string shopcode        = string.Empty;
                int    modulelastcount = _ModuleService.GetLastRow().Id;
                for (int i = 96; i <= modulelastcount; i++)
                {
                    var assigndetails = _IUserCredentialService.GetDetailsByEmailStatusAndModuleId(UserEmail, i);
                    if (assigndetails != null)
                    {
                        if (assigndetails.AssignRightsCode.Contains("SH"))
                        {
                            Session["LOGINSHOPGODOWNCODEOWGS"] = assigndetails.AssignRightsCode;
                            Session["SHOPGODOWNNAMEOWGS"]      = assigndetails.Modules;
                        }
                        else
                        {
                            Session["LOGINSHOPGODOWNCODEOWGS"] = assigndetails.AssignRightsCode;
                            Session["SHOPGODOWNNAMEOWGS"]      = assigndetails.Modules;
                        }
                        break;
                    }
                }
            }

            model.userCredentialList = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _ModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;
            model.RetailBillList     = _RetailBillService.GetAll();
            model.JobWorkerList      = _JobWorkerService.GetAll();
            return(View(model));
        }
Example #27
0
        public ActionResult CreateBillPayment()
        {
            MainApplication model = new MainApplication()
            {
                BillPaymentDetails = new BillPayment(),
            };

            var details = _BillPaymentService.GetLastRow();
            int val     = 0;
            int length  = 0;

            if (details != null)
            {
                val    = details.Id;
                val    = val + 1;
                length = val.ToString().Length;
            }
            else
            {
                val    = 1;
                length = 1;
            }
            String code = _utilityservice.getName("BP", length, val);

            model.BillPaymentDetails.BillPaymentCode = code;

            //GET LOGIN SHOP DETAILS
            var username = HttpContext.Session["UserName"].ToString();

            // IF EXCEPT SUPERADMIN LOGIN THEN SHOW SHOP OR GODOWN
            if (username != "SuperAdmin")
            {
                string shopcode        = string.Empty;
                int    modulelastcount = _iIModuleService.GetLastRow().Id;
                for (int i = 96; i <= modulelastcount; i++)
                {
                    var assigndetails = _IUserCredentialService.GetDetailsByEmailStatusAndModuleId(UserEmail, i);
                    if (assigndetails != null)
                    {
                        if (assigndetails.AssignRightsCode.Contains("SH"))
                        {
                            Session["LOGINSHOPGODOWNCODEOWGS"] = assigndetails.AssignRightsCode;
                            Session["SHOPGODOWNNAMEOWGS"]      = assigndetails.Modules;
                        }
                        else
                        {
                            Session["LOGINSHOPGODOWNCODEOWGS"] = assigndetails.AssignRightsCode;
                            Session["SHOPGODOWNNAMEOWGS"]      = assigndetails.Modules;
                        }
                        break;
                    }
                }
            }

            model.userCredentialList = _IUserCredentialService.GetUserCredentialsByEmail(UserEmail);
            model.modulelist         = _iIModuleService.getAllModules();
            model.CompanyCode        = CompanyCode;
            model.CompanyName        = CompanyName;
            model.FinancialYear      = FinancialYear;
            return(View(model));
        }