示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var accountId = Request.QueryString["accountId"];

            if (!string.IsNullOrEmpty(accountId))
            {
                account = comBll.GetCompany(long.Parse(accountId));
            }
            if (account == null)
            {
                Response.Write("<script>alert('为获取到客户信息');window.close();</script>");
                return;
            }
            accLocation = new crm_location_dal().GetLocationByAccountId(account.id);
            if (accLocation != null)
            {
                var disDal = new d_district_dal();
                if (accLocation.country_id != null)
                {
                    var country = new DAL.d_country_dal().FindById((long)accLocation.country_id);
                    countryName = country != null?country.country_name_display:"";
                }
                var province = disDal.FindById((long)accLocation.province_id);
                provinceName = province != null ? province.name : "";
                var city = disDal.FindById((long)accLocation.city_id);
                cityName = city != null ? city.name : "";
                var district = disDal.FindById((long)accLocation.district_id);
                districtName = district != null ? district.name : "";
            }
            subAccountList      = new crm_account_dal().GetSubsidiariesById(account.id);
            contactList         = new crm_contact_dal().GetContactByAccountId(account.id);
            oppoList            = new crm_opportunity_dal().FindOpHistoryByAccountId(account.id);
            companyUdfList      = udfBLL.GetUdf(DicEnum.UDF_CATE.COMPANY);
            companyUdfValueList = udfBLL.GetUdfValue(DicEnum.UDF_CATE.COMPANY, account.id, companyUdfList);
            insProList          = new crm_installed_product_dal().GetInsProAccoByProName(account.id);
            todoList            = new com_activity_dal().GetNoCompleteTodo(account.id);
            noteList            = new com_activity_dal().GetNoteByAccount(account.id);
            oppoUdfList         = udfBLL.GetUdf(DicEnum.UDF_CATE.OPPORTUNITY);


            //var arr = new string[][] { new string[] { "上海", "张耀", "1" }, new string[] { "北京", "张耀", "1" }, new string[] { "上海", "朱飞", "1" } };
            //var test = from i in Enumerable.Range(0, (int)arr.GetLongLength(0))
            //           from j in Enumerable.Range(0, (int)arr.GetLongLength(1))
            //           from k in Enumerable.Range(0, (int)arr.GetLongLength(2))
            //           select arr[i,j,k];
        }
示例#2
0
        // 初始化自定义字段值
        private void InitValue(string colName)
        {
            var bll     = new UserDefinedFieldsBLL();
            var udfList = bll.GetUdf(DTO.DicEnum.UDF_CATE.CONTRACTS);

            udf = udfList.First(f => f.name.Equals(colName));
            var udfValues = bll.GetUdfValue(DTO.DicEnum.UDF_CATE.CONTRACTS, contractId, udfList);

            udfValue = udfValues.First(v => v.id == udf.id).value;

            id.Value          = udf.id.ToString();
            contract_id.Value = contractId.ToString();
        }
示例#3
0
        protected void SaveClose_Click(object sender, EventArgs e)
        {
            int    udfId    = int.Parse(id.Value);
            string udfValue = null;

            if (!string.IsNullOrEmpty(Request.Form[udfId.ToString()]))
            {
                udfValue = Request.Form[udfId.ToString()];
            }
            new ContractBLL().EditUdf(long.Parse(contract_id.Value), udfId, udfValue, Request.Form["description"], GetLoginUserId());
            var bll     = new UserDefinedFieldsBLL();
            var udfList = bll.GetUdf(DTO.DicEnum.UDF_CATE.CONTRACTS);

            udf = udfList.First(f => f.id.Equals(udfId));
            Response.Write("<script>alert('修改自定义字段值成功!');window.close();self.opener.location.reload();</script>");
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string colName = Request.QueryString["colName"];

            objectId = Convert.ToInt64(Request.QueryString["object_id"]);

            var objType = Request.QueryString["object_type"];

            switch (objType)
            {
            case "project":
                cate = DicEnum.UDF_CATE.PROJECTS;
                break;

            default:
                break;
            }
            thisUdfInfo = new DAL.sys_udf_field_dal().GetInfoByCateAndName((int)cate, colName);

            //if (!IsPostBack)
            //{
            var bll     = new UserDefinedFieldsBLL();
            var udfList = bll.GetUdf(cate);

            udf = udfList.First(f => f.name.Equals(colName));
            var udfValues = bll.GetUdfValue(cate, objectId, udfList);

            udfValue = udfValues.First(v => v.id == udf.id).value;
            //}


            if (thisUdfInfo == null)  // 没有找到该自定义相关信息,停止响应
            {
                Response.End();
            }
        }