Esempio n. 1
0
        /// <summary>
        /// 新增/修改会员信息
        /// </summary>
        /// <param name="memberInfo"></param>
        /// <returns></returns>
        public int PostData(ConfigModel configInfo)
        {
            int result;

            string userClientId = HttpContextHandler.GetHeaderObj("UserClientId").ToString();

            if (string.IsNullOrEmpty(userClientId))
            {
                return(0);
            }
            if (string.IsNullOrEmpty(configInfo.ClientId))
            {
                configInfo.ClientId = userClientId;
            }

            //configInfo.WxSslcertPath = "cert/"+configInfo.WxMchId+"/apiclient_cert.p12";
            //configInfo.WxSslcertPassword = configInfo.WxMchId;
            configInfo.WxMchId = configInfo.WxMchId.Trim();
            result             = GenerateDal.Create(configInfo);

            //操作日志
            OperationLogService operationService = new OperationLogService();

            operationService.PostData(new OperationLogModel()
            {
                Remark = configInfo.ClientId, OptContent = "添加支付配置"
            });


            return(result);
        }
Esempio n. 2
0
        /// <summary>
        /// 新增/修改会员信息
        /// </summary>
        /// <param name="memberInfo"></param>
        /// <returns></returns>
        public int PostData(MachineConfigModel machineConfigInfo)
        {
            try
            {
                GenerateDal.BeginTransaction();

                if (!string.IsNullOrEmpty(machineConfigInfo.MachineId))
                {
                    DeleteData(machineConfigInfo.MachineId);
                }
                string userAccount = HttpContextHandler.GetHeaderObj("UserAccount").ToString();
                machineConfigInfo.UpdateDate = DateTime.Now;
                machineConfigInfo.Updater    = userAccount;
                GenerateDal.Create(machineConfigInfo);
                //需要插入机器下行表中待机器取
                MachineService mc = new MachineService();
                mc.PostToMachine(machineConfigInfo.MachineId, "t");
                GenerateDal.CommitTransaction();
                //操作日志
                OperationLogService operationService = new OperationLogService();
                operationService.PostData(new OperationLogModel()
                {
                    MachineId = machineConfigInfo.MachineId, OptContent = "机器配置添加"
                });
                return(1);
            }
            catch (Exception e)
            {
                GenerateDal.RollBack();
                return(0);
            }
        }
Esempio n. 3
0
        public int UpdateData(TunnelInfoModel tunnelInfoInfo)
        {
            try
            {
                //GenerateDal.BeginTransaction();
                tunnelInfoInfo.UpdateDate = DateTime.Now;
                GenerateDal.Update(CommonSqlKey.UpdateTunnelInfo, tunnelInfoInfo);
                //操作日志
                OperationLogService operationService = new OperationLogService();
                operationService.PostData(new OperationLogModel()
                {
                    MachineId = tunnelInfoInfo.MachineId, OptContent = "货道" + (tunnelInfoInfo.CurrStatus == "1"? "启用":"停用")
                });

                /*
                 * TunnelConfigModel tunnelConfig = new TunnelConfigModel();
                 * tunnelConfig.MachineId = tunnelInfoInfo.MachineId;
                 * tunnelConfig.CabinetId = tunnelInfoInfo.CabinetId;
                 * tunnelConfig.TunnelId = tunnelInfoInfo.GoodsStuId;
                 * tunnelConfig.IsUsed = Convert.ToInt32(tunnelInfoInfo.CurrStatus);
                 * GenerateDal.Update(CommonSqlKey.UpdateTunnelConfigStatus, tunnelConfig);
                 */
                //GenerateDal.CommitTransaction();
            }
            catch (Exception e)
            {
                //GenerateDal.RollBack();
                return(0);
            }
            return(1);
        }
Esempio n. 4
0
        /// <summary>
        /// 删除用户
        /// </summary>
        /// <returns></returns>
        public int DeleteData(string id)
        {
            try
            {
                GenerateDal.BeginTransaction();

                MachineListModel machineListInfo = new MachineListModel();
                machineListInfo.MachineId = id;
                GenerateDal.Delete <MachineListModel>(CommonSqlKey.DeleteMachineList, machineListInfo);
                MachineConfigService mcService = new MachineConfigService();
                mcService.DeleteData(id);
                TunnelConfigService tcService = new TunnelConfigService();
                tcService.DeleteData(id);
                TunnelInfoService tiService = new TunnelInfoService();
                tiService.DeleteData(id);
                GenerateDal.CommitTransaction();
                //操作日志
                OperationLogService operationService = new OperationLogService();
                operationService.PostData(new OperationLogModel()
                {
                    MachineId = machineListInfo.MachineId, OptContent = "删除机器"
                });
                return(1);
            }
            catch (Exception e)
            {
                GenerateDal.RollBack();
                return(0);
            }
        }
Esempio n. 5
0
        public int UpdateData(TunnelConfigModel tunnelConfigInfo)
        {
            //操作日志
            OperationLogService operationService = new OperationLogService();

            operationService.PostData(new OperationLogModel()
            {
                MachineId = tunnelConfigInfo.MachineId, OptContent = "货道配置更新"
            });

            return(GenerateDal.Update(CommonSqlKey.UpdateTunnelConfig, tunnelConfigInfo));
        }
Esempio n. 6
0
        /// <summary>
        /// 删除用户
        /// </summary>
        /// <returns></returns>
        public int DeleteData(string id)
        {
            string userClientId = HttpContextHandler.GetHeaderObj("UserClientId").ToString();

            if (string.IsNullOrEmpty(userClientId))
            {
                return(0);
            }
            try
            {
                GenerateDal.BeginTransaction();
                // 删除有子客户的客户 将子客户父级更新为删除对象的父级
                string fatherId         = string.Empty;
                var    fatherClientInfo = GenerateDal.Get <CustomerModel>(id);
                if (fatherClientInfo != null)
                {
                    fatherId = fatherClientInfo.ClientFatherId;
                }
                CustomerModel customerInfo = new CustomerModel();
                customerInfo.Id = id;
                int delResult = GenerateDal.Delete <CustomerModel>(CommonSqlKey.DeleteCustomer, customerInfo);
                if (delResult > 0)
                {
                    CustomerModel updInfo = new CustomerModel();
                    updInfo.ClientFatherId = fatherId;
                    updInfo.Id             = id;
                    string userAccount = HttpContextHandler.GetHeaderObj("UserAccount").ToString();
                    if (!string.IsNullOrEmpty(userAccount))
                    {
                        updInfo.Updater = userAccount;
                    }
                    GenerateDal.Update(CommonSqlKey.UpdateChildCustomer, updInfo);
                }

                //操作日志
                OperationLogService operationService = new OperationLogService();
                operationService.PostData(new OperationLogModel()
                {
                    Remark = customerInfo.Id, OptContent = "删除客户"
                });

                GenerateDal.CommitTransaction();
                WebCacheHelper.ClearIds(userClientId);
                return(1);
            }
            catch (Exception ee)
            {
                GenerateDal.RollBack();
                return(0);
            }
        }
Esempio n. 7
0
        /// <summary>
        /// 删除用户
        /// </summary>
        /// <returns></returns>
        public int DeleteData(string id)
        {
            MachineConfigModel machineConfigInfo = new MachineConfigModel();

            machineConfigInfo.MachineId = id;
            //操作日志
            OperationLogService operationService = new OperationLogService();

            operationService.PostData(new OperationLogModel()
            {
                MachineId = machineConfigInfo.MachineId, OptContent = "机器配置删除"
            });
            return(GenerateDal.Delete <MachineConfigModel>(CommonSqlKey.DeleteMachineConfig, machineConfigInfo));
        }
Esempio n. 8
0
        /// <summary>
        /// 删除用户
        /// </summary>
        /// <returns></returns>
        public int DeleteData(string id)
        {
            TunnelConfigModel tunnelConfigInfo = new TunnelConfigModel();

            tunnelConfigInfo.MachineId = id;
            //操作日志
            OperationLogService operationService = new OperationLogService();

            operationService.PostData(new OperationLogModel()
            {
                MachineId = id, OptContent = "货道配置删除"
            });
            return(GenerateDal.Delete <TunnelConfigModel>(CommonSqlKey.DeleteTunnelConfig, tunnelConfigInfo));
        }
Esempio n. 9
0
        /// <summary>
        /// 删除用户
        /// </summary>
        /// <returns></returns>
        public int DeleteData(string id)
        {
            UserModel userInfo = new UserModel();

            userInfo.Id = id;
            //操作日志
            OperationLogService operationService = new OperationLogService();

            operationService.PostData(new OperationLogModel()
            {
                Remark = userInfo.Id, OptContent = "删除用户"
            });
            return(GenerateDal.Delete <UserModel>(CommonSqlKey.DeleteUser, userInfo));
        }
Esempio n. 10
0
        public int UpdateData(MachineListModel machineListInfo)
        {
            machineListInfo.UpdateDate = DateTime.Now;
            string userAccount = HttpContextHandler.GetHeaderObj("UserAccount").ToString();

            machineListInfo.Updater = userAccount;
            //操作日志
            OperationLogService operationService = new OperationLogService();

            operationService.PostData(new OperationLogModel()
            {
                MachineId = machineListInfo.MachineId, OptContent = "更新机器"
            });
            return(GenerateDal.Update(CommonSqlKey.UpdateMachineList, machineListInfo));
        }
Esempio n. 11
0
        public int UpdateData(ConfigModel configInfo)
        {
            if (string.IsNullOrEmpty(configInfo.ClientId))
            {
                string userClientId = HttpContextHandler.GetHeaderObj("UserClientId").ToString();
                configInfo.ClientId = userClientId;
            }
            configInfo.WxMchId = configInfo.WxMchId.Trim();
            //操作日志
            OperationLogService operationService = new OperationLogService();

            operationService.PostData(new OperationLogModel()
            {
                Remark = configInfo.ClientId, OptContent = "更新支付配置"
            });
            //configInfo.WxSslcertPath = "cert/" + configInfo.WxMchId + "/apiclient_cert.p12";
            //configInfo.WxSslcertPassword = configInfo.WxMchId;
            return(GenerateDal.Update(CommonSqlKey.UpdatePayConfig, configInfo));
        }
Esempio n. 12
0
        public int UpdateData(CustomerModel customerInfo)
        {
            string userAccount = HttpContextHandler.GetHeaderObj("UserAccount").ToString();

            if (!string.IsNullOrEmpty(userAccount))
            {
                customerInfo.Updater = userAccount;
            }
            //操作日志
            OperationLogService operationService = new OperationLogService();

            operationService.PostData(new OperationLogModel()
            {
                Remark = customerInfo.Id, OptContent = "更新客户"
            });
            string userClientId = HttpContextHandler.GetHeaderObj("UserClientId").ToString();

            WebCacheHelper.ClearIds(userClientId);
            return(GenerateDal.Update(CommonSqlKey.UpdateCustomer, customerInfo));
        }
Esempio n. 13
0
        /// <summary>
        /// 新增/修改会员信息
        /// </summary>
        /// <param name="memberInfo"></param>
        /// <returns></returns>
        public int PostData(MachineListModel machineListInfo)
        {
            int result;

            string userAccount = HttpContextHandler.GetHeaderObj("UserAccount").ToString();

            machineListInfo.CreateDate = DateTime.Now;
            machineListInfo.Creator    = userAccount;
            result = GenerateDal.Create(machineListInfo);

            //操作日志
            OperationLogService operationService = new OperationLogService();

            operationService.PostData(new OperationLogModel()
            {
                MachineId = machineListInfo.MachineId, OptContent = "添加机器"
            });


            return(result);
        }
Esempio n. 14
0
        public int UpdateData(UserModel userInfo)
        {
            var conditions = new List <Condition>();

            conditions.Add(new Condition
            {
                LeftBrace    = " AND ",
                ParamName    = "UserAccount",
                DbColumnName = "usr_account",
                ParamValue   = userInfo.UserAccount,
                Operation    = ConditionOperate.Equal,
                RightBrace   = "",
                Logic        = ""
            });
            conditions.Add(new Condition
            {
                LeftBrace    = " AND ",
                ParamName    = "Id",
                DbColumnName = "id",
                ParamValue   = userInfo.Id,
                Operation    = ConditionOperate.NotEqual,
                RightBrace   = "",
                Logic        = ""
            });
            int result = GenerateDal.CountByConditions(CommonSqlKey.CheckUserExist, conditions);

            if (result > 0)
            {
                return(-1);
            }
            // userInfo.UserPassword = Md5.md5(userInfo.UserPassword, 16);
            //操作日志
            OperationLogService operationService = new OperationLogService();

            operationService.PostData(new OperationLogModel()
            {
                Remark = userInfo.Id, OptContent = "更新用户"
            });
            return(GenerateDal.Update(CommonSqlKey.UpdateUser, userInfo));
        }
Esempio n. 15
0
        /// <summary>
        /// 新增/修改会员信息
        /// </summary>
        /// <param name="memberInfo"></param>
        /// <returns></returns>
        public int PostData(CustomerModel customerInfo)
        {
            int    result;
            string userClientId = HttpContextHandler.GetHeaderObj("UserClientId").ToString();

            if (string.IsNullOrEmpty(userClientId))
            {
                return(0);
            }
            string userAccount = HttpContextHandler.GetHeaderObj("UserAccount").ToString();

            if (string.IsNullOrEmpty(userAccount))
            {
                return(0);
            }
            if (!string.IsNullOrEmpty(userClientId))
            {
                customerInfo.ClientFatherId = userClientId;
            }

            if (!string.IsNullOrEmpty(userAccount))
            {
                customerInfo.Creator = userAccount;
            }

            //customerInfo.Id = Guid.NewGuid().ToString();

            result = GenerateDal.Create(customerInfo);

            //操作日志
            OperationLogService operationService = new OperationLogService();

            operationService.PostData(new OperationLogModel()
            {
                Remark = customerInfo.Id, OptContent = "新增或修改会员信息"
            });
            WebCacheHelper.ClearIds(userClientId);

            return(result);
        }
Esempio n. 16
0
        /// <summary>
        /// 新增/修改会员信息
        /// </summary>
        /// <param name="memberInfo"></param>
        /// <returns></returns>
        public int PostData(UserModel userInfo)
        {
            int result;

            if (CheckUserName(userInfo.UserAccount) > 0)
            {
                return(-1);
            }
            userInfo.Id           = Guid.NewGuid().ToString();
            userInfo.Sts          = 1;
            userInfo.UserPassword = Md5.md5("888888", 16);
            result = GenerateDal.Create(userInfo);


            //操作日志
            OperationLogService operationService = new OperationLogService();

            operationService.PostData(new OperationLogModel()
            {
                Remark = userInfo.Id, OptContent = "新增或修改用户信息"
            });

            return(result);
        }
Esempio n. 17
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="memberInfo"></param>
        /// <returns></returns>
        public int PostData(List <TunnelConfigModel> lstTunnelConfigInfo)
        {
            try
            {
                GenerateDal.BeginTransaction();
                if (lstTunnelConfigInfo.Count > 0)
                {
                    GenerateDal.Delete <TunnelConfigModel>(CommonSqlKey.DeleteTunnelConfig, lstTunnelConfigInfo[0]);
                }
                foreach (TunnelConfigModel tunnelConfigInfo in lstTunnelConfigInfo)
                {
                    tunnelConfigInfo.IsUsed = 1;
                    GenerateDal.Create(tunnelConfigInfo);
                }
                //向机器下行表里插入数据
                if (lstTunnelConfigInfo.Count > 0)
                {
                    MachineService ms = new MachineService();
                    ms.PostToMachine(lstTunnelConfigInfo[0].MachineId, "p");
                    //操作日志
                    OperationLogService operationService = new OperationLogService();
                    operationService.PostData(new OperationLogModel()
                    {
                        MachineId = lstTunnelConfigInfo[0].MachineId, OptContent = "货道配置添加"
                    });
                }
                GenerateDal.CommitTransaction();

                return(1);
            }
            catch (Exception e)
            {
                GenerateDal.RollBack();
                return(0);
            }
        }
Esempio n. 18
0
        public int UpdateStockWithMobile(List <TunnelInfoModel> lstTunnelInfo)
        {
            try
            {
                GenerateDal.BeginTransaction();
                foreach (TunnelInfoModel tunnelInfo in lstTunnelInfo)
                {
                    //decimal price = Convert.ToDecimal(GetPriceByWaresId(tunnelInfo.WaresId));
                    if (string.IsNullOrEmpty(tunnelInfo.GoodsStuId))
                    {
                        tunnelInfo.GoodsStuId = tunnelInfo.TunnelId;
                        tunnelInfo.CurrStatus = "1";
                        GenerateDal.Create <TunnelInfoModel>(tunnelInfo);
                    }
                    else
                    {
                        tunnelInfo.UpdateDate = DateTime.Now;
                        GenerateDal.Update(CommonSqlKey.UpdateTunnelCurrStock, tunnelInfo);
                    }

                    /*
                     * TunnelConfigModel tunnelConfig = new TunnelConfigModel();
                     * tunnelConfig.MachineId = tunnelInfo.MachineId;
                     * tunnelConfig.CabinetId = tunnelInfo.CabinetId;
                     * tunnelConfig.TunnelId = tunnelInfo.TunnelId;
                     * tunnelConfig.CashPrices = price;
                     * tunnelConfig.WpayPrices = price;
                     * tunnelConfig.AlipayPrices = price;
                     * tunnelConfig.IcPrices = price;
                     * tunnelConfig.WaresId = tunnelInfo.WaresId;
                     *
                     * GenerateDal.Update(CommonSqlKey.UpdateTunnelPrice, tunnelConfig);
                     */
                }
                MachineService ms = new MachineService();
                //往机器下行表里插入库存改变的数据
                ms.PostToMachine(lstTunnelInfo[0].MachineId, "st");
                //操作日志
                OperationLogService operationService = new OperationLogService();
                operationService.PostData(new OperationLogModel()
                {
                    MachineId = lstTunnelInfo[0].MachineId, OptContent = "手机补充库存"
                });

                /*
                 * TunnelConfigModel tunnelConfig = new TunnelConfigModel();
                 * tunnelConfig.MachineId = tunnelInfoInfo.MachineId;
                 * tunnelConfig.CabinetId = tunnelInfoInfo.CabinetId;
                 * tunnelConfig.TunnelId = tunnelInfoInfo.GoodsStuId;
                 * tunnelConfig.IsUsed = Convert.ToInt32(tunnelInfoInfo.CurrStatus);
                 * GenerateDal.Update(CommonSqlKey.UpdateTunnelConfigStatus, tunnelConfig);
                 */
                GenerateDal.CommitTransaction();
            }
            catch (Exception e)
            {
                GenerateDal.RollBack();
                return(0);
            }
            return(1);
        }