Example #1
0
 /// <summary>
 /// 修改用户密码
 /// </summary>
 /// <param name="username">用户姓名</param>
 /// <param name="password">用户密码</param>
 /// <returns></returns>
 public static bool ModifyPassword(String username, String password)
 {
     try
     {
         return(DAL_Customer.UpdatePassword(username, password));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Example #2
0
 /// <summary>
 /// 用户登录
 /// </summary>
 /// <param name="username">用户名</param>
 /// <param name="password">密码</param>
 /// <returns></returns>
 public static bool Login(String username, String password)
 {
     try
     {
         return(DAL_Customer.QueryCustomerExists(username, password));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Example #3
0
 /// <summary>
 /// 用户删除
 /// </summary>
 /// <param name="name">用户姓名</param>
 /// <returns></returns>
 public static bool DeleteByName(String name)
 {
     try
     {
         return(DAL_Customer.DeleteCustomer(name));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Example #4
0
 /// <summary>
 /// 用户注册
 /// </summary>
 /// <param name="name">Name</param>
 /// <param name="pass">Pass</param>
 /// <param name="question">Question</param>
 /// <param name="answer">Answer</param>
 /// <returns>bool</returns>
 public static bool Register(Customer customer)
 {
     try
     {
         return(DAL_Customer.AddCustomer(customer.Name, customer.Pass, customer.Question, customer.Answer));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Example #5
0
 /// <summary>
 /// 用户注册判断用户是否存在
 /// </summary>
 /// <param name="name">Name</param>
 /// <returns>bool</returns>
 public static bool QueryCustomerExits(string name)
 {
     try
     {
         return(DAL_Customer.QueryCustomerExists(name));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Example #6
0
 /// <summary>
 /// 查询所有用户收货信息与个人信息(管理功能)
 /// </summary>
 /// <returns>DataSet 或 null</returns>
 public static DataSet QueryAllCustomer()
 {
     try
     {
         return(DAL_Customer.QueryAllCustomer());
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Example #7
0
 /// <summary>
 /// 查询一个用户的个人信息
 /// </summary>
 /// <param name="name">Name</param>
 /// <returns>Customer 或 null</returns>
 public static Customer QueryCustomerPersonalInfo(string name)
 {
     try
     {
         return(DAL_Customer.QueryCustomerPersonalInfo(name));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Example #8
0
 /// <summary>
 /// 修改密保问题
 /// </summary>
 /// <param name="name">Name</param>
 /// <param name="question">Question</param>
 /// <param name="answer">Answer</param>
 /// <returns>bool</returns>
 public static bool ModifyQuestion(string name, string question, string answer)
 {
     try
     {
         return(DAL_Customer.UpdateQuestion(name, question, answer));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Example #9
0
 /// <summary>
 /// 修改个人信息
 /// </summary>
 /// <param name="name">Name</param>
 /// <param name="birthday">Birthday</param>
 /// <param name="phone">Phone</param>
 /// <param name="email">Email</param>
 /// <returns>bool</returns>
 public static bool ModifyPersonalInfo(string name, string birthday, string phone, string email)
 {
     try
     {
         return(DAL_Customer.UpdatePersonalInfo(name, birthday, phone, email));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Example #10
0
 /// <summary>
 /// 修改收货信息
 /// </summary>
 /// <param name="name">Name</param>
 /// <param name="trueName">TrueName</param>
 /// <param name="address">Address</param>
 /// <param name="postCode">PostCode</param>
 /// <returns>bool</returns>
 public static bool ModifyPostInfo(string name, string trueName, string address, string postCode)
 {
     try
     {
         return(DAL_Customer.UpdatePostInfo(name, trueName, address, postCode));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Example #11
0
        public long UpdateCutsomer(CustomerData customerData, UserOpMap userOpMap)
        {
            DAL_Customer dAL_Customer = new DAL_Customer();
            Customer     customer     = new Customer();

            customer.Id             = customerData.Id;
            customer.EmailId        = customerData.EmailID;
            customer.AddressLineOne = customerData.Addr1;
            customer.AddressLineTwo = customerData.Addr2;
            customer.ContactNumber  = Convert.ToInt64(customerData.ContactNumber);
            customer.City           = customerData.City;
            customer.State          = customerData.State;
            customer.UpdatedOn      = DateTime.Now;
            customer.Updatedby      = Convert.ToInt64(userOpMap.UserID);
            customer.CustomerTypeId = Convert.ToInt32(customerData.Type);

            return(dAL_Customer.UpdateCutsomer(customer));
        }
Example #12
0
        public JsonResult GetAllCustomers(MVCModels.JQueryDataTableParamModel param)
        {
            string cacheKey = "SomeKey";

            Cog.Cache.Lib.CacheServer server = new Cog.Cache.Lib.CacheServer(true);
            object allCompaniesTemp          = null;
            List <MVCModels.HiDoctor_Master.CustomerModel> allCompanies = null;

            //if (!server.IsKeyExist(cacheKey))
            //{
            DAL_Customer _objDALCustomer = new DAL_Customer();

            allCompanies     = _objDALCustomer.GetAllCustomers(_objcurrentInfo.GetCompanyCode()) as List <MVCModels.HiDoctor_Master.CustomerModel>;
            allCompaniesTemp = allCompanies;
            //  server.SetData(cacheKey, allCompaniesTemp, 240);
            //}
            //else
            //{
            //    server.GetData(cacheKey, ref allCompaniesTemp);
            //    allCompanies = allCompaniesTemp as List<MVCModels.HiDoctor_Master.CustomerModel>;
            //}
            IEnumerable <MVCModels.HiDoctor_Master.CustomerModel> filteredCompanies;

            if (!string.IsNullOrEmpty(param.sSearch))
            {
                filteredCompanies = allCompanies.Where(c => c.Customer_Name.ToLower().Contains(param.sSearch.ToLower()) ||
                                                       c.Customer_Code.ToLower().Contains(param.sSearch.ToLower())
                                                       ||
                                                       c.Address1.ToLower().Contains(param.sSearch.ToLower())
                                                       ||
                                                       c.Address2.ToLower().Contains(param.sSearch.ToLower())
                                                       ||
                                                       c.Local_Area.ToLower().Contains(param.sSearch.ToLower())
                                                       ||
                                                       c.City.ToLower().Contains(param.sSearch.ToLower())
                                                       ||
                                                       c.Phone.ToLower().Contains(param.sSearch.ToLower())
                                                       ||
                                                       c.Mobile.ToLower().Contains(param.sSearch.ToLower())
                                                       ||
                                                       c.MDL_Number.ToLower().Contains(param.sSearch.ToLower())
                                                       ||
                                                       c.Region_Code.ToLower().Contains(param.sSearch.ToLower())
                                                       ||
                                                       c.Region_Type_Code.ToLower().Contains(param.sSearch.ToLower())
                                                       );
            }
            else
            {
                filteredCompanies = allCompanies;
            }

            //  var isNameSortable = Convert.ToBoolean(Request["bSortable_1"]);
            var sortColumnIndex = Convert.ToInt32(Request["iSortCol_0"]);
            Func <MVCModels.HiDoctor_Master.CustomerModel, string> orderingFunction = (c => sortColumnIndex == 1 ? c.Customer_Name :
                                                                                       sortColumnIndex == 2 ? c.Customer_Code :
                                                                                       sortColumnIndex == 3 ? c.Address1 :
                                                                                       sortColumnIndex == 4 ? c.Address2 :
                                                                                       sortColumnIndex == 5 ? c.Local_Area :
                                                                                       sortColumnIndex == 6 ? c.City :
                                                                                       sortColumnIndex == 7 ? c.Phone :
                                                                                       sortColumnIndex == 8 ? c.Mobile :
                                                                                       sortColumnIndex == 9 ? c.MDL_Number :
                                                                                       sortColumnIndex == 10 ? c.Region_Code :
                                                                                       sortColumnIndex == 11 ? c.Region_Type_Code :
                                                                                       "");

            var sortDirection = Request["sSortDir_0"]; // asc or desc

            if (sortDirection == "asc")
            {
                filteredCompanies = filteredCompanies.OrderBy(orderingFunction);
            }
            else
            {
                filteredCompanies = filteredCompanies.OrderByDescending(orderingFunction);
            }

            var displayedCompanies = filteredCompanies.Skip(param.iDisplayStart).Take(param.iDisplayLength);
            var result             = from c in displayedCompanies
                                     select new[] { Convert.ToString(c.ID), c.Customer_Name, c.Customer_Code, c.Address1, c.Address2,
                                                    c.Local_Area,
                                                    c.City,
                                                    c.Phone,
                                                    c.Mobile,
                                                    c.MDL_Number,
                                                    c.Region_Code,
                                                    c.Region_Type_Code, };


            return(Json(new
            {
                sEcho = param.sEcho,
                iTotalRecords = allCompanies.Count(),
                iTotalDisplayRecords = filteredCompanies.Count(),
                aaData = result
            },
                        JsonRequestBehavior.AllowGet));
        }
Example #13
0
        public List <CustomerType> GetCustomerType()
        {
            DAL_Customer bAL_Customer = new DAL_Customer();

            return(bAL_Customer.GetCustomerType());
        }
Example #14
0
        public List <Customer> GetCustomerList()
        {
            DAL_Customer bAL_Customer = new DAL_Customer();

            return(bAL_Customer.GetCustomerList());
        }