public ActionResult AddCustomer(Pastel.Evolution.Customer obj)
 {
     try
     {
         SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
         EvolutionSDK objEvol  = EvolutionSDKInstance(SessLogObj);
         string       strxml   = null;
         var          dbresult = objEvol.customerList("cIDNumber = '" + obj.IDNumber + "'");
         if (dbresult == null)
         {
             obj    = objEvol.addCustomer(obj);
             strxml = (obj != null && obj.Code != "")
             ? "<SYSMSGS><ID>1</ID><ERRORMSGS>Succefully Added</ERRORMSGS><TYPE>S</TYPE><TITLE>Customer</TITLE><EXTRA>" + obj.Code + "</EXTRA></SYSMSGS>"
             : "<SYSMSGS><ID>-1</ID><ERRORMSGS>Error In Adding Record</ERRORMSGS><TYPE>E</TYPE><TITLE>Customer</TITLE><EXTRA>" + obj.Code + "</EXTRA></SYSMSGS>";
         }
         else
         {
             strxml = "<SYSMSGS><ID>-1</ID><ERRORMSGS>Customer With This National Id Already Exist !</ERRORMSGS><TYPE>W</TYPE><TITLE>Warning !</TITLE></SYSMSGS>";
         }
         objRes = objRes.ReadBIErrors(strxml);
         return(Json(objRes, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 2
0
        // GET: Home
        public ActionResult Index(int Id)
        {
            SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
            try
            {
                DataModel.Company.Company        obj     = new DataModel.Company.Company();
                List <DataModel.Company.Company> objList = obj.getCompany(Id, "", "", "", Convert.ToInt32(SessLogObj.USERID));
                SessLogObj.objComp = objList != null?objList.FirstOrDefault() : null;

                Session["SessionInformation"] = SessLogObj;

                //Form setializing user object and encrypting
                string userData = JsonConvert.SerializeObject(SessLogObj);
                FormsAuthenticationTicket authTicket = new FormsAuthenticationTicket(1, SessLogObj.USERNAME, DateTime.Now, DateTime.Now.AddDays(1), false, userData);
                string     encTicket = FormsAuthentication.Encrypt(authTicket);
                HttpCookie faCookie  = new HttpCookie(FormsAuthentication.FormsCookieName, encTicket);
                //faCookie.Expires = authTicket.Expiration; // comment for use as non persistence cookie
                Response.Cookies.Add(faCookie);
            }
            catch (Exception ex)
            {
                throw;
            }
            return(View());
        }
Esempio n. 3
0
        public ActionResult DefaultLogin(LoginModels objLogin)
        {
            try
            {
                Response.Cookies["RememberMe"].Value = objLogin.rememberMe.ToString();
                if (objLogin.rememberMe)
                {
                    var userencrypt = string.Join(",", objLogin.userName, objLogin.password, objLogin.rememberMe);
                    Response.Cookies["rem_user"].Expires = DateTime.Now.AddDays(30);
                    Response.Cookies["rem_user"].Value   = objLogin.Encryptdata(userencrypt);

                    Response.Cookies["RememberMe"].Expires = DateTime.Now.AddDays(30);
                    Response.Cookies["RememberMe"].Value   = objLogin.rememberMe.ToString();
                }
                else
                {
                    Response.Cookies["rem_user"].Expires   = DateTime.Now.AddDays(-1);
                    Response.Cookies["RememberMe"].Expires = DateTime.Now.AddDays(-1);
                }


                if (ModelState.IsValid)
                {
                    LoginModels obj = new LoginModels();


                    obj = obj.getLoginInfo(objLogin);

                    if (obj != null)
                    {
                        LoginSessionDetails objLogSession = new LoginSessionDetails();
                        objLogSession.objLoginM       = obj;
                        Session["SessionInformation"] = objLogSession;
                        if (obj.IsAdmin)
                        {
                            return(RedirectToAction("Admin", "Account", new { returnUrl = (this.HttpContext.Request).Path }));
                        }
                        else
                        {
                            return(RedirectToAction("Index", "Account", new { returnUrl = (this.HttpContext.Request).Path }));
                        }
                    }
                    else
                    {
                        ModelState.AddModelError("ErrorMgr", "Invalid Agent or Password!");
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(View(objLogin));
        }
Esempio n. 4
0
 public ActionResult AddRate(DataModel.Master.RateMaster obj)
 {
     try
     {
         SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
         objRes = obj.Save(obj, Convert.ToInt32(SessLogObj.USERID), SessLogObj.objComp.COMPID);
         return Json(objRes, JsonRequestBehavior.AllowGet);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public ActionResult AddPaySlipMapping(DataModel.Master.EmployeePaySlipMapping obj)
 {
     try
     {
         SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
         objRes     = obj.Save(obj, Convert.ToInt32(SessLogObj.USERID));
         return(Json(objRes, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public ActionResult EditCustomer(string code)
 {
     try
     {
         SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
         EvolutionSDK objEvol = EvolutionSDKInstance(SessLogObj);
         Pastel.Evolution.Customer objcust = objEvol.getCustomer(code);
         return(PartialView(objcust));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public JsonResult CheckCustomerUnique(string nationalId)
 {
     try
     {
         SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
         EvolutionSDK objEvol  = EvolutionSDKInstance(SessLogObj);
         var          dbresult = objEvol.customerList();
         return(Json(dbresult, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 8
0
 public ActionResult EditUser(int Id)
 {
     try
     {
         SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
         DataModel.userMaster        obj       = new DataModel.userMaster();
         List <DataModel.userMaster> modelList = obj.getUserList(Id, "", "");
         return(PartialView((modelList != null && modelList.Count > 0) ? modelList.FirstOrDefault() : null));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Esempio n. 9
0
 public JsonResult CompanyList()
 {
     try
     {
         SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
         DataModel.Company.Company        obj     = new DataModel.Company.Company();
         List <DataModel.Company.Company> objList = obj.getCompany(0, "", "", "", Convert.ToInt32(SessLogObj.USERID));
         return(Json(objList, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 10
0
 public ActionResult GetPayFrequency()
 {
     try
     {
         SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
         DataModel.Company.Company        obj     = new DataModel.Company.Company();
         List <DataModel.Company.Company> objList = obj.getPayFrequency(SessLogObj.objComp.COMPID, 0);
         return(PartialView((objList != null && objList.Count > 0) ? objList.FirstOrDefault() : null));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public ActionResult EmpPaySlip(List <ProcessPayslip> objList)
 {
     try
     {
         SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
         ProcessPayslip obj = new ProcessPayslip();
         objRes = obj.Save(objList, SessLogObj.objComp.COMPID, Convert.ToInt32(SessLogObj.USERID));
         return(Json(objRes, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public ActionResult EditPaySlipMapping(int Id)
 {
     try
     {
         SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
         DataModel.Master.EmployeePaySlipMapping        obj       = new DataModel.Master.EmployeePaySlipMapping();
         List <DataModel.Master.EmployeePaySlipMapping> modelList = obj.getEmployeePaySlipMapping(Id, 0, Convert.ToInt32(SessLogObj.USERID));
         return(PartialView((modelList != null && modelList.Count > 0) ? modelList.FirstOrDefault() : null));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
 public ActionResult CustomerListJson()
 {
     try
     {
         SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
         EvolutionSDK objEvol  = EvolutionSDKInstance(SessLogObj);
         var          dbresult = objEvol.customerList();
         return(Json(new { aaData = dbresult }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 14
0
 public ActionResult UserIndex()
 {
     try
     {
         SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
         DataModel.userMaster        obj     = new DataModel.userMaster();
         List <DataModel.userMaster> objList = obj.getLKUserList(Convert.ToInt32(SessLogObj.USERID));
         return(View(objList));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 15
0
 public ActionResult Index()
 {
     try
     {
         SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
         DataModel.Company.Company        obj     = new DataModel.Company.Company();
         List <DataModel.Company.Company> objList = obj.getCompany(0, "", "", "", Convert.ToInt32(SessLogObj.USERID));
         return(View(objList));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 16
0
 public ActionResult EditRate(int Id)
 {
     try
     {
         SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
         DataModel.Master.RateMaster obj = new DataModel.Master.RateMaster();
         List<DataModel.Master.RateMaster> modelList = obj.getRatemaster(Id, "", Convert.ToInt32(SessLogObj.objComp.COMPID), 0, Convert.ToInt32(SessLogObj.USERID));
         return PartialView((modelList != null && modelList.Count > 0) ? modelList.FirstOrDefault() : null);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
 //Action to fill itemtype select2
 public JsonResult _FillControlNo(int CONTROLENO, string DESCRIPTION)
 {
     try
     {
         SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
         DataModel.CommonModel.CommonLibrary objCommon = new DataModel.CommonModel.CommonLibrary(SessLogObj.objDb.DbConStr);
         var data = objCommon.FillCONTROLNO(CONTROLENO, DESCRIPTION == null?"":DESCRIPTION, SessLogObj.objAgent.ID);
         return(Json(data, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Esempio n. 18
0
 // GET: Pet
 public ActionResult PetList(string custCode)
 {
     try
     {
         SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
         DataModel.Master.pet objp = new DataModel.Master.pet();
         var dbresult = objp.getPetList(0, 0, "", custCode, SessLogObj.objDb.BranchId, SessLogObj.objAgent.ID);
         return(Json(new { aaData = dbresult }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 19
0
 public ActionResult EditCompany(int Id)
 {
     try
     {
         SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
         DataModel.Company.Company        obj       = new DataModel.Company.Company();
         List <DataModel.Company.Company> modelList = obj.getCompany(Id, "", "", "", Convert.ToInt32(SessLogObj.USERID));
         return(PartialView((modelList != null && modelList.Count > 0) ? modelList.FirstOrDefault() : null));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
 public ActionResult Index()
 {
     try
     {
         SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
         DataModel.Master.Employee        obj     = new DataModel.Master.Employee();
         List <DataModel.Master.Employee> objList = obj.getEmployee(0, "", Convert.ToInt32(SessLogObj.objComp.COMPID), "", Convert.ToInt32(SessLogObj.USERID));
         return(View(objList));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public ActionResult GetEmpPaySlip(int Id)
 {
     try
     {
         SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
         ProcessPayslip        obj       = new ProcessPayslip();
         List <ProcessPayslip> modelList = obj.getEmpCurrentPaySlip(Convert.ToInt64(Id), Convert.ToInt64(SessLogObj.objComp.COMPID), Convert.ToInt32(SessLogObj.USERID));
         return(PartialView((modelList != null && modelList.Count > 0) ? modelList: null));
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Esempio n. 22
0
        public ActionResult Admin()
        {
            try
            {
                SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
                dbConfig obj = new dbConfig();

                List <dbConfig> objListdbConfig = obj.getdbList(0, "", SessLogObj.objLoginM.UserId, 1);
                return(View(objListdbConfig));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        //Action to fill itemtype select2
        public JsonResult _PriceList(int id, string description)
        {
            try
            {
                SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
                DataModel.CommonModel.CommonLibrary objCommon = new DataModel.CommonModel.CommonLibrary(SessLogObj.objDb.DbConStr);
                var data = objCommon.fillPriceList(SessLogObj.objDb.DbConStr, SessLogObj.objDb.DbCommonConStr, SessLogObj.objDb.SerialNumber, SessLogObj.objDb.AuthCode);

                return(Json(data, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                throw;
            }
        }
 // GET: PaySlipEmpMap
 public ActionResult PaySlipEmpMapIndex(int Id)
 {
     try
     {
         SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
         DataModel.Master.EmployeePaySlipMapping        obj     = new DataModel.Master.EmployeePaySlipMapping();
         List <DataModel.Master.EmployeePaySlipMapping> objList = obj.getEmployeePaySlipMapping(0, Id, Convert.ToInt32(SessLogObj.USERID));
         ViewBag.EMPID = Id;
         return(View(objList));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public ActionResult CustomerList(string searchtext = null, int PageNo = 1)
 {
     try
     {
         SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
         EvolutionSDK objEvol  = EvolutionSDKInstance(SessLogObj);
         string       criteria = searchtext != null && searchtext != "" ? "Account like '%" + searchtext + "%' OR Name like '%" + searchtext + "%'" : "1=1";
         var          dbresult = objEvol.customerList(criteria);
         return(PartialView(dbresult));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 26
0
        private EvolutionSDK EvolutionSDKInstance(LoginSessionDetails SessLogObj)
        {
            string       DbConStr       = SessLogObj != null ? SessLogObj.objDb.DbConStr : "";
            string       DbCommonConStr = SessLogObj != null ? SessLogObj.objDb.DbCommonConStr : "";
            string       SerialNumber   = SessLogObj != null ? SessLogObj.objDb.SerialNumber : "";
            string       AuthCode       = SessLogObj != null ? SessLogObj.objDb.AuthCode : "";
            int          branchId       = SessLogObj != null ? SessLogObj.objDb.BranchId : 0;
            EvolutionSDK obj            = new EvolutionSDK(DbConStr,
                                                           DbCommonConStr,
                                                           SerialNumber,
                                                           AuthCode,
                                                           branchId,
                                                           SessLogObj.objAgent);

            return(obj);
        }
        public JsonResult Delete(int Id)
        {
            try
            {
                SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
                DataModel.Master.EmployeePaySlipMapping obj = new DataModel.Master.EmployeePaySlipMapping();
                obj.IFLAG   = "D";
                obj.MID     = Id;
                obj.FORMULA = "";

                objRes = obj.Save(obj, Convert.ToInt32(SessLogObj.USERID));
                return(Json(objRes, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public ActionResult EditCustomer(Pastel.Evolution.Customer obj)
        {
            try
            {
                SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
                EvolutionSDK objEvol = EvolutionSDKInstance(SessLogObj);
                obj = objEvol.editCustomer(obj);
                string strxml =
                    (obj != null && obj.Code != "")
                    ? "<SYSMSGS><ID>1</ID><ERRORMSGS>Succefully Added</ERRORMSGS><TYPE>S</TYPE><TITLE>Pet</TITLE></SYSMSGS>"
                    : "<SYSMSGS><ID>-1</ID><ERRORMSGS>Error In Ading Record</ERRORMSGS><TYPE>E</TYPE><TITLE>Pet</TITLE></SYSMSGS>";

                Result rseXml = objRes.ReadBIErrors(strxml);
                return(Json(rseXml, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        void IAuthorizationFilter.OnAuthorization(AuthorizationContext filterContext)
        {
            try
            {
                LoginModels objLog      = new LoginModels();
                object      UserSession = filterContext.RequestContext.HttpContext.Session["SessionInformation"];

                if (UserSession == null || ((LoginSessionDetails)UserSession).USERID == 0)
                {
                    if (HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName] != null)
                    {
                        filterContext.HttpContext.Session.RemoveAll();
                        HttpCookie authCookie = HttpContext.Current.Request.Cookies[FormsAuthentication.FormsCookieName];
                        FormsAuthenticationTicket authTicket     = FormsAuthentication.Decrypt(authCookie.Value);
                        LoginSessionDetails       serializeModel = JsonConvert.DeserializeObject <LoginSessionDetails>(authTicket.UserData);
                        if (serializeModel.USERID > 0)
                        {
                            filterContext.HttpContext.Session["SessionInformation"] = serializeModel;
                        }
                        else
                        {
                            UrlHelper h = new UrlHelper(HttpContext.Current.Request.RequestContext);
                            filterContext.Result = new RedirectResult(h.Action("DefaultLogin", "Account").ToString());
                        }
                    }
                    else
                    {
                        UrlHelper h = new UrlHelper(HttpContext.Current.Request.RequestContext);
                        filterContext.Result = new RedirectResult(h.Action("DefaultLogin", "Account").ToString());
                    }
                }
            }
            catch (Exception ex)
            {
                UrlHelper h = new UrlHelper(HttpContext.Current.Request.RequestContext);
                filterContext.Result = new RedirectResult(h.Action("DefaultLogin", "Account").ToString());
            }
        }
Esempio n. 30
0
        public ActionResult LogOff()
        {
            SessLogObj = (LoginSessionDetails)HttpContext.Session["SessionInformation"];
            this.Response.Cookies["rem_user"].Expires   = DateTime.Now.AddDays(-1);
            this.Response.Cookies["RememberMe"].Expires = DateTime.Now.AddDays(-1);
            this.Response.Cookies["RememberMe"].Value   = "False";
            this.Response.Cookies["rem_user"].Value     = "False";
            this.Response.Cookies.Remove("rem_user");
            this.Response.Cookies.Remove("RememberMe");


            if (Request.Cookies["RememberMe"] != null)
            {
                var c = new HttpCookie("RememberMe");
                c.Expires = DateTime.Now.AddDays(-1);
                Response.Cookies.Add(c);
            }

            if (Request.Cookies["rem_user"] != null)
            {
                var c = new HttpCookie("rem_user");
                c.Expires = DateTime.Now.AddDays(-1);
                Response.Cookies.Add(c);
            }

            if (Request.Cookies["ASP.NET_SessionId"] != null)
            {
                var c = new HttpCookie("ASP.NET_SessionId");
                c.Expires = DateTime.Now.AddDays(-1);
                Response.Cookies.Add(c);
            }
            //Result rseXml = objLog.LOGOUT(SessLogObj.LOGINLOGID, SessLogObj.LOGXML);

            Session.RemoveAll();
            FormsAuthentication.SignOut();
            return(RedirectToAction("Login", "Account"));
        }