示例#1
0
        /// <summary>
        /// 根据客户关怀ID修改关怀信息
        /// </summary>
        /// <param name="CustLoveM">客户关怀信息</param>
        /// <returns>bool值</returns>
        public static bool UpdateLove(CustLoveModel CustLoveM)
        {
            try
            {
                StringBuilder sql = new StringBuilder();
                sql.AppendLine("UPDATE officedba.CustLove set ");
                sql.AppendLine("CompanyCD     =@CompanyCD     ,");
                sql.AppendLine("CustID        =@CustID        ,");
                sql.AppendLine("CustLinkMan   =@CustLinkMan   ,");
                //sql.AppendLine("LoveNo        =@LoveNo        ,");
                sql.AppendLine("Title         =@Title         ,");
                sql.AppendLine("LoveType      =@LoveType      ,");
                sql.AppendLine("Contents      =@Contents      ,");
                sql.AppendLine("Linker        =@Linker        ,");
                sql.AppendLine("LoveDate      =@LoveDate      ,");
                sql.AppendLine("Feedback      =@Feedback      ,");
                sql.AppendLine("remarks       =@remarks       ,");
                sql.AppendLine("CanViewUser = @CanViewUser,    ");
                sql.AppendLine("CanViewUserName = @CanViewUserName, ");
                sql.AppendLine("ModifiedDate  =@ModifiedDate  ,");
                sql.AppendLine("ModifiedUserID=@ModifiedUserID");
                sql.AppendLine(" WHERE ");
                sql.AppendLine("ID = @ID ");

                SqlParameter[] param = new SqlParameter[15];
                param[0] = SqlHelper.GetParameter("@ID      ", CustLoveM.ID);
                param[1] = SqlHelper.GetParameter("@CompanyCD     ",CustLoveM.CompanyCD     );
                param[2] = SqlHelper.GetParameter("@CustID        ",CustLoveM.CustID        );
                param[3] = SqlHelper.GetParameter("@CustLinkMan   ",CustLoveM.CustLinkMan   );
                //param[4] = SqlHelper.GetParameter("@LoveNo        ",CustLoveM.LoveNo        );
                param[4] = SqlHelper.GetParameter("@Title         ",CustLoveM.Title         );
                param[5] = SqlHelper.GetParameter("@LoveType      ",CustLoveM.LoveType      );
                param[6] = SqlHelper.GetParameter("@Contents      ",CustLoveM.Contents      );
                param[7] = SqlHelper.GetParameter("@Linker        ",CustLoveM.Linker        );                
                param[8] = SqlHelper.GetParameter("@LoveDate", CustLoveM.LoveDate == null
                                        ? SqlDateTime.Null
                                        : SqlDateTime.Parse(CustLoveM.LoveDate.ToString()));
                param[9] = SqlHelper.GetParameter("@Feedback      ",CustLoveM.Feedback      );
                param[10] = SqlHelper.GetParameter("@remarks       ",CustLoveM.remarks       );
                param[11] = SqlHelper.GetParameter("@ModifiedDate", CustLoveM.ModifiedDate == null
                                        ? SqlDateTime.Null
                                        : SqlDateTime.Parse(CustLoveM.ModifiedDate.ToString()));
                param[12] = SqlHelper.GetParameter("@ModifiedUserID",CustLoveM.ModifiedUserID);
                param[13] = SqlHelper.GetParameter("@CanViewUser", CustLoveM.CanViewUser);
                param[14] = SqlHelper.GetParameter("@CanViewUserName", CustLoveM.CanViewUserName);

                SqlHelper.ExecuteTransSql(sql.ToString(), param);
                return SqlHelper.Result.OprateCount > 0 ? true : false;
            }
            catch 
            {
                return false;
            }
        }
示例#2
0
        /// <summary>
        /// 添加客户关怀信息的方法
        /// </summary>
        /// <param name="CustLoveM">客户关怀信息</param>
        /// <returns>操作记录数</returns>
        public static int CustLoveAdd(CustLoveModel CustLoveM)
        {
            try
            {
                #region 设置参数
                SqlParameter[] param = new SqlParameter[16];
                param[0] = SqlHelper.GetParameter("@CompanyCD     ", CustLoveM.CompanyCD     );
                param[1] = SqlHelper.GetParameter("@CustID        ", CustLoveM.CustID        );
                param[2] = SqlHelper.GetParameter("@CustLinkMan   ", CustLoveM.CustLinkMan   );
                param[3] = SqlHelper.GetParameter("@LoveNo        ", CustLoveM.LoveNo        );
                param[4] = SqlHelper.GetParameter("@Title         ", CustLoveM.Title         );
                param[5] = SqlHelper.GetParameter("@LoveType      ", CustLoveM.LoveType      );
                param[6] = SqlHelper.GetParameter("@Contents      ", CustLoveM.Contents      );
                param[7] = SqlHelper.GetParameter("@Linker        ", CustLoveM.Linker        );
                param[8] = SqlHelper.GetParameter("@LoveDate      ", CustLoveM.LoveDate      );
                param[9] = SqlHelper.GetParameter("@Feedback      ", CustLoveM.Feedback      );
                param[10] = SqlHelper.GetParameter("@remarks       ", CustLoveM.remarks       );
                param[11] = SqlHelper.GetParameter("@ModifiedDate  ", CustLoveM.ModifiedDate  );
                param[12] = SqlHelper.GetParameter("@ModifiedUserID", CustLoveM.ModifiedUserID);
                param[13] = SqlHelper.GetParameter("@CanViewUser", CustLoveM.CanViewUser);
                param[14] = SqlHelper.GetParameter("@CanViewUserName", CustLoveM.CanViewUserName);
                
                SqlParameter paramid = new SqlParameter("@id", SqlDbType.Int);
                paramid.Direction = ParameterDirection.Output;
                param[15] = paramid;
                #endregion

                //创建命令
                SqlCommand comm = new SqlCommand();
                SqlHelper.ExecuteTransStoredProcedure("officedba.insertCustLove", comm, param);
                int Loveid = Convert.ToInt32(comm.Parameters["@id"].Value);

                return Loveid;
            }
            catch (Exception ex)
            {
                string sss = ex.Message;
                return 0;
            }
        }
    protected void btnImport_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            string orderString = hiddExpOrder.Value.Trim();//排序
            string order = "asc";//排序:降序
            string orderBy = (!string.IsNullOrEmpty(orderString)) ? orderString.Substring(0, orderString.Length - 2) : "LoveDate";//要排序的字段,如果为空,默认为"ID"

            if (orderString.EndsWith("_d"))
            {
                order = "desc";//排序:降序
            }
            string ord = " ORDER BY " + orderBy + " " + order;

            CustLoveModel CustLoveM = new CustLoveModel();
            string CustID = hiddCustID.Value;//客户ID 
            CustLoveM.LoveType = Convert.ToInt32(ddlLoveType.SelectedItem.Value);//类型
            string LoveBegin = txtLoveBegin.Value.Trim();//开始时间
            string LoveEnd = txtLoveEnd.Value.Trim();//结束时间            
            string CustLinkMan = txtCustLinkMan.Value.Trim();//客户联系人
            CustLoveM.Title = txtTitle.Value.Trim();//主题
            CustLoveM.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
            string CanUserID = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).EmployeeID.ToString();

            DataTable dt = LoveBus.ExportLoveInfo(CanUserID,CustID, CustLoveM, LoveBegin, LoveEnd, CustLinkMan, ord);

            OutputToExecl.ExportToTableFormat(this, dt,
                new string[] { "关怀编号", "关怀主题", "客户名称", "客户联系人", "关怀时间", "关怀类型", "执行人" },
                new string[] { "LoveNo", "Title", "CustNam", "LinkManName", "LoveDate", "LoveType", "EmployeeName" },
                "客户关怀列表");
        }
        catch
        {
            ClientScript.RegisterStartupScript(this.GetType(), "Exp", "<script language=javascript>showPopup('../../../Images/Pic/Close.gif','../../../Images/Pic/note.gif','导出发生异常');</script>");
        }
    }
示例#4
0
        /// <summary>
        /// 导出客户关怀信息列表
        /// </summary>
        /// <param name="CustName"></param>
        /// <param name="CustLoveM"></param>
        /// <param name="LoveBegin"></param>
        /// <param name="LoveEnd"></param>
        /// <param name="CustLinkMan"></param>
        /// <param name="ord"></param>
        /// <returns></returns>
        public static DataTable ExportLoveInfo(string CanUserID,string CustID, CustLoveModel CustLoveM, string LoveBegin, string LoveEnd, string CustLinkMan, string ord)
        {
            try
            {
                #region sql语句
                string sql = "select " +
                                   " cl.id,cl.LoveNo,cl.Title,CONVERT(varchar(100), cl.LoveDate, 20) LoveDate," +
                                   " clm.LinkManName,isnull(cp.TypeName,'') LoveType,cl.CustID,ci.CustName CustNam,el.EmployeeName,cl.CanViewUserName " +
                               " from " +
                                   " officedba.custlove cl" +
                                   " left join officedba.CustInfo ci on ci.id =  cl.CustID " +
                                   " left join officedba.EmployeeInfo el on el.id = cl.Linker" +
                                   " left join officedba.CustLinkMan clm on clm.id = cl.CustLinkMan " +
                                   " left join officedba.CodePublicType cp on cp.id = cl.LoveType" +
                               " where" +
                               " cl.CompanyCD = '" + CustLoveM.CompanyCD + "'" +
                               " and (cl.CanViewUser like '%" + "," + CanUserID + "," + "%' or '" + CanUserID + "' = cl.Linker or cl.CanViewUser = '******' or cl.CanViewUser is null )";
                if (CustID != "")
                    sql += " and ci.id = '" + CustID + "'";
                if (CustLoveM.LoveType != 0)
                    sql += " and cl.LoveType = " + CustLoveM.LoveType + "";
                if (LoveBegin != "")
                    sql += " and cl.LoveDate >= '" + LoveBegin + "'";
                if (LoveEnd != "")
                    sql += " and cl.LoveDate <= '" + LoveEnd + "'";
                if (CustLoveM.Title != "")
                    sql += " and cl.title like '%" + CustLoveM.Title + "%'";
                if (CustLinkMan != "")
                    sql += " and clm.LinkManName like '%" + CustLinkMan + "%'";

                #endregion

                return SqlHelper.ExecuteSql(sql);
            }
            catch (Exception ex)
            {
                string smeg = ex.Message;
                return null;
            }
        }
示例#5
0
        /// <summary>
        /// 根据客户关怀ID修改关怀信息
        /// </summary>
        /// <param name="CustLoveM">客户关怀信息</param>
        /// <returns>bool值</returns>
        public static bool UpdateLove(CustLoveModel CustLoveM)
        {
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
            LogInfoModel logModel = new LogInfoModel(); //操作日志
            bool isSucc = false;//定义返回变量

            #region 设置操作日志内容
            //设置公司代码
            logModel.CompanyCD = userInfo.CompanyCD;
            //设置登陆用户ID
            logModel.UserID = userInfo.UserID;
            //设置模块ID 模块ID在ConstUtil中定义,以便维护
            logModel.ModuleID = ConstUtil.MODULE_ID_CUST_LOVE_LIST;
            //操作单据编号  关怀单编号
            logModel.ObjectID = CustLoveM.LoveNo;
            //操作对象 操作的表信息
            logModel.ObjectName = ConstUtil.TABLE_NAME_LOVE;
            //涉及关键元素 涉及其他业务、表关系
            logModel.Element = string.Empty;
            //备注 操作类型
            logModel.Remark = ConstUtil.LOG_PROCESS_UPDATE;
            #endregion

            try
            {
                isSucc = LoveDBHelper.UpdateLove(CustLoveM);
            }
            catch (System.Exception ex)
            {
                #region  操作失败时记录日志到文件
                //定义变量
                LogInfo logSys = new LogInfo();
                //设置日志类型 需要指定为系统日志
                logSys.Type = LogInfo.LogType.SYSTEM;
                //指定系统日志类型 出错信息
                logSys.SystemKind = LogInfo.SystemLogKind.SYSTEM_ERROR;
                //指定登陆用户信息
                logSys.UserInfo = userInfo;
                //设定模块ID
                logSys.ModuleID = ConstUtil.MODULE_ID_CUST_LOVE_LIST;
                //描述
                logSys.Description = ex.ToString();
                //输出日志
                LogUtil.WriteLog(logSys);
                #endregion
            }

            if (isSucc)//操作成功
            {
                logModel.Remark += "成功";
            }
            else//操作失败
            {
                logModel.Remark += "失败";
            }

            //记录日志
            LogDBHelper.InsertLog(logModel);

            return isSucc;
        }
示例#6
0
 /// <summary>
 /// 导出客户关怀信息列表
 /// </summary>
 /// <param name="CustName"></param>
 /// <param name="CustLoveM"></param>
 /// <param name="LoveBegin"></param>
 /// <param name="LoveEnd"></param>
 /// <param name="CustLinkMan"></param>
 /// <param name="ord"></param>
 /// <returns></returns>
 public static DataTable ExportLoveInfo(string CanUserID,string CustID, CustLoveModel CustLoveM, string LoveBegin, string LoveEnd, string CustLinkMan, string ord)
 {
     return LoveDBHelper.ExportLoveInfo(CanUserID,CustID, CustLoveM, LoveBegin, LoveEnd, CustLinkMan, ord);
 }
示例#7
0
 /// <summary>
 /// 根据条件查询客户关怀
 /// </summary>
 /// <param name="CustName">客户名称</param>
 /// <param name="CustLoveM">关怀信息</param>
 /// <param name="LoveBegin">开始时间</param>
 /// <param name="LoveEnd">结束时间</param>
 /// <param name="CustLinkMan">客户联系人</param>
 /// <returns>查询结果</returns>
 public static DataTable GetLoveInfoBycondition(string CanUserID, string CustName, CustLoveModel CustLoveM, string LoveBegin, string LoveEnd, string CustLinkMan, int pageIndex, int pageCount, string ord, ref int totalCount)
 {
     return LoveDBHelper.GetLoveInfoBycondition(CanUserID,CustName, CustLoveM, LoveBegin, LoveEnd, CustLinkMan, pageIndex, pageCount, ord, ref totalCount);
 }