Ejemplo n.º 1
0
        /// <summary>
        /// 根据商机获取相应项目的值
        /// </summary>
        public void GetPorUdfByOpp(HttpContext context, long oppo_id)
        {
            var thisOpp = new crm_opportunity_dal().FindNoDeleteById(oppo_id);

            if (thisOpp != null)
            {
                var projectUdfList = new UserDefinedFieldsBLL().GetUdf(DicEnum.UDF_CATE.PROJECTS);

                var oppoUdfList   = new UserDefinedFieldsBLL().GetUdf(DicEnum.UDF_CATE.OPPORTUNITY);
                var oppoValueList = new UserDefinedFieldsBLL().GetUdfValue(DicEnum.UDF_CATE.OPPORTUNITY, thisOpp.id, oppoUdfList);

                if (projectUdfList != null && projectUdfList.Count > 0)
                {
                    StringBuilder udfHtml = new StringBuilder();
                    var           sufDal  = new sys_udf_field_dal();
                    foreach (var thisProUdf in projectUdfList)
                    {
                        var thisSysProFile = sufDal.FindNoDeleteById(thisProUdf.id);
                        if (thisSysProFile != null && thisSysProFile.crm_to_project_udf_id != null)
                        {
                            var thisSysOppFile = sufDal.FindNoDeleteById((long)thisSysProFile.crm_to_project_udf_id);
                            var oppoValue      = oppoValueList.FirstOrDefault(_ => _.id == thisSysProFile.crm_to_project_udf_id);
                            if (oppoValue != null && thisSysOppFile != null && !string.IsNullOrEmpty(oppoValue.value.ToString()))
                            {
                                udfHtml.Append($"<tr height='21'><td id ='txtBlack8'>{thisSysProFile.col_comment}</td><td> {thisSysOppFile.col_comment} </td><td>{oppoValue.value.ToString()}<input type='hidden' name='{thisProUdf.id.ToString()}' id='{thisProUdf.id.ToString()}' value='{oppoValue.value.ToString()}' /></ td></ tr>");
                            }
                        }
                    }

                    context.Response.Write(udfHtml.ToString());
                }
            }
        }
Ejemplo n.º 2
0
        protected void SaveClose_Click(object sender, EventArgs e)
        {
            string udfValue = Request.Form[udf.id.ToString()];

            if (!string.IsNullOrWhiteSpace(udfValue) && !string.IsNullOrEmpty(udfValue))
            {
            }
            else
            {
                udfValue = null;
            }
            DicEnum.OPER_LOG_OBJ_CATE operCate = DicEnum.OPER_LOG_OBJ_CATE.PROJECT_EXTENSION_INFORMATION;
            switch (cate)
            {
            case DicEnum.UDF_CATE.PROJECTS:
                operCate = DicEnum.OPER_LOG_OBJ_CATE.PROJECT_EXTENSION_INFORMATION;
                break;

            default:
                break;
            }


            var result = new UserDefinedFieldsBLL().EditUdf(cate, objectId, udf.id, udfValue, Request.Form["description"], LoginUserId, operCate);

            if (result)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('保存成功');window.close();self.opener.location.reload();</script>");
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('保存失败');window.close();self.opener.location.reload();</script>");
            }
        }
Ejemplo n.º 3
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();
        }
Ejemplo n.º 4
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>");
        }
Ejemplo n.º 5
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();
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 查询自定义字段激活状态
        /// </summary>
        private void GetUdfStatus()
        {
            var bll = new UserDefinedFieldsBLL();

            WriteResponseJson(bll.GetUdfIsActive(long.Parse(request.QueryString["id"])));
        }
Ejemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                var ticketIds = Request.QueryString["ticketIds"];
                var sdDal     = new sdk_task_dal();
                if (!string.IsNullOrEmpty(ticketIds))
                {
                    ticketList = sdDal.GetTicketByIds(ticketIds);
                }
                if (ticketList != null && ticketList.Count > 0)
                {
                    if (ticketList.Count == 1)
                    {
                        isSingle = true;
                    }
                    else
                    {
                        isSingle = false;
                    }
                    thisTicket = ticketList[0];
                }
                else
                {
                    Response.Write("<script>alert('未查询到相关工单信息!');window.close();</script>");
                    return;
                }
                var udfBLL = new UserDefinedFieldsBLL();
                if (thisTicket == null)
                {
                    Response.Write("<script>alert('未查询到相关工单信息!');window.close();</script>");
                }
                else
                {
                    thisAccount = new CompanyBLL().GetCompany(thisTicket.account_id);
                    thisUser    = new sys_resource_dal().FindNoDeleteById(LoginUserId);
                    #region 获取相关属性是否可以更改
                    if (ticketList.Any(_ => _.id != thisTicket.id))
                    {
                        isManyTitle = true;
                    }
                    else
                    {
                        isManyTitle = false;
                    }
                    if (ticketList.Any(_ => _.id != thisTicket.id))
                    {
                        isManydesc = true;
                    }
                    else
                    {
                        isManydesc = false;
                    }
                    if (ticketList.Any(_ => _.id != thisTicket.id && _.department_id != thisTicket.department_id))
                    {
                        isManyDep = true;
                    }
                    else
                    {
                        isManyDep = false;
                    }
                    if (ticketList.Any(_ => _.id != thisTicket.id && _.issue_type_id != thisTicket.issue_type_id))
                    {
                        isManyissType = true;
                    }
                    else
                    {
                        isManyissType = false;
                    }
                    if (ticketList.Any(_ => _.id != thisTicket.id && (_.owner_resource_id != thisTicket.owner_resource_id && _.role_id != thisTicket.role_id)))
                    {
                        isManyPri = true;
                    }
                    else
                    {
                        isManyPri = false;
                        if (thisTicket.owner_resource_id != null && thisTicket.role_id != null)
                        {
                            thisPriRes = new sys_resource_dal().FindNoDeleteById((long)thisTicket.owner_resource_id);
                            thisRole   = new sys_role_dal().FindNoDeleteById((long)thisTicket.role_id);
                            var resDepList = new sys_resource_department_dal().GetResDepByResAndRole((long)thisTicket.owner_resource_id, (long)thisTicket.role_id);
                            if (resDepList != null && resDepList.Count > 0)
                            {
                                proResDep = resDepList[0];
                            }
                        }
                    }

                    if (ticketList.Any(_ => _.id != thisTicket.id && _.cate_id != thisTicket.cate_id))
                    {
                        isManyTicketCate = true;
                    }
                    else
                    {
                        isManyTicketCate = false;
                    }
                    if (ticketList.Any(_ => _.id != thisTicket.id && _.estimated_hours != thisTicket.estimated_hours))
                    {
                        isManyEstHour = true;
                    }
                    else
                    {
                        isManyEstHour = false;
                    }
                    if (ticketList.Any(_ => _.id != thisTicket.id && _.estimated_end_time != thisTicket.estimated_end_time))
                    {
                        isManyDueTime = true;
                    }
                    else
                    {
                        isManyDueTime = false;
                    }
                    if (ticketList.Any(_ => _.id != thisTicket.id && _.account_id != thisTicket.account_id))
                    {
                        isManyAccount = true;
                    }
                    else
                    {
                        isManyAccount = false;
                    }
                    if (ticketList.Any(_ => _.id != thisTicket.id && _.contract_id != thisTicket.contract_id))
                    {
                        isManyContract = true;
                    }
                    else
                    {
                        isManyContract = false;
                        if (thisTicket.contract_id != null)
                        {
                            thisContract = new ctt_contract_dal().FindNoDeleteById((long)thisTicket.contract_id);
                        }
                    }
                    if (ticketList.Any(_ => _.id != thisTicket.id && _.status_id != thisTicket.status_id))
                    {
                        isManyStatus = true;
                    }
                    else
                    {
                        isManyStatus = false;
                    }
                    if (ticketList.Any(_ => _.id != thisTicket.id && _.service_id != thisTicket.service_id))
                    {
                        isManySerivce = true;
                    }
                    else
                    {
                        isManySerivce = false;
                    }
                    if (ticketList.Any(_ => _.id != thisTicket.id && _.priority_type_id != thisTicket.priority_type_id))
                    {
                        isManyPrio = true;
                    }
                    else
                    {
                        isManyPrio = false;
                    }
                    if (ticketList.Any(_ => _.id != thisTicket.id && _.cost_code_id != thisTicket.cost_code_id))
                    {
                        isManyWork = true;
                    }
                    else
                    {
                        isManyWork = false;
                        if (thisTicket.cost_code_id != null)
                        {
                            thisWorkType = new d_cost_code_dal().FindNoDeleteById((long)thisTicket.cost_code_id);
                        }
                    }

                    if (ticketList.Any(_ => _.id != thisTicket.id && _.sub_issue_type_id != thisTicket.sub_issue_type_id))
                    {
                        isManySubIssType = true;
                    }
                    else
                    {
                        isManySubIssType = false;
                    }
                    // protected bool isManyStatus;
                    #endregion

                    udfValue = udfBLL.GetUdfValue(DicEnum.UDF_CATE.TASK, thisTicket.id, udfTaskPara);
                    if (udfTaskPara != null && udfTaskPara.Count > 0)
                    {
                        foreach (var udfTask in udfTaskPara)
                        {
                            var thisValue = "";
                            if (udfValue.FirstOrDefault(_ => _.id == udfTask.id) != null)
                            {
                                thisValue = udfValue.FirstOrDefault(_ => _.id == udfTask.id).value.ToString();
                            }
                            var count = new UserDefinedFieldsBLL().GetSameValueCount(DicEnum.UDF_CATE.TASK, ticketIds, udfTask.col_name, thisValue.ToString());
                            if (count > 1 && (!isSingle))
                            {
                                udfValue.FirstOrDefault(_ => _.id == udfTask.id).value = "多个值-保持不变";
                            }
                        }
                    }

                    var otherResList = new sdk_task_resource_dal().GetTaskResByTaskId(thisTicket.id);
                    if (otherResList != null && otherResList.Count > 0)
                    {
                        foreach (var item in otherResList)
                        {
                            if (item.resource_id != null && item.role_id != null)
                            {
                                var resDepList = new sys_resource_department_dal().GetResDepByResAndRole((long)item.resource_id, (long)item.role_id);
                                if (resDepList != null && resDepList.Count > 0)
                                {
                                    ticketResIds += resDepList[0].id + ",";
                                }
                            }
                        }

                        if (ticketResIds != "")
                        {
                            ticketResIds = ticketResIds.Substring(0, ticketResIds.Length - 1);
                        }
                    }
                }

                if (IsPostBack)
                {
                    var stDal      = new sdk_task_dal();
                    var ticBll     = new TicketBLL();
                    var accBll     = new CompanyBLL();
                    var notiResIds = new System.Text.StringBuilder();
                    foreach (var tic in ticketList)
                    {
                        var ticket = stDal.FindNoDeleteById(tic.id);
                        if (ticket == null)
                        {
                            continue;
                        }
                        var user = UserInfoBLL.GetUserInfo(LoginUserId);

                        #region 获取相关参数

                        #region 标题,描述,队列,主负责人
                        var pageTitle = ticket.title;
                        if (!isManyTitle)
                        {
                            pageTitle = Request.Form["title"];
                        }
                        var pageDesc = ticket.description;
                        if (!isManydesc)
                        {
                            pageDesc = Request.Form["description"];
                        }

                        var pageDepIdString    = Request.Form["department_id"];
                        var pagePriResIdString = Request.Form["pri_res"];
                        if (string.IsNullOrEmpty(pageDepIdString) && string.IsNullOrEmpty(pagePriResIdString))
                        {
                            Response.Write("<script>alert('队列和主负责人请填写其中一项!');</script>");
                            return;
                        }
                        long?pageDepId;
                        if (!string.IsNullOrEmpty(pageDepIdString) && pageDepIdString != "0")
                        {
                            pageDepId = long.Parse(pageDepIdString);
                        }
                        else if (string.IsNullOrEmpty(pageDepIdString))
                        {
                            pageDepId = null;
                        }
                        else
                        {
                            pageDepId = ticket.department_id;
                        }

                        long?pagePriResId;
                        if (!string.IsNullOrEmpty(pagePriResIdString) && pagePriResIdString != "0")
                        {
                            pagePriResId = long.Parse(pagePriResIdString);
                        }
                        else if (string.IsNullOrEmpty(pagePriResIdString))
                        {
                            pagePriResId = null;
                        }
                        else
                        {
                            pagePriResId = ticket.owner_resource_id;
                        }
                        #endregion

                        #region 种类,预估时间,到期时间,合同名称
                        var pageCateId       = ticket.cate_id;
                        var pageCateIdString = Request.Form["ticket_cate"];
                        if (!string.IsNullOrEmpty(pageCateIdString) && pageCateIdString != "0")
                        {
                            pageCateId = int.Parse(pageCateIdString);
                        }
                        else if (string.IsNullOrEmpty(pagePriResIdString))
                        {
                            Response.Write("<script>alert('请选择工单种类!');</script>");
                            return;
                        }
                        else
                        {
                            pageCateId = ticket.cate_id;
                        }

                        var estHours     = ticket.estimated_hours;
                        var pageEstHours = Request.Form["est_hours"];
                        if (!string.IsNullOrEmpty(pageEstHours) && pageEstHours.Trim() != "多个值-保持不变")
                        {
                            estHours = decimal.Parse(pageEstHours);
                        }
                        var dueTime     = ticket.estimated_end_time;
                        var pageDueTime = Request.Form["due_time"];
                        if (!string.IsNullOrEmpty(pageDueTime) && pageDueTime.Trim() != "多个值-保持不变")
                        {
                            dueTime = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Parse(pageDueTime));
                        }
                        var contractName = ticket.contract_id;
                        var pageContract = Request.Form["contractName"];
                        if (!string.IsNullOrEmpty(pageContract) && pageContract != "0")
                        {
                            contractName = long.Parse(pageContract);
                        }
                        else if (string.IsNullOrEmpty(pageContract))
                        {
                            contractName = null;
                        }
                        #endregion

                        #region 状态,服务包,优先级,工作类型,问题类型,子问题类型
                        var pageStatusId        = ticket.status_id;
                        var pageStuatusIdString = Request.Form["statusId"];
                        if (!string.IsNullOrEmpty(pageStuatusIdString) && pageStuatusIdString != "0")
                        {
                            pageStatusId = int.Parse(pageStuatusIdString);
                        }
                        else if (string.IsNullOrEmpty(pageStuatusIdString))
                        {
                            Response.Write("<script>alert('请选择工单状态!');</script>");
                            return;
                        }

                        var pageServiceId       = ticket.service_id;
                        var pageServiceIdString = Request.Form["serviceId"];
                        if (!string.IsNullOrEmpty(pageServiceIdString) && pageServiceIdString != "0")
                        {
                            pageServiceId = int.Parse(pageServiceIdString);
                        }
                        else if (string.IsNullOrEmpty(pageServiceIdString))
                        {
                            pageServiceId = null;
                        }

                        var pagePrioId       = ticket.priority_type_id;
                        var pagePrioIdString = Request.Form["priorityId"];
                        if (!string.IsNullOrEmpty(pagePrioIdString) && pagePrioIdString != "0")
                        {
                            pagePrioId = int.Parse(pagePrioIdString);
                        }
                        else if (string.IsNullOrEmpty(pagePrioIdString))
                        {
                            Response.Write("<script>alert('请选择工单优先级!');</script>");
                            return;
                        }

                        var workTypeId     = ticket.cost_code_id;
                        var pageWorkTypeId = Request.Form["workTypeId"];
                        if (!string.IsNullOrEmpty(pageWorkTypeId) && pageWorkTypeId != "0")
                        {
                            workTypeId = long.Parse(pageWorkTypeId);
                        }
                        else if (string.IsNullOrEmpty(pageWorkTypeId))
                        {
                            contractName = null;
                        }

                        var pageIssId       = ticket.issue_type_id;
                        var pageIssIdString = Request.Form["IssueType"];
                        if (!string.IsNullOrEmpty(pageIssIdString) && pageIssIdString != "0")
                        {
                            pageIssId = int.Parse(pageIssIdString);
                        }
                        else if (string.IsNullOrEmpty(pageIssIdString))
                        {
                            Response.Write("<script>alert('请选择问题类型!');</script>");
                            return;
                        }

                        var pageSubIssId       = ticket.sub_issue_type_id;
                        var pageSubIssIdString = Request.Form["SubIssueType"];
                        if (!string.IsNullOrEmpty(pageSubIssIdString) && pageSubIssIdString != "0")
                        {
                            pageSubIssId = int.Parse(pageSubIssIdString);
                        }
                        else if (string.IsNullOrEmpty(pageSubIssIdString))
                        {
                            Response.Write("<script>alert('请选择子问题类型!');</script>");
                            return;
                        }
                        #endregion

                        #region 自定义字段相关
                        var thisUdfValue = udfBLL.GetUdfValue(DicEnum.UDF_CATE.TASK, tic.id, udfTaskPara);
                        if (udfTaskPara != null && udfTaskPara.Count > 0)
                        {
                            var list = new List <UserDefinedFieldValue>();
                            foreach (var udf in udfTaskPara)
                            {
                                var new_udf = new UserDefinedFieldValue()
                                {
                                    id = udf.id
                                };
                                var thisvv = Request.Form[udf.id.ToString()];
                                if (udf.data_type == (int)DicEnum.UDF_DATA_TYPE.LIST)
                                {
                                    if (thisvv == "0")
                                    {
                                        new_udf.value = thisUdfValue.FirstOrDefault(_ => _.id == udf.id) == null ? "" : thisUdfValue.FirstOrDefault(_ => _.id == udf.id).value;
                                    }
                                    else
                                    {
                                        new_udf.value = thisvv == "" ? null : thisvv;
                                    }
                                }
                                else
                                {
                                    if (thisvv == "多个值-保持不变")
                                    {
                                        new_udf.value = thisUdfValue.FirstOrDefault(_ => _.id == udf.id) == null ? "" : thisUdfValue.FirstOrDefault(_ => _.id == udf.id).value;
                                    }
                                    else
                                    {
                                        new_udf.value = thisvv == "" ? null : thisvv;
                                    }
                                }
                                list.Add(new_udf);
                            }
                            udfBLL.UpdateUdfValue(DicEnum.UDF_CATE.TASK, udfTaskPara, ticket.id, list, user, DicEnum.OPER_LOG_OBJ_CATE.PROJECT_TASK);
                        }
                        #endregion

                        #endregion

                        #region 修改工单
                        ticket.title         = pageTitle;
                        ticket.description   = pageDesc;
                        ticket.department_id = pageDepId;
                        long?roleId = null;
                        if (pagePriResId != null)
                        {
                            var resDep = new sys_resource_department_dal().FindById((long)pagePriResId);
                            if (resDep != null)
                            {
                                pagePriResId = resDep.resource_id;
                                roleId       = resDep.role_id;
                            }
                            else
                            {
                                pagePriResId = null;
                                roleId       = null;
                            }
                        }
                        ticket.owner_resource_id  = pagePriResId;
                        ticket.role_id            = roleId;
                        ticket.cate_id            = pageCateId;
                        ticket.estimated_hours    = estHours;
                        ticket.estimated_end_time = dueTime;
                        ticket.contract_id        = contractName;
                        ticket.status_id          = pageStatusId;
                        ticket.service_id         = pageServiceId;
                        ticket.priority_type_id   = pagePrioId;
                        ticket.cost_code_id       = workTypeId;
                        ticket.issue_type_id      = pageIssId;
                        ticket.sub_issue_type_id  = pageSubIssId;

                        ticBll.EditTicket(ticket, LoginUserId);
                        #endregion

                        #region 生成备注
                        ticBll.AddModifyTicketNote(ticket.id, LoginUserId);
                        #endregion


                        #region 单个工单时 修改其他员工相关
                        if (isSingle)
                        {
                            var OtherResId = Request.Form["OtherResId"];
                            ticBll.TicketResManage(ticket.id, OtherResId, LoginUserId);
                        }
                        #endregion

                        #region 获取需要发送邮件的员工的Id
                        if (CkPriRes.Checked && ticket.owner_resource_id != null)
                        {
                            notiResIds.Append(ticket.owner_resource_id + ",");
                        }
                        if (CKcreate.Checked)
                        {
                            notiResIds.Append(ticket.create_user_id + ",");
                        }
                        if (CKaccMan.Checked)
                        {
                            var thisAccount = accBll.GetCompany(ticket.account_id);
                            if (thisAccount != null && thisAccount.resource_id != null)
                            {
                                notiResIds.Append(thisAccount.resource_id + ",");
                            }
                        }
                        #endregion
                    }


                    #region 通知相关
                    if (CCMe.Checked)
                    {
                        notiResIds.Append(LoginUserId + ",");
                    }
                    var resIds = Request.Form["resIds"];
                    if (!string.IsNullOrEmpty(resIds))
                    {
                        notiResIds.Append(resIds + ",");
                    }
                    var notify_id = Request.Form["notify_id"];
                    if (!string.IsNullOrEmpty(notify_id) && notify_id != "0")
                    {
                    }
                    #endregion
                    ClientScript.RegisterStartupScript(this.GetType(), "提示信息", "<script>alert('保存成功');self.opener.location.reload();window.close();</script>");
                }
            }
            catch (Exception msg)
            {
                Response.Write("<script>alert('" + msg.Message + "!');window.close();</script>");
            }
        }
Ejemplo n.º 8
0
        public void GetUdfByCate(HttpContext context)
        {
            var insProId = context.Request.QueryString["insProId"];
            crm_installed_product            insPro = null;
            List <DTO.UserDefinedFieldValue> iProduct_udfValueList = null;

            if (!string.IsNullOrEmpty(insProId))
            {
                insPro = new DAL.crm_installed_product_dal().FindNoDeleteById(long.Parse(insProId));
                var iProduct_udfList = new UserDefinedFieldsBLL().GetUdf(DTO.DicEnum.UDF_CATE.CONFIGURATION_ITEMS);
                iProduct_udfValueList = new UserDefinedFieldsBLL().GetUdfValue(DTO.DicEnum.UDF_CATE.CONFIGURATION_ITEMS, insPro.id, iProduct_udfList);
            }
            var    cateId  = context.Request.QueryString["cateId"];
            string udfHtml = "";

            if (!string.IsNullOrEmpty(cateId))
            {
                var usdList = new DAL.sys_udf_field_dal().GetUdfByGroupId(long.Parse(cateId));
                if (usdList != null && usdList.Count > 0)
                {
                    var udfFileDto = new UserDefinedFieldsBLL().GetUdf((DTO.DicEnum.UDF_CATE.CONFIGURATION_ITEMS));
                    usdList.ForEach(_ => {
                        DTO.UserDefinedFieldValue thisValue = null;
                        if (iProduct_udfValueList != null && iProduct_udfValueList.Count > 0)
                        {
                            thisValue = iProduct_udfValueList.FirstOrDefault(ip => ip.id == _.id);
                        }
                        switch (_.data_type_id)
                        {
                        case (int)DTO.DicEnum.UDF_DATA_TYPE.SINGLE_TEXT:
                            udfHtml += $"<tr><td class='ip_general_label_udf'><div class='clear'><label>{_.col_comment}</label><input type = 'text' name='{_.id}' class='sl_cdt' value='{(thisValue==null?"":thisValue.value)}' /></div></td></tr>";
                            break;

                        case (int)DTO.DicEnum.UDF_DATA_TYPE.MUILTI_TEXT:
                            udfHtml += $"<tr><td class='ip_general_label_udf'><div class='clear'><label>{_.col_comment}</label><textarea name='{_.id}' rows='2' cols='20'>{(thisValue == null ? "" : thisValue.value)}</textarea></div></td></tr>";
                            break;

                        case (int)DTO.DicEnum.UDF_DATA_TYPE.DATETIME:
                            udfHtml += $"<tr><td class='ip_general_label_udf'><div class='clear'><label>{_.col_comment}</label><input type = 'text' name='{_.id}' onclick='WdatePicker()' class='sl_cdt' value='{(thisValue == null ? "" : thisValue.value)}' /></div></td></tr>";
                            break;

                        case (int)DTO.DicEnum.UDF_DATA_TYPE.NUMBER:
                            udfHtml += $"<tr><td class='ip_general_label_udf'><div class='clear'><label>{_.col_comment}</label><input type = 'text' name='{_.id}'  maxlength='11' onkeyup=\"value = value.replace(/[^\\d] / g, '') \" onbeforepaste=\"clipboardData.setData('text', clipboardData.getData('text').replace(/[^\\d] / g, ''))\" class='sl_cdt' value='{(thisValue == null ? "" : thisValue.value)}' /></div></td></tr>";
                            break;

                        case (int)DTO.DicEnum.UDF_DATA_TYPE.LIST:
                            var thisListHtml = "";
                            if (udfFileDto != null && udfFileDto.Count > 0)
                            {
                                var thisList = udfFileDto.FirstOrDefault(u => u.id == _.id);
                                if (thisList != null && thisList.value_list != null && thisList.value_list.Count > 0)
                                {
                                    if (_.is_required == 0)
                                    {
                                        thisListHtml += "<option value=''> </option>";
                                    }
                                    thisList.value_list.ForEach(t => {
                                        if (thisValue != null && thisValue.value.ToString() == t.val)
                                        {
                                            thisListHtml += $"<option value='{t.val}' selected='selected'>{t.show}</option>";
                                        }
                                        else
                                        {
                                            thisListHtml += $"<option value='{t.val}'>{t.show}</option>";
                                        }
                                    });
                                }
                            }
                            udfHtml += $"<tr><td class='ip_general_label_udf'><div class='clear'><label>{_.col_comment}</label><select class='sl_cdt' name='{_.id}'>{thisListHtml}</select></div></td></tr>";
                            break;

                        default:
                            break;
                        }
                    });
                }
            }
            context.Response.Write(udfHtml);
        }