public JsonResult JsonCheckEmail(tblCustomerDetails input)
        {
            BLManageUser manageuserBL = new BLManageUser();

            var  result = manageuserBL.Emailexists(input.EmailAddress);
            if (result == 1)
                return Json( false,JsonRequestBehavior.AllowGet);

            return Json(true,JsonRequestBehavior.AllowGet); ;
        }
        public ActionResult Staff(tblCustomerDetails customerdetail)
        {
            try
            {
                BLManageStaff staffBL = new BLManageStaff();
                staffBL.SetUsers(customerdetail);
            }
            catch
            {
                ModelState.AddModelError("", "Error occurred durung Staff Information save.");
                return Json(new { errors = KeyValue.GetErrorsFromModelState(ViewData) });
            }

            return Json(new { success = true, CustomerID = SessionHelper.UserSession.CustomerID });
        }
예제 #3
0
        public List<tblCustomerDetails> GetUsers(int roleID, int pageNumber, int pageSize, int sortColumnIndex, string sortOrder, string searchText, ref int totalRecords)
        {
            List<tblCustomerDetails> lstCustomerDetail = new List<tblCustomerDetails>();

            int errNum = 0;
            string errDesc = "";

            DataAccess.resetParams();

            DataAccess.addSqlParam("@pageNumber", ParameterDirection.Input, 16, MySqlDbType.Int32, pageNumber);
            DataAccess.addSqlParam("@pageRecord", ParameterDirection.Input, 16, MySqlDbType.Int32, pageSize);
            DataAccess.addSqlParam("@sortColumnIndex", ParameterDirection.Input, 16, MySqlDbType.Int32, sortColumnIndex);
            DataAccess.addSqlParam("@searchOrder", ParameterDirection.Input, 4, MySqlDbType.VarChar, sortOrder);
            DataAccess.addSqlParam("@searchText", ParameterDirection.Input, 100, MySqlDbType.VarChar, searchText);
            DataAccess.addSqlParam("@roleID", ParameterDirection.Input, 16, MySqlDbType.Int32, roleID);

            DataSet ds = DataAccess.ExecuteDataSet(GET_USERS, ref errNum, ref errDesc);
            tblCustomerDetails customer = new tblCustomerDetails();

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                DataTable dtContact = ds.Tables[0];
                totalRecords = Common.ConvertToInt(ds.Tables[1].Rows[0], "TotalRecords");
                if (dtContact != null && dtContact.Rows.Count > 0)
                {
                    foreach (DataRow dr in dtContact.Rows)
                    {
                        customer = new tblCustomerDetails();
                        customer.CustomerID = Common.ConvertToInt(dr, "CustomerID");
                        customer.CustomerName = Common.ConvertToString(dr, "CustomerName");
                        customer.EmailAddress = Common.ConvertToString(dr, "EmailAddress");
                        customer.CustomerContactName = Common.ConvertToString(dr, "CustomerContactName");
                        customer.Password = Common.ConvertToString(dr, "Password");
                        customer.TimeZone = new TimeZoneFX();
                        customer.TimeZone.ID = Common.ConvertToInt(dr, "TimeZone");
                        customer.TimeZone.Name = LookUpValue.GetTimeZone(customer.TimeZone.ID.Value);
                        customer.NOCCommunication = new NOCCommunicationBy();
                        customer.NOCCommunication.ID = Common.ConvertToInt(dr, "NOCCommunicationBy");
                        customer.NOCCommunication.Name = LookUpValue.GetNOCCommunicationBy(customer.NOCCommunication.ID.Value);
                        lstCustomerDetail.Add(customer);
                    }
                }
            }

            return lstCustomerDetail;
        }
        public ActionResult User(tblCustomerDetails customerdetail)
        {
            try
            {
                BLManageUser customerBL = new BLManageUser();
                customerBL.SetUsers(customerdetail);
                SessionHelper.UserSession.Name = customerdetail.CustomerName;
            }
            catch
            {
                ModelState.AddModelError("", "Error occurred while updating profile update.");
                return Json(new { errors = KeyValue.GetErrorsFromModelState(ViewData) });
            }

            UrlHelper u = new UrlHelper(HttpContext.Request.RequestContext);
            string url = u.Action("Index", "Search", null);

            return Json(new { success = true, redirect = url });
        }
예제 #5
0
        public tblCustomerDetails GetStaff(int CustomerID)
        {
            int errorNum = 0;
            string errorDesc = "";
            DataAccess.resetParams();
            DataAccess.addSqlParam("@CustomerID", ParameterDirection.Input, 16, MySqlDbType.Int32, CustomerID);
            DataSet ds = DataAccess.ExecuteDataSet(GET_STAFFID, ref errorNum, ref errorDesc);

            tblCustomerDetails customerDetails = new tblCustomerDetails();
            if (ds != null && ds.Tables.Count > 0)
            {
                DataTable dtCutomer = ds.Tables[0];
                if (dtCutomer != null && dtCutomer.Rows.Count > 0)
                {
                    DataRow dr = dtCutomer.Rows[0];
                    customerDetails.CustomerID = Common.ConvertToInt(dr, "CustomerID");
                    customerDetails.CustomerName = Common.ConvertToString(dr, "CustomerName");
                    customerDetails.EmailAddress = Common.ConvertToString(dr, "EmailAddress");
                    customerDetails.Password = Common.ConvertToString(dr, "Password");
                }
            }
            return customerDetails;
        }
        public JsonResult CustomerInformation(tblCustomerDetails customerDetails)
        {
            try
            {
                BLCustomer customerBL = new BLCustomer();
                customerDetails.CustomerID = SessionHelper.UserSession.CustomerID;
                customerBL.SaveCustomer(customerDetails);
            }
            catch
            {
                ModelState.AddModelError("", "Error occurred durung Customer Information save.");
                return Json(new { errors = KeyValue.GetErrorsFromModelState(ViewData) });
            }

            return Json(new { success = true, CustomerID = SessionHelper.UserSession.CustomerID, Tab = "CI" });
        }
예제 #7
0
        public int SetUsers(tblCustomerDetails CustomerDetails)
        {
            int errorNum = 0;
            string errorDesc = "";
            DataAccess.resetParams();
            DataAccess.addSqlParam("@CustomerID", ParameterDirection.Input, 16, MySqlDbType.Int32, CustomerDetails.CustomerID);
            DataAccess.addSqlParam("@CustomerName", ParameterDirection.Input, 100, MySqlDbType.VarChar, CustomerDetails.CustomerName);
            DataAccess.addSqlParam("@EmailAddress", ParameterDirection.Input, 150, MySqlDbType.VarChar, CustomerDetails.EmailAddress);
            DataAccess.addSqlParam("@Password", ParameterDirection.Input, 150, MySqlDbType.VarChar, CustomerDetails.Password);
            DataAccess.addSqlParam("@CustomerContactName", ParameterDirection.Input, 100, MySqlDbType.VarChar, CustomerDetails.CustomerContactName);
            DataAccess.addSqlParam("@TimeZone", ParameterDirection.Input, 16, MySqlDbType.Int32, CustomerDetails.TimeZone == null ? 0 : CustomerDetails.TimeZone.ID);
            DataAccess.addSqlParam("@NOCCommunicationBy", ParameterDirection.Input, 16, MySqlDbType.Int32, CustomerDetails.NOCCommunication == null ? 0 : CustomerDetails.NOCCommunication.ID);
            DataAccess.addSqlParam("@RoleID", ParameterDirection.Input, 16, MySqlDbType.Int32, CustomerDetails.RoleID);
            DataAccess.addSqlParam("@Isactive", ParameterDirection.InputOutput, 16, MySqlDbType.Int16,1);
            DataAccess.addSqlParam("@Identity", ParameterDirection.InputOutput, 16, MySqlDbType.Int32);
            DataAccess.ExecuteNonQuery(SET_USERS, ref errorNum, ref errorDesc);

            return Common.ConvertToInt(DataAccess.getSQLParam("@Identity").ToString());
        }
        public ActionResult User(tblCustomerDetails customerdetail)
        {
            try
            {
                string submitButtonID = Request["SubmitButtonID"].ToString();
                BLManageUser customerBL = new BLManageUser();
                customerBL.SetUsers(customerdetail);
                if (submitButtonID == "SbmtEmail")
                    Common.SendMail(customerdetail.EmailAddress, "Please login in flexis system with below credentials", "User Name: " + customerdetail.EmailAddress + ", " + "Password: "******"", "Error occurred durung Customer Information save.");
                return Json(new { errors = KeyValue.GetErrorsFromModelState(ViewData) });
            }

            return Json(new { success = true, CustomerID = SessionHelper.UserSession.CustomerID, Tab = "CI" });
        }
예제 #9
0
        public tblCustomerDetails GetCustomer(int CustomerID)
        {
            int errorNum = 0;
            string errorDesc = "";
            DataAccess.resetParams();
            DataAccess.addSqlParam("@CustomerID", ParameterDirection.Input, 16, MySqlDbType.Int32, CustomerID);
            DataSet ds = DataAccess.ExecuteDataSet(GET_CUSTOMER, ref errorNum, ref errorDesc);

            tblCustomerDetails customerDetails = new tblCustomerDetails();
            if (ds != null && ds.Tables.Count > 0)
            {
                DataTable dtCutomer = ds.Tables[0];
                if (dtCutomer != null && dtCutomer.Rows.Count > 0)
                {
                    DataRow dr = dtCutomer.Rows[0];
                    customerDetails.CustomerID = Common.ConvertToInt(dr, "CustomerID");
                    customerDetails.RoleID = Common.ConvertToInt(dr, "RoleID");
                    customerDetails.IsActive = Common.ConvertToInt(dr, "Isactive");
                    customerDetails.CustomerName = Common.ConvertToString(dr, "CustomerName");
                    customerDetails.EmailAddress = Common.ConvertToString(dr, "EmailAddress");
                    customerDetails.CustomerContactName = Common.ConvertToString(dr, "CustomerContactName");
                    customerDetails.Password = Common.ConvertToString(dr, "Password");
                    customerDetails.TimeZone = new TimeZoneFX();
                    customerDetails.TimeZone.ID = Common.ConvertToInt(dr, "TimeZone");
                    customerDetails.TimeZone.Name = LookUpValue.GetTimeZone(customerDetails.TimeZone.ID.Value);
                    customerDetails.NOCCommunication = new NOCCommunicationBy();
                    customerDetails.NOCCommunication.ID = Common.ConvertToInt(dr, "NOCCommunicationBy");
                }
            }
            return customerDetails;
        }