Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                var id = Request.QueryString["id"];
                thisProject = new pro_project_dal().FindNoDeleteById(long.Parse(id));
                if (thisProject != null)
                {
                    //  校验 是否有权限进行查看
                    if (AuthBLL.GetUserProjectAuth(LoginUserId, LoginUser.security_Level_id, thisProject.id).CanView == false)
                    {
                        Response.Write("<script>alert('无权查看');window.close();</script>");
                        Response.End();
                        return;
                    }
                    thisBookMark = new IndexBLL().GetSingBook(Request.Url.LocalPath + "?id=" + id, LoginUserId);


                    var thisAccount = new CompanyBLL().GetCompany(thisProject.account_id);
                    ShowTitle.Text = "项目-" + thisProject.no + thisProject.name + "(" + thisAccount.name + ")";
                    var type = Request.QueryString["type"];
                    switch (type)
                    {
                    case "Schedule":
                        viewProjectIframe.Src = "ProjectSchedule?project_id=" + thisProject.id;
                        break;

                    case "ScheduleTemp":
                        viewProjectIframe.Src = "ProjectSchedule?project_id=" + thisProject.id + "&isTranTemp=1";
                        break;

                    case "Team":
                        viewProjectIframe.Src = "../Common/SearchBodyFrame.aspx?id=" + thisProject.id + "&cat=" + (int)EMT.DoneNOW.DTO.DicEnum.QUERY_CATE.PROJECT_TEAM + "&type=" + (int)EMT.DoneNOW.DTO.QueryType.PROJECT_TEAM;
                        break;

                    case "Cost":
                        viewProjectIframe.Src = "../Common/SearchBodyFrame.aspx?id=" + thisProject.id + "&cat=" + (int)EMT.DoneNOW.DTO.DicEnum.QUERY_CATE.PROJECT_COST_EXPENSE + "&type=" + (int)EMT.DoneNOW.DTO.QueryType.PROJECT_COST_EXPENSE + "&isCheck=1";
                        break;    // project_cost_expense

                    case "Note":
                        viewProjectIframe.Src = "ProjectNoteShow?project_id=" + thisProject.id;
                        break;

                    case "Rate":
                        viewProjectIframe.Src = "../Common/SearchBodyFrame.aspx?id=" + thisProject.id + "&cat=" + (int)EMT.DoneNOW.DTO.DicEnum.QUERY_CATE.PROJECT_RATE + "&type=" + (int)EMT.DoneNOW.DTO.QueryType.PROJECT_RATE;
                        break;

                    case "Calendar":
                        //viewProjectIframe.Src = "../Common/SearchBodyFrame.aspx?id=" + thisProject.id + "&cat=" + (int)EMT.DoneNOW.DTO.DicEnum.QUERY_CATE.PROJECT_CALENDAR + "&type=" + (int)EMT.DoneNOW.DTO.QueryType.PROJECT_CALENDAR; project_udf
                        viewProjectIframe.Src = "ProjectCalendarShow?project_id=" + thisProject.id;
                        break;

                    case "Attach":
                        viewProjectIframe.Src = "../Common/SearchBodyFrame.aspx?id=" + thisProject.id + "&cat=" + (int)EMT.DoneNOW.DTO.DicEnum.QUERY_CATE.PROJECT_ATTACH + "&type=" + (int)EMT.DoneNOW.DTO.QueryType.PROJECT_ATTACH;
                        break;

                    case "UDF":
                        viewProjectIframe.Src = "../Common/SearchBodyFrame.aspx?id=" + thisProject.id + "&cat=" + (int)EMT.DoneNOW.DTO.DicEnum.QUERY_CATE.PROJECT_UDF + "&type=" + (int)EMT.DoneNOW.DTO.QueryType.PROJECT_UDF;
                        break;

                    case "ticket":
                        viewProjectIframe.Src = "../Common/SearchFrameSet.aspx?cat=" + (int)DicEnum.QUERY_CATE.MY_QUEUE_ACTIVE + "&type=" + (int)QueryType.MY_QUEUE_ACTIVE + "&group=215&param1=4890&param2=" + thisProject.id + "&param4=AddHidden";
                        break;

                    default:
                        viewProjectIframe.Src = "ProjectSummary?id=" + thisProject.id;
                        break;
                    }

                    #region 记录浏览历史
                    var history = new sys_windows_history()
                    {
                        title = $"项目:" + thisProject.name + " " + (thisAccount != null? thisAccount.name:""),
                        url   = Request.RawUrl,
                    };
                    new IndexBLL().BrowseHistory(history, LoginUserId);
                    #endregion
                }
                else
                {
                    Response.End();
                }
            }
            catch (Exception msg)
            {
                Response.End();
            }
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                var contract_id = Request.QueryString["id"];
                contract = new ctt_contract_dal().FindNoDeleteById(long.Parse(contract_id));
                var conAccount = new CompanyBLL().GetCompany(contract.account_id);

                thisBookMark = new IndexBLL().GetSingBook(Request.Url.LocalPath + "?id=" + contract_id, LoginUserId);
                #region 记录浏览历史
                var history = new sys_windows_history()
                {
                    title = "合同详情:" + contract.name + conAccount.name,
                    url   = Request.RawUrl,
                };
                new IndexBLL().BrowseHistory(history, LoginUserId);
                #endregion
                var type = Request.QueryString["type"];
                switch (type)
                {
                case "InternalCost":
                    viewContractIframe.Src = "../Common/SearchBodyFrame.aspx?cat=" + (int)EMT.DoneNOW.DTO.DicEnum.QUERY_CATE.CONTRACT_INTERNAL_COST + "&type=" + (int)EMT.DoneNOW.DTO.QueryType.InternalCost + "&id=" + contract.id;
                    ShowTitle.Text         = "内部成本-" + contract.name;
                    break;

                case "item":
                    viewContractIframe.Style["height"] = "300";
                    second.Style["height"]             = "600";
                    viewContractIframe.Src             = "../Common/SearchBodyFrame.aspx?cat=" + (int)EMT.DoneNOW.DTO.DicEnum.QUERY_CATE.RELATION_CONFIGITEM + "&type=" + (int)EMT.DoneNOW.DTO.QueryType.Relation_ConfigItem + "&id=" + contract_id;
                    second.Src     = "../Common/SearchBodyFrame.aspx?cat=" + (int)EMT.DoneNOW.DTO.DicEnum.QUERY_CATE.NORELATION_CONFIGITEM + "&type=" + (int)EMT.DoneNOW.DTO.QueryType.Norelation_ConfigItem + "&id=" + contract.account_id + "&contract_id=" + contract.id;
                    ShowTitle.Text = "配置项-" + contract.name;
                    break;

                case "charge":
                    viewContractIframe.Src = "../Common/SearchBodyFrame.aspx?isCheck=1&cat=" + (int)EMT.DoneNOW.DTO.DicEnum.QUERY_CATE.CONTRACT_CHARGE + "&type=" + (int)EMT.DoneNOW.DTO.QueryType.Contract_Charge + "&id=" + contract.id;
                    ShowTitle.Text         = "成本-" + contract.name;
                    break;

                case "defaultCost":
                    viewContractIframe.Src = "../Common/SearchBodyFrame.aspx?cat=" + (int)EMT.DoneNOW.DTO.DicEnum.QUERY_CATE.CONTRACT_DEFAULT_COST + "&type=" + (int)EMT.DoneNOW.DTO.QueryType.CONTRACT_DEFAULT_COST + "&id=" + contract.id;
                    ShowTitle.Text         = "默认成本-" + contract.name;
                    break;

                case "rate":
                    viewContractIframe.Src = "../Common/SearchBodyFrame.aspx?cat=" + (int)EMT.DoneNOW.DTO.DicEnum.QUERY_CATE.CONTRACT_TIME_RATE + "&type=" + (int)EMT.DoneNOW.DTO.QueryType.CONTRACT_RATE + "&id=" + contract.id;
                    ShowTitle.Text         = "预付时间系数-" + contract.name;
                    break;

                case "udf":
                    viewContractIframe.Src = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.CONTRACT_UDF + "&type=" + (int)QueryType.ContractUDF + "&id=" + contract.id;
                    ShowTitle.Text         = "自定义字段-" + contract.name;
                    break;

                case "block":
                    viewContractIframe.Src = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.CONTRACT_BLOCK + "&type=" + (int)QueryType.ContractBlock + "&id=" + contract.id;
                    ShowTitle.Text         = "预付费用-" + contract.name;
                    break;

                case "blockTime":
                    viewContractIframe.Src = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.CONTRACT_BLOCK_TIME + "&type=" + (int)QueryType.ContractBlockTime + "&id=" + contract.id;
                    ShowTitle.Text         = "预付时间-" + contract.name;
                    break;

                case "blockTicket":
                    viewContractIframe.Src = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.CONTRACT_BLOCK_TICKET + "&type=" + (int)QueryType.ContractBlockTicket + "&id=" + contract.id;
                    ShowTitle.Text         = "事件-" + contract.name;
                    break;

                case "roleRate":
                    viewContractIframe.Src = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.CONTRACT_RATE + "&type=" + (int)QueryType.ContractRate + "&id=" + contract.id;
                    ShowTitle.Text         = "费率-" + contract.name;
                    break;

                case "milestone":
                    viewContractIframe.Src = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.CONTRACT_MILESTONES + "&type=" + (int)QueryType.ContractMilestone + "&id=" + contract.id;
                    ShowTitle.Text         = "里程碑-" + contract.name;
                    break;

                case "service":
                    viewContractIframe.Src = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.CONTRACT_SERVICE + "&type=" + (int)QueryType.ContractService + "&id=" + contract.id;
                    second.Src             = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.CONTRACT_SERVICE_TRANS_HISTORY + "&type=" + (int)QueryType.ContractServiceTransHistory + "&id=" + contract.id;
                    ShowTitle.Text         = "服务-" + contract.name;
                    break;

                case "note":

                    ShowTitle.Text         = "合同备注-" + contract.name + (conAccount == null?"":$"({conAccount.name})");
                    viewContractIframe.Src = "ContractNoteShow?contract_id=" + contract.id;
                    break;

                case "rule":
                    viewContractIframe.Src = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.CONTRACT_NOTIFY_RULE + "&type=" + (int)QueryType.CONTRACT_NOTIFY_RULE + "&id=" + contract.id;
                    // 通知发送规则 - 合同名称(客户名称); contract_notify_rule
                    ShowTitle.Text = "通知发送规则-" + contract.name + (conAccount == null ? "" : $"({conAccount.name})");
                    break;

                case "project":
                    viewContractIframe.Src = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.CONTRACT_PROJECT + "&type=" + (int)QueryType.CONTRACT_PROJECT + "&con1175=" + contract.id;
                    ShowTitle.Text         = "合同项目-" + contract.name + (conAccount == null ? "" : $"({conAccount.name})");
                    break;

                case "exclusions":
                    ShowTitle.Text         = "例外因素-" + contract.name + (conAccount == null ? "" : $"({conAccount.name})");
                    viewContractIframe.Src = "ContractExclusions?contract_id=" + contract.id;
                    break;

                case "ticket":
                    ShowTitle.Text         = "合同工单";
                    viewContractIframe.Src = "../Common/SearchFrameSet.aspx?cat=" + (int)DicEnum.QUERY_CATE.MY_QUEUE_ACTIVE + "&type=" + (int)QueryType.MY_QUEUE_ACTIVE + "&group=215&param1=4876&param2=" + contract.id + "&param4=AddHidden";
                    break;

                default:
                    ShowTitle.Text         = "摘要-" + contract.name;
                    viewContractIframe.Src = "ContractSummary.aspx?id=" + contract.id;

                    break;
                }
            }
            catch (Exception)
            {
                Response.End();
            }
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                var id = Request.QueryString["id"];
                thisTask = new sdk_task_dal().FindNoDeleteById(long.Parse(id));
                if (thisTask != null && thisTask.project_id != null)
                {
                    thisBookMark = new IndexBLL().GetSingBook(Request.Url.LocalPath + "?id=" + id, LoginUserId);
                    tvbDto.Add(new DictionaryEntryDto("type", "类型", 0));
                    tvbDto.Add(new DictionaryEntryDto("time", "操作时间", 0));
                    tvbDto.Add(new DictionaryEntryDto("resouName", "员工", 0));
                    tvbDto.Add(new DictionaryEntryDto("workHours", "实际工作时间", 0));
                    tvbDto.Add(new DictionaryEntryDto("notTiltle", "说明/标题", 0));
                    tvbDto.Add(new DictionaryEntryDto("billabled", "是否计费", 0));
                    tvbDto.Add(new DictionaryEntryDto("billed", "已计费", 0));

                    expDto.Add(new DictionaryEntryDto("type_id", "类型", 0));
                    expDto.Add(new DictionaryEntryDto("add_date", "费用日期", 0));
                    expDto.Add(new DictionaryEntryDto("create_user_id", "创建人", 0));
                    expDto.Add(new DictionaryEntryDto("expense_cost_code_id", "费用类别", 0));
                    expDto.Add(new DictionaryEntryDto("amount", "总额", 0));
                    expDto.Add(new DictionaryEntryDto("is_billable", "计费的", 0));
                    expDto.Add(new DictionaryEntryDto("approve_and_post_user_id", "已计费", 0));


                    v_task = new v_task_all_dal().FindById(thisTask.id);
                    if (thisTask.type_id == (int)DicEnum.TASK_TYPE.PROJECT_ISSUE)
                    {
                        taskType = "问题";
                    }
                    else if (thisTask.type_id == (int)DicEnum.TASK_TYPE.PROJECT_TASK)
                    {
                        taskType = "任务";
                    }
                    else
                    {
                        Response.End();
                    }
                    #region 记录浏览历史
                    var account = new CompanyBLL().GetCompany(thisTask.account_id);
                    var history = new sys_windows_history()
                    {
                        title = $"查看{taskType}:" + (thisProject != null ? thisProject.name : "") + " " + thisTask.title + " " + (account != null ? account.name : ""),
                        url   = Request.RawUrl,
                    };
                    new IndexBLL().BrowseHistory(history, LoginUserId);
                    #endregion
                    thisProject = new pro_project_dal().FindNoDeleteById((long)thisTask.project_id);
                    if (thisProject != null)
                    {
                        thisAccount = new crm_account_dal().FindNoDeleteById(thisProject.account_id);
                        if (thisProject.contract_id != null)
                        {
                            thisContract = new ctt_contract_dal().FindNoDeleteById((long)thisProject.contract_id);
                        }
                    }
                    thisTaskResList = new sdk_task_resource_dal().GetTaskResByTaskId(thisTask.id);
                    var roleList = dic.FirstOrDefault(_ => _.Key == "role").Value as List <sys_role>;
                    var sysList  = dic.FirstOrDefault(_ => _.Key == "sys_resource").Value as List <DictionaryEntryDto>;

                    #region 工时备注附件
                    var tasEntryList = new sdk_work_entry_dal().GetByTaskId(thisTask.id);
                    if (tasEntryList != null && tasEntryList.Count > 0)
                    {
                        var newList = (from a in tasEntryList
                                       join b in roleList on a.role_id equals b.id
                                       join c in sysList on a.resource_id equals long.Parse(c.val)
                                       select new TaskViewDto {
                            id = a.id, type = "entry", time = Tools.Date.DateHelper.ConvertStringToDateTime((long)(a.end_time ?? a.start_time)), resouName = c.show + "(" + b.name + ")", workHours = a.hours_worked, notTiltle = a.summary_notes, billabled = a.is_billable == 1?"✓":"", billed = a.approve_and_post_date == null?"": "✓", startDate = Tools.Date.DateHelper.ConvertStringToDateTime((long)a.start_time), workTypeId = a.cost_code_id, contractId = a.contract_id, showOnInv = a.show_on_invoice == 1, serviceId = a.service_id
                        }).ToList();

                        tvdList.AddRange(newList);
                    }
                    var conAttDal      = new com_attachment_dal();
                    var allTaskAttList = new List <com_attachment>();
                    var taskNoteList   = new com_activity_dal().GetActiList($" and (task_id ={thisTask.id} or object_id={thisTask.id} )");
                    if (taskNoteList != null && taskNoteList.Count > 0)
                    {
                        var newList = (from a in taskNoteList
                                       join c in sysList on a.resource_id equals long.Parse(c.val) into temp
                                       from tt in temp.DefaultIfEmpty()
                                       select new TaskViewDto {
                            id = a.id, type = "note", time = Tools.Date.DateHelper.ConvertStringToDateTime(a.create_time), resouName = tt == null ? "" : tt.show, notTiltle = a.name, noteDescr = a.description
                        }).ToList();
                        tvdList.AddRange(newList);

                        foreach (var thisTaskNote in taskNoteList)
                        {
                            var thisNoteAttList = conAttDal.GetAttListByOid(thisTaskNote.id);
                            if (thisNoteAttList != null && thisNoteAttList.Count > 0)
                            {
                                allTaskAttList.AddRange(thisNoteAttList);
                            }
                        }
                    }
                    var taskAttList = conAttDal.GetAttListByOid(thisTask.id);
                    if (taskAttList != null && taskAttList.Count > 0)
                    {
                        allTaskAttList.AddRange(taskAttList);
                    }
                    if (allTaskAttList.Count > 0)
                    {
                        var newList = (from a in allTaskAttList
                                       join c in sysList on a.create_user_id equals long.Parse(c.val) into temp
                                       from tt in temp.DefaultIfEmpty()
                                       select new TaskViewDto {
                            id = a.id, type = "atach", time = Tools.Date.DateHelper.ConvertStringToDateTime(a.create_time), resouName = tt == null?"":tt.show, notTiltle = a.title, fileType = a.type_id
                        }).ToList();
                        tvdList.AddRange(newList);
                    }
                    if (tvdList != null && tvdList.Count > 0)
                    {
                        tvbOrder = Request.QueryString["tvbOrder"];
                        tvdList  = tvdList.OrderBy(_ => _.time).ToList();
                        if (!string.IsNullOrEmpty(tvbOrder))
                        {
                            var tvbOrderArr = tvbOrder.Split(new char[] { '_' }, StringSplitOptions.RemoveEmptyEntries);
                            var orderFile   = tvbDto.FirstOrDefault(_ => _.val == tvbOrderArr[0]);
                            if (tvbOrderArr[1] == "desc")
                            {
                                //tvdList = (from a in tvdList
                                //           orderby tvbOrderArr[0]  descending
                                //           select a).ToList();
                                tvdList.Sort(delegate(TaskViewDto t1, TaskViewDto t2) {
                                    return(GetObjectPropertyValue(t2, tvbOrderArr[0]).CompareTo(GetObjectPropertyValue(t1, tvbOrderArr[0])));
                                });
                                orderFile.select = orderFile != null ? 2 : orderFile.select;
                            }
                            else
                            {
                                //tvdList = (from a in tvdList
                                //           orderby tvbOrderArr[0]
                                //           select a).ToList();
                                tvdList.Sort(delegate(TaskViewDto t1, TaskViewDto t2) {
                                    return(GetObjectPropertyValue(t1, tvbOrderArr[0]).CompareTo(GetObjectPropertyValue(t2, tvbOrderArr[0])));
                                });
                                orderFile.select = orderFile != null ? 1 : orderFile.select;
                            }
                        }
                    }
                    #endregion

                    #region 费用
                    taskExpList = new sdk_expense_dal().GetExpByTaskId(thisTask.id);
                    if (taskExpList != null && taskExpList.Count > 0)
                    {
                        taskExpList = taskExpList.OrderByDescending(_ => _.add_date).ToList();
                        expOrder    = Request.QueryString["expOrder"];
                        if (!string.IsNullOrEmpty(expOrder))
                        {
                            var expOrderArr = expOrder.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                            var orderFile   = expDto.FirstOrDefault(_ => _.val == expOrderArr[0]);
                            if (expOrderArr[1] == "desc")
                            {
                                //taskExpList = (from a in taskExpList
                                //           orderby expOrderArr[0] descending
                                //           select a).ToList();
                                taskExpList.Sort(delegate(sdk_expense t1, sdk_expense t2) {
                                    return(GetObjectPropertyValue(t2, expOrderArr[0]).CompareTo(GetObjectPropertyValue(t1, expOrderArr[0])));
                                });
                                orderFile.select = orderFile != null ? 2 : orderFile.select;
                            }
                            else
                            {
                                //taskExpList = (from a in taskExpList
                                //           orderby expOrderArr[0]
                                //           select a).ToList();
                                taskExpList.Sort(delegate(sdk_expense t1, sdk_expense t2) {
                                    return(GetObjectPropertyValue(t1, expOrderArr[0]).CompareTo(GetObjectPropertyValue(t2, expOrderArr[0])));
                                });

                                orderFile.select = orderFile != null ? 1 : orderFile.select;
                            }
                        }
                    }
                    #endregion
                }
                else
                {
                    Response.End();
                }
            }
            catch (Exception msg)
            {
                Response.End();
            }
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                var id = Request.QueryString["id"];
                type = Request.QueryString["type"];
                if (id != null)
                {
                    thisBookMark = new IndexBLL().GetSingBook(Request.Url.LocalPath + "?id=" + id, LoginUserId);
                    var src = Request.QueryString["src"];
                    if (!string.IsNullOrEmpty(src))
                    {
                        crm_account = companyBll.GetCompanyByOtherId(Convert.ToInt64(id), src);
                    }
                    else
                    {
                        crm_account = companyBll.GetCompanyByOtherId(Convert.ToInt64(id));
                    }
                    if (crm_account != null)
                    {
                        if (AuthBLL.GetUserCompanyAuth(LoginUserId, LoginUser.security_Level_id, crm_account.id).CanView == false)     // 权限验证
                        {
                            Response.End();
                            return;
                        }
                        #region 记录浏览历史
                        var history = new sys_windows_history()
                        {
                            title = "客户:" + crm_account.name,
                            url   = Request.Url.LocalPath + "?id=" + id,
                        };
                        new IndexBLL().BrowseHistory(history, LoginUserId);
                        #endregion
                        dic = new CompanyBLL().GetField();    // 获取字典
                        if (string.IsNullOrEmpty(type))
                        {
                            type = "activity";
                        }
                        if (type == "activity" || type == "note" || type == "todo")
                        {
                            isHide.Value = "show";
                            //  Response.Write("<script>document.getElementById('showCompanyGeneral').style.display='none';</script>");
                        }
                        switch (type)    // 根据传过来的不同的类型,为页面中的iframe控件选择不同的src
                        {
                        case "activity":
                            var typeList = new ActivityBLL().GetCRMActionType();
                            noteType.DataSource     = typeList;
                            noteType.DataTextField  = "name";
                            noteType.DataValueField = "id";
                            noteType.DataBind();
                            actType = "活动";
                            break;

                        case "todo":                // 待办
                            iframeSrc = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.TODOS + "&type=" + (int)QueryType.Todos + "&group=112&con658=" + crm_account.id + "&param1=accountId&param2=" + crm_account.id;
                            actType   = "待办";
                            break;

                        case "note":                // 备注
                            iframeSrc = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.CRM_NOTE_SEARCH + "&type=" + (int)QueryType.CRMNote + "&group=110&con645=" + crm_account.id + "&param1=accountId&param2=" + crm_account.id;
                            actType   = "备注";
                            break;

                        case "opportunity":
                            iframeSrc = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.OPPORTUNITY_COMPANY_VIEW + "&type=" + (int)QueryType.OpportunityCompanyView + "&id=" + id;
                            actType   = "商机";
                            break;    //

                        case "contact":
                            iframeSrc = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.CONTACT_COMPANY_VIEW + "&type=" + (int)QueryType.ContactCompanyView + "&id=" + id; // 联系人
                            actType   = "联系人";
                            break;                                                                                                                                                         //

                        case "Subsidiaries":
                            iframeSrc = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.SUBCOMPANY_COMPANY_VIEW + "&type=" + (int)QueryType.SubcompanyCompanyView + "&id=" + id; // 子公司
                            actType   = "子客户";
                            break;                                                                                                                                                               //Subsidiaries

                        case "saleOrder":                                                                                                                                                        // 销售订单
                            iframeSrc = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.SALEORDER + "&type=" + (int)QueryType.SaleOrder + "&group=42&con385=" + id;
                            actType   = "销售订单";
                            break;

                        case "contract":            // 合同
                            iframeSrc = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.COMPANY_VIEW_CONTRACT + "&type=" + (int)QueryType.CompanyViewContract + "&con933=" + id;
                            actType   = "合同";
                            break;

                        case "confirgItem":
                            iframeSrc = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.INSTALLEDPRODUCT + "&type=" + (int)QueryType.InstalledProductView + "&con358=" + id;
                            actType   = "配置项";
                            break;

                        case "invoice":
                            iframeSrc = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.COMPANY_VIEW_INVOICE + "&type=" + (int)QueryType.CompanyViewInvoice + "&con934=" + id;
                            actType   = "发票";
                            break;

                        case "attachment":
                            iframeSrc = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.COMPANY_VIEW_ATTACHMENT + "&type=" + (int)QueryType.CompanyViewAttachment + "&con674=" + id;
                            actType   = "附件";
                            break;

                        case "project":
                            iframeSrc = "../Common/SearchBodyFrame.aspx?cat=" + (int)DicEnum.QUERY_CATE.PROJECT_SEARCH + "&type=" + (int)QueryType.PROJECT_SEARCH + "&con630=" + crm_account.id;
                            actType   = "项目";
                            break;

                        case "finance":
                            actType = "财务";
                            break;

                        case "ticket":
                            actType   = "工单";
                            iframeSrc = "../Common/SearchBodyFrame.aspx?cat=" + (int)EMT.DoneNOW.DTO.DicEnum.QUERY_CATE.MY_QUEUE_ACTIVE + "&type=" + (int)EMT.DoneNOW.DTO.QueryType.MY_QUEUE_ACTIVE + "&group=215&con2627=" + crm_account.id + "&param1=ShowPara";
                            break;

                        case "contactGroup":
                            actType   = "联系人组";
                            iframeSrc = "../Common/SearchBodyFrame.aspx?cat=" + (int)EMT.DoneNOW.DTO.DicEnum.QUERY_CATE.ACCOUNT_CONTACT_GROUP_SEARCH + "&type=" + (int)EMT.DoneNOW.DTO.QueryType.ACCOUNT_CONTACT_GROUP_SEARCH + "&con3961=" + crm_account.id.ToString();
                            break;

                        default:
                            iframeSrc = "";      // 默认  project_search
                            actType   = "活动";

                            break;
                        }
                        //viewCompany_iframe.Src = "";  //
                    }
                    else
                    {
                        Response.Write("<script>alert('未获取到客户信息');window.close();</script>");
                    }
                }
                else
                {
                    Response.Write("<script>alert('未获取到客户信息');window.close();</script>");
                }
            }
            catch (Exception msg)
            {
                Response.Write($"<script>alert('{msg.Message}');window.close();</script>");
            }
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                thisBookMark = new IndexBLL().GetSingBook(Request.RawUrl, LoginUserId);
                tmplList     = new FormTemplateBLL().GetTmplByType((int)DicEnum.FORM_TMPL_TYPE.QUOTE, LoginUserId);
                var id = Request.QueryString["id"];
                dic = new QuoteBLL().GetField();
                #region  拉框配置数据源
                tax_region_id.DataValueField = "val";
                tax_region_id.DataTextField  = "show";
                tax_region_id.DataSource     = dic.FirstOrDefault(_ => _.Key == "taxRegion").Value;
                tax_region_id.DataBind();
                tax_region_id.Items.Insert(0, new ListItem()
                {
                    Value = "0", Text = "   ", Selected = true
                });

                payment_term_id.DataValueField = "val";
                payment_term_id.DataTextField  = "show";
                payment_term_id.DataSource     = dic.FirstOrDefault(_ => _.Key == "payment_term").Value;
                payment_term_id.DataBind();
                payment_term_id.Items.Insert(0, new ListItem()
                {
                    Value = "0", Text = "   ", Selected = true
                });


                payment_type_id.DataValueField = "val";
                payment_type_id.DataTextField  = "show";
                payment_type_id.DataSource     = dic.FirstOrDefault(_ => _.Key == "payment_type").Value;
                payment_type_id.DataBind();
                payment_type_id.Items.Insert(0, new ListItem()
                {
                    Value = "0", Text = "   ", Selected = true
                });

                shipping_type_id.DataValueField = "val";
                shipping_type_id.DataTextField  = "show";
                shipping_type_id.DataSource     = dic.FirstOrDefault(_ => _.Key == "payment_ship_type").Value;
                shipping_type_id.DataBind();
                shipping_type_id.Items.Insert(0, new ListItem()
                {
                    Value = "0", Text = "   ", Selected = true
                });

                quote_tmpl_id.DataValueField = "id";
                quote_tmpl_id.DataTextField  = "name";
                quote_tmpl_id.DataSource     = dic.FirstOrDefault(_ => _.Key == "quote_tmpl").Value;
                quote_tmpl_id.DataBind();
                quote_tmpl_id.Items.Insert(0, new ListItem()
                {
                    Value = "0", Text = "   ", Selected = true
                });
                var prolist = new pro_project_dal().GetProjectList();
                // project_id
                //project_id.DataValueField = "id";
                //project_id.DataTextField = "name";
                //project_id.DataSource = prolist;
                //project_id.DataBind();
                //project_id.Items.Insert(0, new ListItem() { Value = "0", Text = "   ", Selected = true });
                #endregion

                if (!string.IsNullOrEmpty(id))
                {
                    if (AuthBLL.GetUserQuoteAuth(LoginUserId, LoginUser.security_Level_id, Convert.ToInt64(id)).CanEdit == false)
                    {
                        Response.End();
                        return;
                    }
                    quote = new crm_quote_dal().GetQuote(Convert.ToInt64(id));
                    if (quote != null)
                    {
                        if (string.IsNullOrEmpty(Request.QueryString["copy"]))
                        {
                            isAdd = false;
                        }
                    }
                }
                else
                {
                    var opportunity_id = Request.QueryString["quote_opportunity_id"];
                    if (!string.IsNullOrEmpty(opportunity_id))
                    {
                        opportunity = new crm_opportunity_dal().GetOpportunityById(long.Parse(opportunity_id));
                        account     = new CompanyBLL().GetCompany(opportunity.account_id);
                    }
                }
                if (!IsPostBack)
                {
                    if (!isAdd)
                    {
                        account = new CompanyBLL().GetCompany(quote.account_id);
                        if (account != null)
                        {
                            tax_region_id.SelectedValue = account.tax_region_id != null?account.tax_region_id.ToString() : "0";

                            payment_term_id.SelectedValue = quote.payment_term_id != null?quote.payment_term_id.ToString() : "0";

                            payment_type_id.SelectedValue = quote.payment_type_id != null?quote.payment_type_id.ToString() : "0";   //shipping_type_id

                            shipping_type_id.SelectedValue = quote.shipping_type_id != null?quote.shipping_type_id.ToString() : "0";

                            quote_tmpl_id.SelectedValue = quote.quote_tmpl_id != null?quote.quote_tmpl_id.ToString() : "0";

                            //project_id.SelectedValue = quote.project_id!=null ?  quote.project_id.ToString() : "0";
                            BillLocation.Checked = quote.bill_to_location_id == quote.sold_to_location_id;
                            ShipLocation.Checked = quote.ship_to_location_id == quote.sold_to_location_id;
                        }
                        #region 记录浏览历史
                        var history = new sys_windows_history()
                        {
                            title = $"编辑报价:" + quote.name + " " + (account != null ? account.name : ""),
                            url   = Request.RawUrl,
                        };
                        new IndexBLL().BrowseHistory(history, LoginUserId);
                        #endregion
                    }
                }
            }
            catch (Exception)
            {
                Response.End();
            }
        }
Example #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            thisBookMark   = new IndexBLL().GetSingBook(Request.RawUrl, LoginUserId);
            actionTypeList = bll.GetCRMActionType();
            resourceList   = new UserResourceBLL().GetResourceList();

            if (!IsPostBack)
            {
                long noteid;
                if (!string.IsNullOrEmpty(Request.QueryString["id"]) && long.TryParse(Request.QueryString["id"], out noteid))
                {
                    if (AuthBLL.GetUserNoteAuth(LoginUserId, LoginUser.security_Level_id, noteid).CanEdit == false)
                    {
                        Response.Write("<script>alert('您不能编辑此备注');</script>");
                        Response.End();
                        return;
                    }

                    note            = bll.GetActivity(noteid);
                    contactList     = new ContactBLL().GetContactByCompany((long)note.account_id);
                    opportunityList = new OpportunityBLL().GetOpportunityByCompany((long)note.account_id);
                    var accountName = "";
                    if (note.account_id != null)
                    {
                        var account = new CompanyBLL().GetCompany((long)note.account_id);
                        accountName = account == null ? "" : account.name;
                    }
                    var history = new sys_windows_history()
                    {
                        title = "备注:" + note.description + ":" + accountName,
                        url   = Request.RawUrl,
                    };
                    new IndexBLL().BrowseHistory(history, LoginUserId);
                }

                if (long.TryParse(Request.QueryString["accountId"], out accountId))
                {
                    objType = (int)DicEnum.OBJECT_TYPE.CUSTOMER;
                    objId   = accountId;
                }
                if (long.TryParse(Request.QueryString["contactId"], out contactId))
                {
                    accountId = new ContactBLL().GetContact(contactId).account_id;
                    objType   = (int)DicEnum.OBJECT_TYPE.CONTACT;
                    objId     = contactId;
                }
                if (long.TryParse(Request.QueryString["opportunityId"], out opportunityId))
                {
                    objType = (int)DicEnum.OBJECT_TYPE.OPPORTUNITY;
                    objId   = opportunityId;
                    var opp = new OpportunityBLL().GetOpportunity(opportunityId).general;
                    accountId = opp.account_id;
                    if (opp.contact_id != null)
                    {
                        contactId = (long)opp.contact_id;
                    }
                }
                if (long.TryParse(Request.QueryString["saleorderId"], out saleOrderId))
                {
                    objType = (int)DicEnum.OBJECT_TYPE.SALEORDER;
                    objId   = saleOrderId;
                    var saleOrder = new SaleOrderBLL().GetSaleOrder(saleOrderId);
                    var opp       = new OpportunityBLL().GetOpportunity(saleOrder.opportunity_id).general;
                    opportunityId = opp.id;
                    accountId     = opp.account_id;
                    if (opp.contact_id != null)
                    {
                        contactId = (long)opp.contact_id;
                    }
                }
            }
            else
            {
                com_activity activity = AssembleModel <com_activity>();
                if (activity.contact_id == 0)
                {
                    activity.contact_id = null;
                }
                activity.start_date = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Parse(Request.Form["start_date2"]));
                activity.end_date   = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Parse(Request.Form["end_date2"]));

                com_activity todo = null;
                if (!string.IsNullOrEmpty(Request.Form["action_type_id1"]))
                {
                    todo = new com_activity();
                    todo.action_type_id = int.Parse(Request.Form["action_type_id1"]);
                    todo.start_date     = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Parse(Request.Form["start_date1"]));
                    todo.end_date       = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Parse(Request.Form["end_date1"]));
                    todo.description    = Request.Form["description1"];
                    if (!string.IsNullOrEmpty(Request.Form["resource_id1"]))
                    {
                        todo.resource_id = long.Parse(Request.Form["resource_id1"]);
                    }
                }

                if (string.IsNullOrEmpty(Request.Form["id"]))
                {
                    bll.AddCRMNote(activity, todo, GetLoginUserId());
                }
                else
                {
                    bll.EditCRMNote(activity, todo, GetLoginUserId());
                }

                if (Request.Form["action"] != null && Request.Form["action"].Equals("SaveNew"))
                {
                    Response.Write("<script>alert('保存备注成功');window.location.href='Notes.aspx';self.opener.location.reload();</script>");
                }
                else
                {
                    Response.Write("<script>alert('保存备注成功');window.close();self.opener.location.reload();</script>");
                }
            }
        }
Example #7
0
        protected long quote_id;             // 报价ID
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                isSaleOrder = !string.IsNullOrEmpty(Request.QueryString["isSaleOrder"]);
                var sId = Request.QueryString["sale_order_id"];
                if (!string.IsNullOrEmpty(sId))
                {
                    saleOrderId = long.Parse(sId);
                }


                type = Request.QueryString["type_id"];             // 报价项类型
                var quote_id = Request.QueryString["quote_id"];    // 报价ID 需要根据报价ID 添加报价项
                if (!string.IsNullOrEmpty(quote_id))
                {
                    this.quote_id = long.Parse(quote_id);
                }
                var quote_item_id = Request.QueryString["id"];
                thisQuoteId.Value = quote_id;
                dic = new QuoteItemBLL().GetField();
                if (!string.IsNullOrEmpty(quote_item_id))
                {
                    quote_item = new crm_quote_item_dal().GetQuoteItem(long.Parse(quote_item_id));
                    if (quote_item != null)
                    {
                        if (quote_item.quote_id != null)
                        {
                            this.quote_id = (long)quote_item.quote_id;
                        }
                        isAdd = false;
                        if (!IsPostBack)
                        {
                            _optional.Checked = quote_item.optional == 1;
                        }
                        ItemTypeId.Value = quote_item.type_id.ToString();

                        switch (quote_item.type_id)   // todo 不同类型的报价项
                        {
                        case (int)QUOTE_ITEM_TYPE.WORKING_HOURS:
                            type = "工时";
                            break;

                        case (int)QUOTE_ITEM_TYPE.COST:
                            type = "费用";
                            break;

                        case (int)QUOTE_ITEM_TYPE.DEGRESSION:
                            type = "成本";
                            break;

                        case (int)QUOTE_ITEM_TYPE.DISCOUNT:
                            type = "折扣";
                            break;

                        case (int)QUOTE_ITEM_TYPE.PRODUCT:
                            type = "产品";
                            break;

                        case (int)QUOTE_ITEM_TYPE.DISTRIBUTION_EXPENSES:
                            type = "配送费用";
                            break;

                        case (int)QUOTE_ITEM_TYPE.SERVICE:
                            type = "服务";
                            break;

                        case (int)QUOTE_ITEM_TYPE.START_COST:
                            type = "初始费用";
                            break;

                        default:
                            break;
                        }

                        #region 记录浏览历史
                        var accountName = "";
                        if (quote_item.quote_id != null)
                        {
                            var quote = new crm_quote_dal().FindNoDeleteById((long)quote_item.quote_id);
                            if (quote != null)
                            {
                                var account = new CompanyBLL().GetCompany(quote.account_id);
                                accountName = account != null ? account.name : "";
                            }
                        }
                        var history = new sys_windows_history()
                        {
                            title = $"编辑报价项:" + quote_item.name + " " + accountName,
                            url   = Request.RawUrl,
                        };
                        new IndexBLL().BrowseHistory(history, LoginUserId);
                        #endregion
                    }
                }
                else
                {
                    ItemTypeId.Value = type;
                    switch (Convert.ToInt64(type))   // todo 不同类型的报价项
                    {
                    case (int)QUOTE_ITEM_TYPE.WORKING_HOURS:
                        type = "工时";
                        break;

                    case (int)QUOTE_ITEM_TYPE.COST:
                        type = "费用";
                        break;

                    case (int)QUOTE_ITEM_TYPE.DEGRESSION:
                        type = "成本";
                        break;

                    case (int)QUOTE_ITEM_TYPE.DISCOUNT:
                        type = "折扣";
                        break;

                    case (int)QUOTE_ITEM_TYPE.PRODUCT:
                        type = "产品";
                        break;

                    case (int)QUOTE_ITEM_TYPE.DISTRIBUTION_EXPENSES:
                        type = "配送费用";
                        break;

                    case (int)QUOTE_ITEM_TYPE.SERVICE:
                        type = "服务";
                        break;

                    case (int)QUOTE_ITEM_TYPE.START_COST:
                        type = "初始费用";
                        break;

                    default:
                        Response.End();      // 未传类型,暂不创建
                        break;
                    }
                }
                //if (string.IsNullOrEmpty(quote_id))
                //{
                //    //Response.End();
                //}


                // var type_id = Convert.ToInt64(type);


                #region  拉框配置数据源
                // 税收种类
                tax_cate_id.DataTextField  = "show";
                tax_cate_id.DataValueField = "val";
                tax_cate_id.DataSource     = dic.FirstOrDefault(_ => _.Key == "quote_item_tax_cate").Value;
                tax_cate_id.DataBind();
                tax_cate_id.Items.Insert(0, new ListItem()
                {
                    Value = "0", Text = "   ", Selected = true
                });
                // 期间类型
                period_type_id.DataTextField  = "show";
                period_type_id.DataValueField = "val";
                period_type_id.DataSource     = dic.FirstOrDefault(_ => _.Key == "quote_item_period_type").Value;
                period_type_id.DataBind();
                period_type_id.Items.Insert(0, new ListItem()
                {
                    Value = "0", Text = "   ", Selected = true
                });
                period_type_id.SelectedValue = ((int)QUOTE_ITEM_PERIOD_TYPE.ONE_TIME).ToString();
                period_type_id.Enabled       = true;
                #endregion


                if (!isAdd)
                {
                    if (quote_item.tax_cate_id != null)
                    {
                        tax_cate_id.SelectedValue = quote_item.tax_cate_id.ToString();
                    }
                    if (quote_item.period_type_id != null)
                    {
                        period_type_id.SelectedValue = quote_item.period_type_id.ToString();
                    }
                    if (quote_item.type_id == (int)DTO.DicEnum.QUOTE_ITEM_TYPE.PRODUCT)
                    {
                        thisReserList = new ivt_reserve_dal().GetListByItemId(quote_item.id);
                    }
                }
            }
            catch (Exception)
            {
                Response.End();
            }
        }
Example #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                thisBookMark     = new IndexBLL().GetSingBook(Request.RawUrl, LoginUserId);
                iProduct_udfList = new UserDefinedFieldsBLL().GetUdf(DicEnum.UDF_CATE.CONFIGURATION_ITEMS);
                var contract_id = Request.QueryString["contract_id"];
                if (!string.IsNullOrEmpty(contract_id))
                {
                    contract = new ctt_contract_dal().FindNoDeleteById(long.Parse(contract_id));
                    if (contract != null)
                    {
                        account = new CompanyBLL().GetCompany(contract.account_id);
                    }
                }
                var contactId = Request.QueryString["contact_id"];
                if (!string.IsNullOrEmpty(contactId))
                {
                    contact = new ContactBLL().GetContact(long.Parse(contactId));
                    if (contact != null)
                    {
                        account = new CompanyBLL().GetCompany(contact.account_id);
                    }
                }


                var id = Request.QueryString["id"];
                if (!string.IsNullOrEmpty(id))
                {
                    iProduct = new crm_installed_product_dal().GetInstalledProduct(long.Parse(id));
                    if (iProduct != null)
                    {
                        account = new CompanyBLL().GetCompany((long)iProduct.account_id);
                        product = new ivt_product_dal().FindNoDeleteById(iProduct.product_id);
                    }
                }
                var account_id = Request.QueryString["account_id"];
                if (!string.IsNullOrEmpty(account_id))
                {
                    account = new CompanyBLL().GetCompany(long.Parse(account_id));
                }
                //var contactList = new crm_contact_dal().GetContactByAccountId(account.id);
                //var serviceList = new ivt_service_dal().GetServiceList($" and vendor_id = {account.id}");
                #region 配置下拉框数据源

                var udfGroup = new d_general_dal().GetGeneralByTableId((int)GeneralTableEnum.UDF_FILED_GROUP);
                List <d_general> cateList = null;
                if (udfGroup != null && udfGroup.Count > 0)
                {
                    cateList = udfGroup.Where(_ => _.parent_id == (int)UDF_CATE.CONFIGURATION_ITEMS).ToList();
                }
                installed_product_cate_id.DataTextField  = "name";
                installed_product_cate_id.DataValueField = "id";
                installed_product_cate_id.DataSource     = cateList;
                installed_product_cate_id.DataBind();
                installed_product_cate_id.Items.Insert(0, new ListItem()
                {
                    Value = "", Text = "   ", Selected = true
                });

                //contact_id.DataTextField = "name";
                //contact_id.DataValueField = "id";
                //contact_id.DataSource = contactList;
                //contact_id.DataBind();
                //contact_id.Items.Insert(0, new ListItem() { Value = "", Text = "   ", Selected = true });

                //
                //service.DataTextField = "name";
                //service.DataValueField = "id";
                //service.DataSource = serviceList;
                //service.DataBind();
                //service.Items.Insert(0, new ListItem() { Value = "0", Text = "   ", Selected = true });
                //service.Enabled = false; // 所选合同如果是服务类型的,则此下拉框可选。可选内容为合同项
                #endregion
                if (iProduct != null)
                {
                    //account_id = iProduct.account_id.ToString();
                    iProduct_udfValueList = new UserDefinedFieldsBLL().GetUdfValue(DicEnum.UDF_CATE.CONFIGURATION_ITEMS, iProduct.id, iProduct_udfList);
                    var isCopy = Request.QueryString["isCopy"];

                    product = new EMT.DoneNOW.BLL.ProductBLL().GetProduct(iProduct.product_id);

                    isAdd = false;
                    if (!string.IsNullOrEmpty(isCopy) && isCopy == "1")
                    {
                        isAdd = true;
                    }
                    if (!isAdd)
                    {
                        #region 记录浏览历史
                        var history = new sys_windows_history()
                        {
                            title = "配置项:" + (product == null ? "" : product.name) + account.name,
                            url   = Request.RawUrl,
                        };
                        new IndexBLL().BrowseHistory(history, LoginUserId);
                        #endregion
                    }


                    if (iProduct.contract_id != null)
                    {
                        contract = new ctt_contract_dal().FindNoDeleteById((long)iProduct.contract_id);
                    }
                    if (iProduct.cate_id != null)
                    {
                        installed_product_cate_id.SelectedValue = iProduct.cate_id.ToString();
                    }


                    if (iProduct.contact_id != null)
                    {
                        contact_id.SelectedValue = iProduct.contact_id.ToString();
                    }
                    viewSubscription_iframe.Src = "../Common/SearchBodyFrame.aspx?cat=" + (int)EMT.DoneNOW.DTO.DicEnum.QUERY_CATE.CONFIGSUBSCRIPTION + "&type=" + (int)EMT.DoneNOW.DTO.QueryType.CONFIGSUBSCRIPTION + "&id=" + iProduct.id;

                    view_ticket_iframe.Src = "../Common/SearchBodyFrame.aspx?cat=" + (int)EMT.DoneNOW.DTO.DicEnum.QUERY_CATE.MY_QUEUE_ACTIVE + "&type=" + (int)EMT.DoneNOW.DTO.QueryType.MY_QUEUE_ACTIVE + "&group=215&con3962=" + iProduct.id + "&param1=ShowPara";
                    // todo 订阅的通用查询
                    // "../Common/SearchBodyFrame.aspx?cat=" + (int)EMT.DoneNOW.DTO.DicEnum.QUERY_CATE.CONTACT_COMPANY_VIEW + "&type=" + (int)EMT.DoneNOW.DTO.QueryType.ContactCompanyView + "&id=" + id;
                    thisNoteAtt = new com_attachment_dal().GetAttListByOid(iProduct.id);
                    if (!isAdd)
                    {
                        if (iProduct.parent_id != null)
                        {
                            parentInsPro = new crm_installed_product_dal().GetInstalledProduct((long)iProduct.parent_id);
                        }
                        childInsProList = new crm_installed_product_dal().GetChildInsPro(iProduct.id);
                    }
                }
                if (!IsPostBack)
                {
                    is_active_.Checked = true;
                    if (iProduct != null)
                    {
                        is_active_.Checked = iProduct.is_active == 1;
                    }
                }
            }
            catch (Exception msg)
            {
                Response.Write("<script>alert('" + msg.Message + "');window.close();</script>");
            }
        }
Example #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            thisBookMark = new IndexBLL().GetSingBook(Request.RawUrl, LoginUserId);
            var id     = Request.QueryString["id"];
            var isCopy = Request.QueryString["copy"];

            if (!string.IsNullOrEmpty(id))
            {
                thisCall = new sdk_service_call_dal().FindNoDeleteById(long.Parse(id));
            }
            if (thisCall != null)
            {
                if (!string.IsNullOrEmpty(isCopy))
                {
                    isCop = true;
                }
                else
                {
                    isAdd = false;
                }
                thisAccount = new CompanyBLL().GetCompany(thisCall.account_id);
                taskSerList = new sdk_service_call_task_dal().GetTaskCall(thisCall.id);
                if (taskSerList != null && taskSerList.Count > 0)
                {
                    taskSerList.ForEach(_ => {
                        ticketIds += _.task_id.ToString() + ',';
                    });
                    if (!string.IsNullOrEmpty(ticketIds))
                    {
                        ticketIds = ticketIds.Substring(0, ticketIds.Length - 1);
                    }
                }
                if (!isAdd)
                {
                    #region 记录浏览历史
                    var history = new sys_windows_history()
                    {
                        title = "服务预定:" + Tools.Date.DateHelper.ConvertStringToDateTime(thisCall.start_time).ToString("yyyy-MM-dd HH:mm") + "~" + Tools.Date.DateHelper.ConvertStringToDateTime(thisCall.end_time).ToString("yyyy-MM-dd HH:mm") + thisAccount.name,
                        url   = Request.RawUrl,
                    };
                    new IndexBLL().BrowseHistory(history, LoginUserId);
                    #endregion
                }
            }

            if (!IsPostBack)
            {
            }
            else
            {
                var param = GetParam();
                if (param != null)
                {
                    bool result = false;
                    if (isAdd)
                    {
                        result = new TicketBLL().AddServiceCall(param, LoginUserId);
                    }
                    else
                    {
                        result = new TicketBLL().EditServiceCall(param, LoginUserId);
                    }
                    ClientScript.RegisterStartupScript(this.GetType(), "刷新父页面", $"<script>self.opener.location.reload();</script>");
                    ClientScript.RegisterStartupScript(this.GetType(), "提示信息", $"<script>alert('保存{(result ? "成功" : "失败")}!');</script>");
                    var saveType = Request.Form["SaveType"];
                    if (saveType == "save_close")
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "关闭窗口", $"<script>window.close();</script>");
                    }
                    else if (saveType == "save_new")
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "跳转", $"<script>location.href='ServiceCall';</script>");
                    }
                    else if (saveType == "work_book")  // todo 跳转到生成工作说明书界面
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "关闭窗口", $"<script>window.close();</script>");
                    }
                    else
                    {
                        ClientScript.RegisterStartupScript(this.GetType(), "跳转到编辑页面", $"<script>location.href='ServiceCall?id={param.call.id.ToString()}';</script>");
                    }
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "提示", $"<script>alert('必填项丢失,请重新填写!');</script>");
                }
            }
        }
Example #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            thisBookMark = new IndexBLL().GetSingBook(Request.RawUrl, LoginUserId);
            if (!IsPostBack)
            {
                Bind();  // 绑定页面下拉数据
            }
            if (noteTypeList != null && noteTypeList.Count > 0)
            {
                noteTypeList = noteTypeList.Where(_ => _.ext2 == ((int)DicEnum.TASK_TYPE.RECURRING_TICKET_MASTER).ToString()).ToList();
            }
            if (publishList != null && publishList.Count > 0)
            {
                publishList = publishList.Where(_ => _.ext2 == ((int)DicEnum.ACTIVITY_CATE.TICKET_NOTE).ToString()).ToList();
            }
            var ticketId = Request.QueryString["id"];

            if (!string.IsNullOrEmpty(ticketId))
            {
                thisTicket = new sdk_task_dal().FindNoDeleteById(long.Parse(ticketId));
            }
            if (thisTicket != null)
            {
                isAdd    = false;
                objectId = thisTicket.id;
                #region 获取工单基本信息
                thisAccount = new CompanyBLL().GetCompany(thisTicket.account_id);
                if (thisTicket.contact_id != null)
                {
                    thisContact = new crm_contact_dal().FindNoDeleteById((long)thisTicket.contact_id);
                }
                if (thisTicket.owner_resource_id != null && thisTicket.role_id != null)
                {
                    priRes   = 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 (thisTicket.contract_id != null)
                {
                    thisContract = new ctt_contract_dal().FindNoDeleteById((long)thisTicket.contract_id);
                }
                status_id.SelectedValue = thisTicket.status_id.ToString();
                if (thisTicket.priority_type_id != null)
                {
                    priority_type_id.SelectedValue = thisTicket.priority_type_id.ToString();
                }
                if (thisTicket.issue_type_id != null)
                {
                    issue_type_id.SelectedValue = thisTicket.issue_type_id.ToString();
                }
                if (thisTicket.source_type_id != null)
                {
                    source_type_id.SelectedValue = thisTicket.source_type_id.ToString();
                }
                if (thisTicket.cate_id != null)
                {
                    cate_id.SelectedValue = thisTicket.cate_id.ToString();
                }
                if (thisTicket.cost_code_id != null)
                {
                    cost_code_id.SelectedValue = thisTicket.cost_code_id.ToString();
                }
                if (thisTicket.department_id != null)
                {
                    department_id.SelectedValue = thisTicket.department_id.ToString();
                }
                if (thisTicket.installed_product_id != null)
                {
                    insPro = new crm_installed_product_dal().FindNoDeleteById((long)thisTicket.installed_product_id);
                }
                if (insPro != null)
                {
                    thisProduct = new ivt_product_dal().FindNoDeleteById(insPro.product_id);
                }
                #endregion

                #region 获取工单周期信息
                thisticketRes = new sdk_recurring_ticket_dal().GetByTicketId(thisTicket.id);
                #endregion
                ticketUdfValueList = new UserDefinedFieldsBLL().GetUdfValue(DicEnum.UDF_CATE.TASK, thisTicket.id, tickUdfList);

                #region 记录浏览历史
                var history = new sys_windows_history()
                {
                    title = $"编辑定期服务主工单:" + thisTicket.no + " " + thisTicket.title + " " + (thisAccount != null ? thisAccount.name : ""),
                    url   = Request.RawUrl,
                };
                new IndexBLL().BrowseHistory(history, LoginUserId);
                #endregion
            }
        }
Example #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                var taskId = Request.QueryString["id"];
                if (!string.IsNullOrEmpty(taskId))
                {
                    thisTicket = new sdk_task_dal().FindNoDeleteById(long.Parse(taskId));
                    if (thisTicket != null)
                    {
                        isAdd              = false;
                        thisBookMark       = new IndexBLL().GetSingBook(Request.Url.LocalPath + "?id=" + taskId, LoginUserId);
                        ticketUdfValueList = new UserDefinedFieldsBLL().GetUdfValue(DicEnum.UDF_CATE.TASK, thisTicket.id, tickUdfList);
                        thisAccount        = new CompanyBLL().GetCompany(thisTicket.account_id);
                        if (thisTicket.contact_id != null)
                        {
                            thisContact = new crm_contact_dal().FindNoDeleteById((long)thisTicket.contact_id);
                        }
                        if (thisTicket.owner_resource_id != null && thisTicket.role_id != null)
                        {
                            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];
                                priRes    = new sys_resource_dal().FindNoDeleteById((long)thisTicket.owner_resource_id);
                            }
                        }

                        if (thisTicket.installed_product_id != null)
                        {
                            insPro = new crm_installed_product_dal().FindNoDeleteById((long)thisTicket.installed_product_id);
                        }
                        if (thisTicket.contract_id != null)
                        {
                            thisContract = new ctt_contract_dal().FindNoDeleteById((long)thisTicket.contract_id);
                        }
                        if (thisTicket.cost_code_id != null)
                        {
                            thisCostCode = new d_cost_code_dal().FindNoDeleteById((long)thisTicket.cost_code_id);
                        }
                        ticketCheckList = new sdk_task_checklist_dal().GetCheckByTask(thisTicket.id);
                        if (ticketCheckList != null && ticketCheckList.Count > 0)
                        {
                            ticketCheckList = ticketCheckList.OrderBy(_ => _.sort_order).ToList();
                        }
                        entryList = new sdk_work_entry_dal().GetList(thisTicket.id);

                        var otherResList = new sdk_task_resource_dal().GetTaskResByTaskId(thisTicket.id);
                        if (otherResList != null && otherResList.Count > 0)
                        {
                            ticketResList = new List <sys_resource_department>();
                            var srdDal = new sys_resource_department_dal();
                            foreach (var resRole in otherResList)
                            {
                                if (resRole.resource_id == null || resRole.role_id == null)
                                {
                                    continue;
                                }
                                var thisResDep = srdDal.GetResDepByResAndRole((long)resRole.resource_id, (long)resRole.role_id);
                                if (thisResDep != null && thisResDep.Count > 0)
                                {
                                    ticketResList.Add(thisResDep[0]);
                                }
                            }
                        }

                        if (thisTicket.service_id != null)
                        {
                            thisService = new ivt_service_dal().FindNoDeleteById((long)thisTicket.service_id);
                            if (thisService == null)
                            {
                                thisServiceBun = new ivt_service_bundle_dal().FindNoDeleteById((long)thisTicket.service_id);
                            }
                        }
                        createRes = new sys_resource_dal().FindNoDeleteById(thisTicket.create_user_id);

                        var    slaValue     = new sdk_task_dal().GetSlaTime(thisTicket);
                        string slaTimeValue = "";
                        if (slaValue != null)
                        {
                            slaTimeValue = slaValue.ToString();
                        }
                        if (!string.IsNullOrEmpty(slaTimeValue))
                        {
                            if (slaTimeValue.Substring(0, 1) == "{")
                            {
                                slaDic = new EMT.Tools.Serialize().JsonToDictionary(slaTimeValue);
                            }
                        }
                        var actList = new d_general_dal().GetGeneralByTableId((int)GeneralTableEnum.ACTION_TYPE);
                        if (actList != null && actList.Count > 0)
                        {
                            ticketNoteTypeList = actList.Where(_ => _.ext2 == ((int)DicEnum.ACTIVITY_CATE.TASK_NOTE).ToString()).ToList();
                        }
                        ticketOther     = new sdk_task_other_dal().GetTicketOther(thisTicket.id);
                        ticketOtherList = new sdk_task_other_person_dal().GetTicketOther(thisTicket.id);
                    }
                }
                var ticketIds = Request.QueryString["ids"];
                if (!string.IsNullOrEmpty(ticketIds))
                {
                    pageTicketList = new sdk_task_dal().GetTicketByIds(ticketIds);
                }


                if (thisTicket == null)
                {
                    Response.Write("<script>alert('未查询到该工单信息!');window.close();</script>");
                    return;
                }
                var history = new sys_windows_history()
                {
                    title = "工单:" + thisTicket.no + ":" + thisTicket.title,
                    url   = Request.RawUrl,
                };
                new IndexBLL().BrowseHistory(history, LoginUserId);
            }
            catch (Exception msg)
            {
                Response.Write("<script>alert('" + msg.Message + "');window.close();</script>");
            }
        }
Example #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                thisBookMark = new IndexBLL().GetSingBook(Request.RawUrl, LoginUserId);
                if (!IsPostBack)
                {
                    ThisPageDataBind();
                }
                task_udfList = new UserDefinedFieldsBLL().GetUdf(DicEnum.UDF_CATE.TASK);
                var project_id = Request.QueryString["project_id"];
                if (!string.IsNullOrEmpty(project_id))
                {
                    thisProject = ppdal.FindNoDeleteById(long.Parse(project_id));
                }
                var parTaskId = Request.QueryString["par_task_id"];
                if (!string.IsNullOrEmpty(parTaskId))
                {
                    parTask = sdDal.FindNoDeleteById(long.Parse(parTaskId));
                    if (parTask != null)
                    {
                        if (parTask.project_id != null)
                        {
                            thisProject = ppdal.FindNoDeleteById((long)parTask.project_id);
                        }
                    }
                }

                var typeString = Request.QueryString["type_id"];
                if (!string.IsNullOrEmpty(typeString))
                {
                    type_id = int.Parse(typeString);
                    if (!IsPostBack)
                    {
                        switch (type_id)
                        {
                        case (int)DicEnum.TASK_TYPE.PROJECT_ISSUE:
                            isProject_issue.Checked = true;
                            break;

                        case (int)DicEnum.TASK_TYPE.PROJECT_TASK:
                            isProject_issue.Checked = false;
                            break;

                        default:
                            break;
                        }
                    }
                }
                var id = Request.QueryString["id"];
                if (!string.IsNullOrEmpty(id))
                {
                    thisTask = sdDal.FindNoDeleteById(long.Parse(id));
                    if (thisTask != null)
                    {
                        if (thisTask.parent_id != null)
                        {
                            parTask = sdDal.FindNoDeleteById((long)thisTask.parent_id);
                        }
                        type_id = thisTask.type_id;
                        isAdd   = false;
                        var isCopyString = Request.QueryString["IsCopy"];
                        if (!string.IsNullOrEmpty(isCopyString) && thisTask.type_id == (int)DicEnum.TASK_TYPE.PROJECT_TASK)
                        {
                            isCopy = true;
                        }
                        if (thisTask.project_id != null)
                        {
                            thisProject = ppdal.FindNoDeleteById((long)thisTask.project_id);
                        }
                        task_udfValueList = new UserDefinedFieldsBLL().GetUdfValue(DicEnum.UDF_CATE.TASK, thisTask.id, task_udfList);
                        noteList          = new com_activity_dal().GetActiList($" and (task_id ={thisTask.id} or object_id={thisTask.id} )");

                        preList = new sdk_task_predecessor_dal().GetRelList(thisTask.id);
                        if (!IsPostBack)
                        {
                            status_id.SelectedValue = thisTask.status_id.ToString();
                            if (thisTask.is_visible_in_client_portal == 0)
                            {
                                DisplayInCapNone.Checked = true;
                            }
                            else
                            {
                                if (thisTask.can_client_portal_user_complete_task == 1)
                                {
                                    DisplayInCapYes.Checked = true;
                                }
                                else
                                {
                                    DisplayInCapYesNoComplete.Checked = true;
                                }
                            }

                            if (thisTask.is_project_issue == 1)
                            {
                                isProject_issue.Checked = true;
                            }
                            else
                            {
                                isProject_issue.Checked = false;
                            }

                            if (thisTask.estimated_type_id == (int)DicEnum.TIME_ENTRY_METHOD_TYPE.FIXWORK)
                            {
                                TaskTypeFixedWork.Checked = true;
                            }
                            else if (thisTask.estimated_type_id == (int)DicEnum.TIME_ENTRY_METHOD_TYPE.FIXDURATION)
                            {
                                TaskTypeFixedDuration.Checked = true;
                            }
                            else
                            {
                            }

                            department_id.SelectedValue = thisTask.department_id == null ? "" : ((int)thisTask.department_id).ToString();
                        }
                        var typeName = "任务";
                        //  判断是阶段,查询出相关项目的关联合同的里程碑  和自己的里程碑
                        if (type_id == (int)DicEnum.TASK_TYPE.PROJECT_PHASE && thisProject != null && thisProject.contract_id != null)
                        {
                            typeName = "阶段";
                            // 获取该项目合同下未被关联的里程碑
                            var proConMilList = new ctt_contract_milestone_dal().GetListByProId(thisProject.id);
                            // 获取该阶段下的所有里程碑
                            var phaMilList = new sdk_task_milestone_dal().GetPhaMilList(thisTask.id);
                            thisPhaMile = new List <PageMile>();
                            if (proConMilList != null && proConMilList.Count > 0)
                            {
                                thisPhaMile.AddRange(proConMilList);
                            }
                            if (phaMilList != null && phaMilList.Count > 0)
                            {
                                thisPhaMile.AddRange(phaMilList);
                            }
                            if (thisPhaMile.Count > 0)
                            {
                                thisPhaMile = thisPhaMile.OrderBy(_ => _.dueDate).ToList();
                            }
                        }
                        #region 记录浏览历史
                        if (!isCopy && !isAdd)
                        {
                            var account = new CompanyBLL().GetCompany(thisTask.account_id);
                            var history = new sys_windows_history()
                            {
                                title = $"编辑{typeName}:" + (thisProject != null ? thisProject.name : "") + " " + thisTask.title + " " + (account != null ? account.name : ""),
                                url   = Request.RawUrl,
                            };
                            new IndexBLL().BrowseHistory(history, LoginUserId);
                        }
                        #endregion
                    }
                }
                if (type_id == (int)DicEnum.TASK_TYPE.PROJECT_PHASE)
                {
                    isPhase = true;
                }

                if (thisProject == null)
                {
                    Response.End();
                }
                else
                {
                    if (thisProject.contract_id != null)
                    {
                        thisProContract = new ctt_contract_dal().FindNoDeleteById((long)thisProject.contract_id);
                        rateList        = new ctt_contract_rate_dal().GetRateByConId((long)thisProject.contract_id);
                    }
                }
            }
            catch (Exception msg)
            {
                Response.End();
            }
        }