コード例 #1
0
        /// <summary>
        /// 获取根据记录【指定ID】
        /// </summary>
        /// <param name="context"></param>

        public void get_follow_up(HttpContext context, string guid)
        {
            HttpRequest Request = context.Request;

            try
            {
                long   id             = RequestHelper.long_transfer(Request, "id");
                long   follow_cust_id = RequestHelper.long_transfer(Request, "follow_cust_id");
                long   follow_link_id = RequestHelper.long_transfer(Request, "follow_link_id");
                string follow_type    = RequestHelper.string_transfer(Request, "follow_type");
                //跟进列表
                List <follow_up> follow_selfs = dic_Self[guid];
                //指定的一个客户
                follow_up follow_up = (from t in follow_selfs
                                       where t.id == id
                                       select t).FirstOrDefault();
                Dictionary <string, object> dic_follow_up = ConverList <follow_up> .T_ToDic(follow_up);

                //联系人列表,当前用户
                List <cust_linkman> cust_linkman_selfs = cust_linkman_handle.dic_Self[guid];
                //联系人名称和客户名称
                cust_linkman cust_linkman = (from t in cust_linkman_selfs
                                             where t.id == follow_up.follow_link_id
                                             select t).FirstOrDefault();
                if (cust_linkman != null)
                {
                    dic_follow_up["follow_link_name"] = cust_linkman.link_name;
                    dic_follow_up["follow_cust_name"] = cust_linkman.link_cust_name;
                }
                //跟进类型
                dic_follow_up["follow_type_name"] = LevelHelper.Getfollow_level(follow_up.follow_type.ToString());
                if (Constant.list_picture_All != null)
                {
                    //获取指定的图片【类型 和ID】
                    List <picture> listp = (from t in Constant.list_picture_All
                                            where t.pic_en_table == "follow_up" && t.pic_table_id == id
                                            select t).ToList();
                    string pic = "";
                    foreach (picture p in listp)
                    {
                        pic += p.pic_url + ',';
                    }
                    dic_follow_up["pic"] = pic.Trim(',');
                }
                jsonModel = Constant.get_jsonmodel(0, "success", dic_follow_up);
            }
            catch (Exception ex)
            {
                jsonModel = Constant.ErrorGetData(ex);
            }
            finally
            {
                string jsonString = Constant.jss.Serialize(jsonModel);
                context.Response.Write("{\"result\":" + jsonString + "}");
            }
        }
コード例 #2
0
        /// <summary>
        /// /工作报告详情【分享圈也使用】
        /// </summary>
        /// <param name="context"></param>
        public void workreport_info(HttpContext context, string guid)
        {
            HttpRequest Request = context.Request;
            long        id      = RequestHelper.long_transfer(Request, "id");

            try
            {
                //指定一个报告
                workreport workreport = (from t in list_All
                                         where t.id == id
                                         select t).FirstOrDefault();
                if (workreport != null)
                {
                    Dictionary <string, object> dic_workreport = ConverList <workreport> .T_ToDic(workreport);

                    //添加点评
                    add_comment(workreport, dic_workreport);

                    //添加图片
                    add_img(workreport, dic_workreport);

                    jsonModel = Constant.get_jsonmodel(0, "success", dic_workreport);
                }
            }
            catch (Exception ex)
            {
                jsonModel = Constant.ErrorGetData(ex);
            }
            finally
            {
                //若为1 代表当前人为管理员  若为0则为普通员工
                if (Constant.dicLimit_P.ContainsKey(guid))
                {
                    jsonModel.status = "IsAdmin";
                }
                string jsonString = Constant.bbc.ConverDatetime(Constant.jss.Serialize(jsonModel));
                context.Response.Write("{\"result\":" + jsonString + "}");
            }
        }
コード例 #3
0
        /// <summary>
        /// 获取联系人信息
        /// </summary>
        /// <param name="context"></param>
        public void get_cust_linkman_info(HttpContext context, string guid)
        {
            HttpRequest Request = context.Request;
            long        id      = RequestHelper.int_transfer(Request, "id");

            try
            {
                //联系人列表,当前用户
                List <cust_linkman> cust_linkman_selfs = dic_Self[guid];
                //指定的一个联系人
                cust_linkman select_linkman = (from t in cust_linkman_selfs
                                               where t.id == id
                                               select t).FirstOrDefault();
                if (select_linkman != null)
                {
                    Dictionary <string, object> item = ConverList <cust_linkman> .T_ToDic(select_linkman);

                    //联系人名称
                    string link_levelName = Convert.ToString(item["link_level"]);
                    item["link_levelName"] = LevelHelper.Getlink_level(link_levelName);
                    //生日
                    DateTime datetime_P = Convert.ToDateTime(item["link_birthday"]);
                    item["link_birthday"] = datetime_P.ToString("yyyy-MM-dd") == "1800-01-01" ? "" : datetime_P.ToString("yyyy-MM-dd");

                    jsonModel = Constant.get_jsonmodel(0, "success", item);
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
                jsonModel = Constant.ErrorGetData(ex);
            }
            finally
            {
                context.Response.Write("{\"result\":" + Constant.jss.Serialize(jsonModel) + "}");
            }
        }
コード例 #4
0
ファイル: workplan_handle.ashx.cs プロジェクト: yfbTeam/CRM
        public void get_workplan_info(HttpContext context, string guid)
        {
            /// <summary>
            /// 返回的数据
            /// </summary>
            Dictionary <string, object> dic_info = new Dictionary <string, object>();

            HttpRequest Request = context.Request;
            //获取工作计划ID
            string id = RequestHelper.string_transfer(Request, "id");

            int  ind_id = -1;
            bool hasID  = int.TryParse(id, out ind_id);

            try
            {
                //获取指定的图片【类型 和ID】
                List <picture> listp = new List <picture>();

                //工作计划,当前用户
                List <workplan> workplan_selfs = workplan_handle.dic_Self[guid];
                //指定一个工作计划
                var workplaneQuery = (from t in workplan_selfs
                                      where t.id == ind_id
                                      select new
                {
                    dic_info = ConverList <workplan> .T_ToDic(t),
                }
                                      );
                //获取指定图片
                var picQuery = (from t in Constant.list_picture_All
                                where t.pic_en_table == "workplan" && t.pic_table_id == ind_id
                                select new
                {
                    img = t,
                }
                                );

                if (workplaneQuery.Count() > 0)
                {
                    //指定工作计划数据
                    dic_info = workplaneQuery.ElementAt(0).dic_info;
                    string wp_endplandate = Convert.ToString(dic_info["wp_endplandate"]);
                    string wp_reminddate  = Convert.ToString(dic_info["wp_reminddate"]);

                    dic_info["wp_endplandate"] = string.IsNullOrEmpty(wp_endplandate) ? "1800-01-01 00:00:00.000" : wp_endplandate;
                    dic_info["wp_reminddate"]  = string.IsNullOrEmpty(wp_reminddate) ? "1800-01-01 00:00:00.000" : wp_reminddate;

                    string pic = "";
                    foreach (var item in picQuery)
                    {
                        pic += item.img.pic_url + ',';
                    }
                    //通过这种方式移除最后一个逗号
                    dic_info["pic"] = pic.Trim(',');

                    jsonModel = Constant.get_jsonmodel(0, "success", dic_info);
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
                jsonModel = Constant.ErrorGetData(ex);
            }
            finally
            {
                context.Response.Write("{\"result\":" + Constant.bbc.ConverDatetime(Constant.jss.Serialize(jsonModel) + "}"));
            }
        }