예제 #1
0
 /// <summary>
 /// 获取线路联系人
 /// </summary>
 private void GetBussiness(string companyId)
 {
     if (!string.IsNullOrEmpty(companyId))
     {
         EyouSoft.Model.CompanyStructure.QueryParamsUser modelUser = new EyouSoft.Model.CompanyStructure.QueryParamsUser {
             IsShowAdmin = true
         };
         IList <CompanyUserBase> CompanyUserList = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance().GetList(companyId, modelUser);
         StringBuilder           strbContact     = new StringBuilder("{tolist:[");
         foreach (var item in CompanyUserList)
         {
             strbContact.Append("{\"ID\":\"" + item.ID + "\",\"UserNameID\":\"" + item.UserName + "\"},");
         }
         Response.Clear();
         Response.Write(strbContact.ToString().TrimEnd(',') + "]}");
         Response.End();
     }
 }
예제 #2
0
        /// <summary>
        /// 绑定公司用户
        /// </summary>
        protected string BindContact(string CompanyId)
        {
            if (!string.IsNullOrEmpty(CompanyId))
            {
                EyouSoft.Model.CompanyStructure.QueryParamsUser modelUser = new EyouSoft.Model.CompanyStructure.QueryParamsUser {
                    IsShowAdmin = true
                };
                IList <CompanyUserBase> CompanyUserList = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance().GetList(CompanyId, modelUser);
                EyouSoft.Model.SMSStructure.AccountInfo Accountmodel = EyouSoft.BLL.SMSStructure.Account.CreateInstance().GetAccountInfo(CompanyId);

                if (CompanyUserList.Count > 0)
                {
                    StringBuilder strB         = new StringBuilder("[");
                    string        Operator     = string.Empty;
                    string        CompanyMoney = "0.00";
                    if (Accountmodel != null)
                    {
                        CompanyMoney = Accountmodel.AccountMoney.ToString("f2");
                    }

                    foreach (var model in CompanyUserList)
                    {
                        if (model.IsAdmin)
                        {
                            Operator += model.UserName;
                        }
                        strB.Append("{\"UserName\":\"" + model.ContactInfo.ContactName + "|" + model.UserName + "\",\"UserId\":\"" + model.ID + "\"},");
                    }
                    strB.Remove(strB.Length - 1, 1);
                    strB.Append("]");

                    return(strB.ToString() + "$" + Operator + "$" + CompanyMoney);
                }
                else
                {
                    return("error");
                }
            }
            else
            {
                return("error");
            }
        }
예제 #3
0
        /// <summary>
        /// 绑定公司用户
        /// </summary>
        protected void BindContact(string[] argumentlist)
        {
            if (!string.IsNullOrEmpty(argumentlist[0]))
            {
                EyouSoft.Model.CompanyStructure.QueryParamsUser modelUser = new EyouSoft.Model.CompanyStructure.QueryParamsUser {
                    IsShowAdmin = true
                };
                IList <CompanyUserBase> CompanyUserList = EyouSoft.BLL.CompanyStructure.CompanyUser.CreateInstance().GetList(argumentlist[0], modelUser);

                if (CompanyUserList.Count > 0)
                {
                    StringBuilder strB     = new StringBuilder("[");
                    string        Operator = string.Empty;
                    foreach (var model in CompanyUserList)
                    {
                        if (model.IsAdmin)
                        {
                            Operator += model.UserName;
                        }
                        strB.Append("{\"UserName\":\"" + model.ContactInfo.ContactName + "|" + model.UserName + "\",\"UserId\":\"" + model.ID + "\"},");
                    }
                    strB.Remove(strB.Length - 1, 1);
                    strB.Append("]");

                    HttpContext.Current.Response.Write(strB + "$" + Operator);
                }
                else
                {
                    //HttpContext.Current.Response.Write("{\"errorMsg\":\"没有该公司编号的成员,请检查公司编号是否有误\"}");
                    HttpContext.Current.Response.Write("error");
                }
            }
            else
            {
                HttpContext.Current.Response.Write("请输入公司编号");
            }
        }