/// <summary>
        /// 获取联系人信息
        /// </summary>
        /// <param name="sid">供应商编号</param>
        /// <returns></returns>
        protected string GetContactInfo(object sid, string type)
        {
            string sourceID = sid.ToString();

            EyouSoft.BLL.SourceStructure.BSource       bll   = new BSource();
            EyouSoft.Model.SourceStructure.MSourceShip model = bll.GetShipModel(sourceID);
            StringBuilder stb = new System.Text.StringBuilder();

            if (model != null)
            {
                IList <EyouSoft.Model.CrmStructure.MCrmLinkman> list = model.LinkManList;
                bool IsPermission = false;
                bool IsRecommend  = false;
                if (model.SourceModel != null)
                {
                    IsPermission = model.SourceModel.IsPermission;
                    IsRecommend  = model.SourceModel.IsRecommend;
                }
                switch (type)
                {
                //供应商是否签单和推荐
                case "icon":
                    stb.Append(EyouSoft.Common.UtilsCommons.GetCompanyRecommend((object)IsRecommend, (object)IsPermission));
                    break;

                case "name":
                    if (list != null && list.Count > 0)
                    {
                        stb.Append(list[0].Name);
                    }
                    break;

                case "tel":
                    if (list != null && list.Count > 0)
                    {
                        stb.Append(string.IsNullOrEmpty(list[0].Telephone) ? list[0].MobilePhone : list[0].Telephone);
                    }
                    break;

                case "fax":
                    if (list != null && list.Count > 0)
                    {
                        stb.Append(list[0].Fax);
                    }
                    break;

                case "list":
                    if (list != null && list.Count > 0)
                    {
                        stb.Append("<table cellspacing='0' cellpadding='0' border='0' width='100%' class='pp-tableclass'><tr class='pp-table-title'><th height='23' width='7%' align='center'>编号</th><th width='19%' align='center'>联系人</th><th align='center' width='20%'>电话</th><th align='center'>手机</th><th align='center' width='18%'>传真</th></tr>");
                        for (int i = 0; i < list.Count; i++)
                        {
                            stb.Append("<tr><td align='center' width='7%'>" + (i + 1).ToString() + "</td><td  width='19%' align='center'>" + list[i].Name + "</td><td align='center' width='20%'>" + list[i].Telephone + "</td><td align='center' width='18%'>" + list[i].MobilePhone + "</td><td align='center' width='19%'>" + list[i].Fax + "</td></tr>");
                        }
                        stb.Append("</table>");
                    }
                    break;
                }
            }
            return(stb.ToString());
        }
Beispiel #2
0
        /// <summary>
        /// 页面初始化
        /// </summary>
        /// <param name="id">操作ID</param>
        protected void PageInit(string dotype, string id)
        {
            this.UploadControl1.CompanyID = this.SiteUserInfo.CompanyId;
            this.txtLastHuman.Text        = this.SiteUserInfo.Name;
            this.txtLastHuman.Enabled     = false;
            this.txtLastDate.Enabled      = false;

            if (String.Equals(dotype, "update", StringComparison.InvariantCultureIgnoreCase) && !string.IsNullOrEmpty(id))
            {
                EyouSoft.BLL.SourceStructure.BSource       BLL     = new EyouSoft.BLL.SourceStructure.BSource();
                EyouSoft.Model.SourceStructure.MSourceShip msource = BLL.GetShipModel(id);
                if (msource != null)
                {
                    if (msource.SourceModel != null)
                    {
                        Countryindex  = msource.SourceModel.CountryId;
                        Provinceindex = msource.SourceModel.ProvinceId;
                        Cityindex     = msource.SourceModel.CityId;
                        Areaindex     = msource.SourceModel.CountyId;
                        this.txtCruiseCompany.Text      = msource.SourceModel.Name;
                        this.txtaddress.Text            = msource.SourceModel.Address;
                        this.txtUnitPolicy.Text         = msource.SourceModel.UnitPolicy;
                        this.txtContractDate.Text       = UtilsCommons.SetDateTimeFormart(msource.SourceModel.ContractPeriodEnd);
                        this.txtContractDate_Start.Text = UtilsCommons.SetDateTimeFormart(msource.SourceModel.ContractPeriodStart);
                        Radio_hd_no.Checked             = true;
                        if (msource.SourceModel.IsSignContract)
                        {
                            this.Radio_hd_yes.Checked   = true;
                            this.Radio_hd_no.Checked    = false;
                            this.txtContractNum.Text    = msource.SourceModel.ContractCode;
                            this.txtContractNum.Visible = true;
                        }
                        radno.Checked = true;
                        if (msource.SourceModel.IsCommission)
                        {
                            radyes.Checked = true;
                            radno.Checked  = false;
                        }
                        RadRecommend_no.Checked = true;
                        if (msource.SourceModel.IsRecommend)
                        {
                            RadRecommend_yes.Checked = true;
                            RadRecommend_no.Checked  = false;
                        }
                        RadSign_no.Checked = true;
                        if (msource.SourceModel.IsPermission)
                        {
                            RadSign_yes.Checked = true;
                            RadSign_no.Checked  = false;
                        }
                        this.txtLastDate.Text  = UtilsCommons.GetDateString(msource.SourceModel.LastModifyTime, ProviderToDate);
                        this.txtLastHuman.Text = msource.SourceModel.LastModifierId;
                        if (msource.SourceModel.ContractAttach != null)
                        {
                            StringBuilder strFile = new StringBuilder();
                            if (msource.SourceModel.ContractAttach.FilePath != "")
                            {
                                strFile.AppendFormat("<span class='upload_filename'><a href='/CommonPage/FileDownLoad.aspx?doType=downLoad&filePath={0}&name={1}' target='_blank'>{1}</a><a href=\"javascript:void(0)\" onclick=\"CruiseEditPage.DelFile(this)\" title='删除附件'><img style='vertical-align:middle' src='/images/cha.gif'></a><input type=\"hidden\" name=\"hideFileInfo\" value='{1}|{0}'/></span>", msource.SourceModel.ContractAttach.FilePath, msource.SourceModel.ContractAttach.Name);
                            }
                            this.lbFiles.Text = strFile.ToString();
                        }
                    }

                    if (msource.LinkManList != null && msource.LinkManList.Count > 0)
                    {
                        this.Contact1.SetTravelList = msource.LinkManList;
                    }
                    if (msource.SubShipList != null && msource.SubShipList.Count > 0)
                    {
                        this.SetShipList = msource.SubShipList;
                    }
                    this.txtRoutes.Text      = msource.Routes;
                    this.txtCruiseTel.Text   = msource.Telephone;
                    this.txtOwerRoutes.Text  = msource.OwerRoutes;
                    this.txtstarttime.Text   = msource.StartTime.ToString();
                    this.txtCruiseTel.Text   = msource.Telephone;
                    this.txtendtime.Text     = msource.EndTime.ToString();
                    this.txtPriceSystem.Text = msource.PriceSystem;
                }
                else
                {
                    Utils.ResponseGoBack();
                }
            }
        }