Example #1
0
        public static bool UpdateTaskColorMark(string taskid, int mark, string operateid, string ip, string clientid)
        {
            bool bl = CommonBusiness.Update("OrderTask", "ColorMark", mark, "TaskID='" + taskid + "'");

            if (bl)
            {
                string msg = "标记任务颜色";
                LogBusiness.AddLog(taskid, EnumLogObjectType.OrderTask, msg, operateid, ip, mark.ToString(), clientid);
            }
            return(bl);
        }
Example #2
0
        public bool DeleteProductIsPublic(string productid, string operateIP, string operateID)
        {
            bool bl = CommonBusiness.Update("Products", "IsPublic", 4, " ProductID='" + productid + "' and IsPublic=2");

            if (bl)
            {
                string msg = "撤销材料公开状态";
                LogBusiness.AddLog(productid, EnumLogObjectType.Product, msg, operateID, operateIP, "", "");
            }
            return(bl);
        }
Example #3
0
        /// <summary>
        /// 出库按报损逻辑
        /// </summary>
        public bool SubmitHandOutDoc(string wareid, string remark, string userid, string operateip, string clientid)
        {
            string guid = Guid.NewGuid().ToString();
            bool   bl   = StockDAL.SubmitDamagedDoc(guid, (int)EnumDocType.SGCK, 0, remark, wareid, userid, operateip, clientid);

            if (bl)
            {
                LogBusiness.AddActionLog(IntFactoryEnum.EnumSystemType.Client, IntFactoryEnum.EnumLogObjectType.StockOut, EnumLogType.Create, "", userid, clientid);
            }
            return(bl);
        }
Example #4
0
        public bool UpdateCustomer(string customerid, string name, int type, string industryid, int extent, string citycode, string address, string mobile, string officephone, string email, string jobs, string desc, string operateid, string ip, string clientid)
        {
            bool bl = CustomDAL.BaseProvider.UpdateCustomer(customerid, name, type, industryid, extent, citycode, address, mobile, officephone, email, jobs, desc, operateid, clientid);

            if (bl)
            {
                string msg = "编辑客户信息";
                LogBusiness.AddLog(customerid, EnumLogObjectType.Customer, msg, operateid, ip, "", clientid);
            }
            return(bl);
        }
Example #5
0
        public bool AuditProductIsPublic(string productid, int ispublic, string operateIP, string operateID)
        {
            bool bl = CommonBusiness.Update("Products", "IsPublic", ispublic, " ProductID='" + productid + "' and IsPublic=1");

            if (bl)
            {
                string msg = ispublic == 2 ? "通过材料公开申请" : "驳回材料公开申请";
                LogBusiness.AddLog(productid, EnumLogObjectType.Product, msg, operateID, operateIP, "", "");
            }
            return(bl);
        }
Example #6
0
        /// <summary>
        /// 删除制版工艺
        /// </summary>
        /// <param name="plateID"></param>
        /// <returns></returns>
        public static bool DeletePlateMaking(string plateID, string taskid, string title, string operateid, string ip, string clientid)
        {
            bool flag = TaskDAL.BaseProvider.DeletePlateMaking(plateID);

            if (flag)
            {
                string msg = "删除工艺说明:" + title;
                LogBusiness.AddLog(taskid, EnumLogObjectType.OrderTask, msg, operateid, ip, "", clientid);
            }

            return(flag);
        }
Example #7
0
        public bool UpdateCustomerMark(string customerid, int mark, string operateid, string ip, string clientid)
        {
            bool bl = CommonBusiness.Update("Customer", "Mark", mark, "CustomerID='" + customerid + "'");

            if (bl)
            {
                var    color = SystemBusiness.BaseBusiness.GetLableColorColorID(clientid, mark, EnumMarkType.Customer);
                string msg   = color != null ? "客户更换标签:" + color.ColorName : "标记客户标签";
                LogBusiness.AddLog(customerid, EnumLogObjectType.Customer, msg, operateid, ip, mark.ToString(), clientid);
            }
            return(bl);
        }
Example #8
0
        public static bool CreateStorageDoc(string wareid, string remark, string userid, string operateip, string clientid)
        {
            string guid = Guid.NewGuid().ToString();
            bool   bl   = StockDAL.AddStorageDoc(guid, (int)EnumDocType.RK, 0, remark, wareid, userid, operateip, clientid);

            if (bl)
            {
                //日志
                LogBusiness.AddActionLog(IntFactoryEnum.EnumSystemType.Client, IntFactoryEnum.EnumLogObjectType.StockIn, EnumLogType.Create, "", userid, clientid);
            }
            return(bl);
        }
Example #9
0
        public bool UpdateCustomerStatus(string customerid, EnumCustomStatus status, string operateid, string ip, string clientid)
        {
            bool bl = CommonBusiness.Update("Customer", "Status", (int)status, "CustomerID='" + customerid + "'");

            if (bl)
            {
                var    model = CommonBusiness.GetEnumDesc(status);
                string msg   = "客户状态更换为:" + model;
                LogBusiness.AddLog(customerid, EnumLogObjectType.Customer, msg, operateid, ip, status.ToString(), clientid);
            }
            return(bl);
        }
Example #10
0
        public bool UpdateCustomerOwner(string customerid, string userid, string operateid, string ip, string clientid)
        {
            bool bl = CustomDAL.BaseProvider.UpdateCustomerOwner(customerid, userid, operateid, clientid);

            if (bl)
            {
                var    model = OrganizationBusiness.GetUserByUserID(userid, clientid);
                string msg   = "客户负责人更换为:" + model.Name;
                LogBusiness.AddLog(customerid, EnumLogObjectType.Customer, msg, operateid, ip, userid, clientid);
            }
            return(bl);
        }
Example #11
0
        /// <summary>
        /// 修改制版工艺
        /// </summary>
        /// <param name="plate"></param>
        /// <returns></returns>
        public static bool UpdatePlateMaking(PlateMaking plate, string operateid, string ip, string clientid)
        {
            bool flag = TaskDAL.BaseProvider.UpdatePlateMaking(plate.PlateID, plate.Title, plate.Remark, plate.Icon, plate.TypeName);

            if (flag)
            {
                string msg = "编辑工艺说明为:" + plate.Title;
                LogBusiness.AddLog(plate.TaskID, EnumLogObjectType.OrderTask, msg, operateid, ip, "", clientid);
            }

            return(flag);
        }
Example #12
0
        /// <summary>
        /// 将任务解锁
        /// </summary>
        /// <param name="taskID"></param>
        /// <param name="operateid"></param>
        /// <param name="ip"></param>
        /// <param name="clientid"></param>
        /// <param name="result"></param>
        /// <returns></returns>
        public static bool UnLockTask(string taskID, string operateid, string ip, string clientid, out int result)
        {
            bool flag = TaskDAL.BaseProvider.UnLockTask(taskID, operateid, out result);

            if (flag)
            {
                string msg = "将任务解锁";
                LogBusiness.AddLog(taskID, EnumLogObjectType.OrderTask, msg, operateid, ip, "", clientid);
                LogBusiness.AddActionLog(IntFactoryEnum.EnumSystemType.Client, IntFactoryEnum.EnumLogObjectType.OrderTask, EnumLogType.Update, "", operateid, clientid);
            }

            return(flag);
        }
Example #13
0
        /// <summary>
        /// 修改任务截至日期
        /// </summary>
        /// <param name="taskID"></param>
        /// <param name="endTime"></param>
        /// <returns></returns>
        public static bool UpdateTaskEndTime(string taskID, DateTime?endTime, string operateid, string ip, string clientid, out int result)
        {
            bool flag = TaskDAL.BaseProvider.UpdateTaskEndTime(taskID, endTime, operateid, out result);

            if (flag)
            {
                string msg = "将任务截至日期设为:" + (endTime == null ? "未指定日期" : endTime.Value.Date.ToString("yyyy-MM-dd"));
                LogBusiness.AddLog(taskID, EnumLogObjectType.OrderTask, msg, operateid, ip, "", clientid);
                LogBusiness.AddActionLog(IntFactoryEnum.EnumSystemType.Client, IntFactoryEnum.EnumLogObjectType.OrderTask, EnumLogType.Update, "", operateid, clientid);
            }

            return(flag);
        }
Example #14
0
        /// <summary>
        /// 修改任务负责人
        /// </summary>
        /// <param name="taskID"></param>
        /// <param name="OwnerID"></param>
        /// <returns></returns>
        public static bool UpdateTaskOwner(string taskID, string ownerID, string operateid, string operateName, string ip, string clientid, out int result)
        {
            bool flag = TaskDAL.BaseProvider.UpdateTaskOwner(taskID, ownerID, out result);

            if (flag)
            {
                var    user = OrganizationBusiness.GetUserByUserID(ownerID, clientid);
                string msg  = "将任务负责人更改为:" + (user != null?user.Name:ownerID);
                LogBusiness.AddLog(taskID, EnumLogObjectType.OrderTask, msg, operateid, ip, "", clientid);

                //任务更换负责人推送通知
                WeiXinMPPush.BasePush.SendChangeTaskOwnerPush(taskID, operateName);
            }

            return(flag);
        }
Example #15
0
        /// <summary>
        /// 移除任务成员
        /// </summary>
        /// <param name="taskID"></param>
        /// <param name="memberID"></param>
        /// <param name="operateid"></param>
        /// <param name="ip"></param>
        /// <param name="clientid"></param>
        /// <returns></returns>
        public static bool RemoveTaskMember(string taskID, string memberID, string operateid, string ip, string clientid)
        {
            bool flag = TaskDAL.BaseProvider.RemoveTaskMember(taskID, memberID);

            if (flag)
            {
                var userName = string.Empty;
                var user     = OrganizationBusiness.GetUserByUserID(memberID, clientid);
                userName += user != null ? user.Name : "";

                string msg = "删除任务成员" + userName.Trim(',');
                LogBusiness.AddLog(taskID, EnumLogObjectType.OrderTask, msg, operateid, ip, "", clientid);
            }

            return(flag);
        }
Example #16
0
        /// <summary>
        /// 将任务标记完成
        /// </summary>
        /// <param name="taskID"></param>
        /// <returns></returns>
        public static bool FinishTask(string taskID, string operateid, string ip, string clientid, out int result)
        {
            bool flag = TaskDAL.BaseProvider.FinishTask(taskID, operateid, out result);

            if (flag)
            {
                string msg = "将任务标记为完成";
                LogBusiness.AddLog(taskID, EnumLogObjectType.OrderTask, msg, operateid, ip, "", clientid);
                LogBusiness.AddActionLog(IntFactoryEnum.EnumSystemType.Client, IntFactoryEnum.EnumLogObjectType.OrderTask, EnumLogType.Update, "", operateid, clientid);

                //通知任务完成消息通知给它下级任务
                WeiXinMPPush.BasePush.SendTaskFinishPush(taskID);
            }

            return(flag);
        }
Example #17
0
        /// <summary>
        /// 更新任务成员权限
        /// </summary>
        public static bool UpdateMemberPermission(string taskID, string memberID, TaskMemberPermissionType taskMemberPermissionType, string operateid, string ip, string clientid)
        {
            bool flag = TaskDAL.BaseProvider.UpdateMemberPermission(taskID, memberID, (int)taskMemberPermissionType);

            if (flag)
            {
                var userName = string.Empty;
                var user     = OrganizationBusiness.GetUserByUserID(memberID, clientid);
                userName += user != null ? user.Name : "";

                string msg = "将任务成员" + userName.Trim(',') + "的权限更新为:" + (taskMemberPermissionType == TaskMemberPermissionType.See?"查看":"编辑");
                LogBusiness.AddLog(taskID, EnumLogObjectType.OrderTask, msg, operateid, ip, "", clientid);
            }

            return(flag);
        }
Example #18
0
        public string CreateCustomer(string name, int type, string sourceid, string industryid, int extent, string citycode, string address,
                                     string contactname, string mobile, string officephone, string email, string jobs, string desc, string ownerid, string operateid, string clientid)
        {
            string id = Guid.NewGuid().ToString();
            bool   bl = CustomDAL.BaseProvider.CreateCustomer(id, name, type, sourceid, industryid, extent, citycode, address, contactname, mobile, officephone, email, jobs, desc, ownerid, operateid, clientid);

            if (!bl)
            {
                id = "";
            }
            else
            {
                //日志
                LogBusiness.AddActionLog(IntFactoryEnum.EnumSystemType.Client, IntFactoryEnum.EnumLogObjectType.Customer, EnumLogType.Create, "", operateid, clientid);
            }
            return(id);
        }
Example #19
0
        /// <summary>
        /// 批量添加任务成员
        /// </summary>
        /// <param name="taskID"></param>
        /// <param name="memberIDs"></param>
        /// <param name="operateid"></param>
        /// <param name="ip"></param>
        /// <param name="clientid"></param>
        /// <returns></returns>
        public static bool AddTaskMembers(string taskID, string memberIDs, string operateid, string ip, string clientid, out int result)
        {
            memberIDs = memberIDs.Trim(',');
            bool flag = TaskDAL.BaseProvider.AddTaskMembers(taskID, memberIDs, operateid, out result);

            if (flag)
            {
                var userName = string.Empty;
                foreach (var m in memberIDs.Split(','))
                {
                    var user = OrganizationBusiness.GetUserByUserID(m, clientid);
                    userName += (user != null ? user.Name : "") + ",";
                }
                string msg = "添加任务成员" + userName.Trim(',');
                LogBusiness.AddLog(taskID, EnumLogObjectType.OrderTask, msg, operateid, ip, "", clientid);
            }

            return(flag);
        }
Example #20
0
        public static Users CreateUser(EnumAccountType accountType, string loginname, string loginpwd, string name, string mobile, string email, string citycode, string address, string jobs,
                                       string roleid, string departid, string parentid, string clientid, string operateid, out int result)
        {
            string userid = Guid.NewGuid().ToString().ToLower();

            loginpwd = CloudSalesTool.Encrypt.GetEncryptPwd(loginpwd, loginname);

            Users user = null;

            DataTable dt = OrganizationDAL.BaseProvider.CreateUser((int)accountType, userid, loginname, loginpwd, name, mobile, email, citycode, address, jobs, roleid, departid, parentid, clientid, operateid, out result);

            if (dt.Rows.Count > 0)
            {
                user = GetUserByUserID(userid, clientid);
                //日志
                LogBusiness.AddActionLog(IntFactoryEnum.EnumSystemType.Client, IntFactoryEnum.EnumLogObjectType.User, EnumLogType.Create, "", operateid, user.ClientID);
            }
            return(user);
        }
Example #21
0
        /// <summary>
        /// 根据账号密码获取信息(登录)
        /// </summary>
        /// <param name="loginname"></param>
        /// <param name="pwd"></param>
        /// <param name="operateip"></param>
        /// <param name="result"></param>
        /// <returns></returns>
        public static M_Users GetM_UserByProUserName(string loginname, string pwd, string operateip, out int result)
        {
            pwd = CloudSalesTool.Encrypt.GetEncryptPwd(pwd, loginname);
            DataSet ds    = new M_UsersDAL().GetM_UserByProUserName(loginname, pwd, out result);
            M_Users model = null;

            if (ds.Tables.Contains("M_User") && ds.Tables["M_User"].Rows.Count > 0)
            {
                model = new M_Users();
                model.FillData(ds.Tables["M_User"].Rows[0]);
                if (!string.IsNullOrEmpty(model.RoleID))
                {
                    model.Role = ManageSystemBusiness.GetRoleByIDCache(model.RoleID);
                }
                //权限
                if (model.Role != null && model.Role.IsDefault == 1)
                {
                    model.Menus = CommonBusiness.ManageMenus;
                }
                else if (model.IsAdmin == 1)
                {
                    model.Menus = CommonBusiness.ManageMenus;
                }
                else
                {
                    model.Menus = new List <Menu>();
                    foreach (DataRow dr in ds.Tables["Permission"].Rows)
                    {
                        Menu menu = new Menu();
                        menu.FillData(dr);
                        model.Menus.Add(menu);
                    }
                }
            }
            //记录登录日志
            LogBusiness.AddLoginLog(loginname, model != null, IntFactoryEnum.EnumSystemType.Manage, operateip, "", "");

            return(model);
        }
Example #22
0
        public string AddProduct(string productCode, string productName, string generalName, string prodiverid, string unitid,
                                 string categoryid, int status, int ispublic, string attrlist, string valuelist, string attrvaluelist, decimal commonprice, decimal price, decimal weight,
                                 int isallow, decimal discountValue, string productImg, string shapeCode, string description, List <ProductDetail> details, string operateid, string clientid, ref int result)
        {
            lock (SingleLock)
            {
                var    dal = new ProductsDAL();
                string pid = dal.AddProduct(productCode, productName, generalName, prodiverid, unitid, categoryid, status, ispublic, attrlist,
                                            valuelist, attrvaluelist, commonprice, price, weight, isallow, discountValue, productImg, shapeCode, description, operateid, clientid, ref result);
                //产品添加成功添加子产品
                if (!string.IsNullOrEmpty(pid))
                {
                    //日志
                    LogBusiness.AddActionLog(IntFactoryEnum.EnumSystemType.Client, IntFactoryEnum.EnumLogObjectType.Product, EnumLogType.Create, "", operateid, clientid);

                    foreach (var model in details)
                    {
                        dal.AddProductDetails(pid, model.DetailsCode, model.ShapeCode, model.SaleAttr, model.AttrValue, model.SaleAttrValue, model.Price, model.Weight, model.ImgS, model.Description, model.Remark, operateid, clientid);
                    }
                }
                return(pid);
            }
        }
Example #23
0
        public static Users GetUserByUserName(string loginname, string pwd, out int result, string operateip)
        {
            pwd = CloudSalesTool.Encrypt.GetEncryptPwd(pwd, loginname);
            DataSet ds    = new OrganizationDAL().GetUserByUserName(loginname, pwd, out result);
            Users   model = null;

            if (ds.Tables.Contains("User") && ds.Tables["User"].Rows.Count > 0)
            {
                model = new Users();
                model.FillData(ds.Tables["User"].Rows[0]);

                model.LogGUID = Guid.NewGuid().ToString();

                model.Department = GetDepartmentByID(model.DepartID, model.ClientID);
                model.Role       = GetRoleByIDCache(model.RoleID, model.ClientID);

                //处理缓存
                if (!Users.ContainsKey(model.ClientID))
                {
                    GetUsers(model.ClientID);
                }
                if (Users[model.ClientID].Where(u => u.UserID == model.UserID).Count() == 0)
                {
                    Users[model.ClientID].Add(model);
                }
                else
                {
                    var user = Users[model.ClientID].Where(u => u.UserID == model.UserID).FirstOrDefault();
                    user.LogGUID = model.LogGUID;
                }

                model.Client = Manage.ClientBusiness.GetClientDetail(model.ClientID);

                //权限
                if (model.Role != null && model.Role.IsDefault == 1)
                {
                    model.Menus = CommonBusiness.ClientMenus;
                }
                else
                {
                    model.Menus = new List <Menu>();
                    foreach (DataRow dr in ds.Tables["Permission"].Rows)
                    {
                        Menu menu = new Menu();
                        menu.FillData(dr);
                        model.Menus.Add(menu);
                    }
                }
            }

            //记录登录日志
            if (model != null)
            {
                LogBusiness.AddLoginLog(loginname, true, IntFactoryEnum.EnumSystemType.Client, operateip, model.UserID, model.ClientID);
            }
            else
            {
                LogBusiness.AddLoginLog(loginname, false, IntFactoryEnum.EnumSystemType.Client, operateip, "", "");
            }

            return(model);
        }
Example #24
0
        public static Users GetUserByOtherAccount(EnumAccountType accountType, string account, string operateip, string projectid = "")
        {
            DataSet ds    = new OrganizationDAL().GetUserByOtherAccount((int)accountType, account, projectid);
            Users   model = null;

            if (ds.Tables.Contains("User") && ds.Tables["User"].Rows.Count > 0)
            {
                model = new Users();
                model.FillData(ds.Tables["User"].Rows[0]);

                model.LogGUID = Guid.NewGuid().ToString();

                model.Department = GetDepartmentByID(model.DepartID, model.ClientID);
                model.Role       = GetRoleByIDCache(model.RoleID, model.ClientID);
                model.Client     = Manage.ClientBusiness.GetClientDetail(model.ClientID);
                //处理缓存
                if (!Users.ContainsKey(model.ClientID))
                {
                    GetUsers(model.ClientID);
                }
                if (Users[model.ClientID].Where(u => u.UserID == model.UserID).Count() == 0)
                {
                    Users[model.ClientID].Add(model);
                }
                else
                {
                    var user = Users[model.ClientID].Where(u => u.UserID == model.UserID).FirstOrDefault();
                    user.LogGUID = model.LogGUID;
                }

                //权限
                if (model.Role != null && model.Role.IsDefault == 1)
                {
                    model.Menus = CommonBusiness.ClientMenus;
                }
                else
                {
                    model.Menus = new List <Menu>();
                    foreach (DataRow dr in ds.Tables["Permission"].Rows)
                    {
                        Menu menu = new Menu();
                        menu.FillData(dr);
                        model.Menus.Add(menu);
                    }
                }
            }
            if (string.IsNullOrEmpty(operateip))
            {
                operateip = "";
            }

            //记录登录日志
            if (model != null)
            {
                LogBusiness.AddLoginLog(account, true, IntFactoryEnum.EnumSystemType.Client, operateip, model.UserID, model.ClientID);
            }
            else
            {
                LogBusiness.AddLoginLog(account, false, IntFactoryEnum.EnumSystemType.Client, operateip, "", "");
            }
            return(model);
        }