예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            long regionId = 0;

            if (!string.IsNullOrEmpty(Request.QueryString["regionId"]) && long.TryParse(Request.QueryString["regionId"], out regionId))
            {
                thisTaxRegion = genBll.GetSingleGeneral(regionId, true);
            }
            long cateId = 0;

            if (!string.IsNullOrEmpty(Request.QueryString["cateId"]) && long.TryParse(Request.QueryString["cateId"], out cateId))
            {
                thisTaxCate = genBll.GetSingleGeneral(cateId, true);
            }

            long id = 0;

            if (!string.IsNullOrEmpty(Request.QueryString["id"]) && long.TryParse(Request.QueryString["id"], out id))
            {
                thisCate = genBll.GetRegionCate(id);
            }
            if (thisCate != null)
            {
                isAdd         = false;
                thisTaxRegion = genBll.GetSingleGeneral(thisCate.tax_region_id, true);
                thisTaxCate   = genBll.GetSingleGeneral(thisCate.tax_cate_id, true);
                taxList       = genBll.GetCateTaxList(thisCate.id);
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            long id = 0;

            if (!string.IsNullOrEmpty(Request.QueryString["id"]) && long.TryParse(Request.QueryString["id"], out id))
            {
                thisActivity = new ActivityBLL().GetActivity(id);
            }


            if (thisActivity == null)
            {
                Response.Write("<script>alert('为获取到相关信息!请刷新页面后重试!');window.close();</script>");
            }
            else
            {
                if (thisActivity.account_id != null)
                {
                    account = new CompanyBLL().GetCompany((long)thisActivity.account_id);
                }
                if (thisActivity.resource_id != null)
                {
                    assignUser = new UserResourceBLL().GetResourceById((long)thisActivity.resource_id);
                }
                createUser = new UserResourceBLL().GetResourceById(thisActivity.create_user_id);

                actType = new GeneralBLL().GetSingleGeneral(thisActivity.action_type_id, true);

                if (thisActivity.action_type_id == (int)DTO.DicEnum.ACTIVITY_CATE.TODO)
                {
                    isTodo = true;
                }
            }
        }
예제 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     id = Convert.ToInt64(Request.QueryString["id"]);
     if (!IsPostBack)
     {
         if (id > 0)
         {
             winreason = new GeneralBLL().GetSingleGeneral(id);
             if (winreason == null)
             {
                 Response.Write("<script>alert('获取相关信息失败,无法修改!');window.close();self.opener.location.reload();</script>");
             }
             else
             {
                 this.Name.Text = winreason.name.ToString();
                 if (winreason.remark != null && !string.IsNullOrEmpty(winreason.remark.ToString()))
                 {
                     this.Description.Text = winreason.remark.ToString();
                 }
                 if (Convert.ToInt32(winreason.is_active) > 0)
                 {
                     this.Active.Checked = true;
                 }
                 else
                 {
                     this.Active.Checked = false;
                 }
             }
         }
         else
         {
             this.Active.Checked = true;
         }
     }
 }
예제 #4
0
        protected void save_close_Click(object sender, EventArgs e)
        {
            d_general pageDic = AssembleModel <d_general>();

            if (!string.IsNullOrEmpty(Request.Form["isActive"]) && Request.Form["isActive"] == "on")
            {
                pageDic.is_active = 1;
            }
            else
            {
                pageDic.is_active = 0;
            }
            pageDic.parent_id        = parentId;
            pageDic.general_table_id = tableId;
            if (!isAdd)
            {
                thisIssue.name      = pageDic.name;
                thisIssue.is_active = pageDic.is_active;
                thisIssue.ext1      = pageDic.ext1;
            }
            bool result = false;

            if (isAdd)
            {
                result = genBll.AddGeneral(pageDic, LoginUserId);
            }
            else
            {
                result = genBll.EditGeneral(thisIssue, LoginUserId);
            }

            ClientScript.RegisterStartupScript(this.GetType(), "提示信息", $"<script>alert('保存{(result ? "成功" : "失败")}!');self.opener.location.reload();window.close();</script>");
        }
예제 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            type = Request.QueryString["type"];
            long id = 0;

            if (long.TryParse(Request.QueryString["id"], out id))
            {
                thisDic = genBll.GetSingleGeneral(id);
            }
            if (thisDic != null)
            {
                isAdd = false;
                if (thisDic.parent_id == (int)DicEnum.SKILLS_CATE_TYPE.CERTIFICATION)
                {
                    type = "Certificate";
                }
                else if (thisDic.parent_id == (int)DicEnum.SKILLS_CATE_TYPE.DEGREE)
                {
                    type = "Degree";
                }
                if (thisDic.general_table_id != (int)GeneralTableEnum.SKILLS_CATE)
                {
                    isAdd   = true;
                    thisDic = null;
                }
            }
            if (type == "Certificate")
            {
                parentlId = (int)DicEnum.SKILLS_CATE_TYPE.CERTIFICATION; typeName = "证书";
            }
            else if (type == "Degree")
            {
                parentlId = (int)DicEnum.SKILLS_CATE_TYPE.DEGREE; typeName = "学位";
            }
        }
예제 #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     id = Convert.ToInt64(Request.QueryString["id"]);
     if (!IsPostBack)
     {
         if (id > 0)
         {
             leadsource = new GeneralBLL().GetSingleGeneral(id);
             if (leadsource == null)
             {
                 Response.Write("<script>alert('获取相关信息失败,无法修改!');window.close();self.opener.location.reload();</script>");
             }
             else
             {
                 this.Name.Text = leadsource.name.ToString();
                 if (leadsource.remark != null && !string.IsNullOrEmpty(leadsource.remark.ToString()))
                 {
                     this.Description.Text = leadsource.remark.ToString();
                 }
                 if (leadsource.sort_order != null && !string.IsNullOrEmpty(leadsource.sort_order.ToString()))
                 {
                     this.Number.Text = leadsource.sort_order.ToString();
                 }
             }
         }
     }
 }
예제 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["parentId"]))
            {
                parentId = int.Parse(Request.QueryString["parentId"]);
            }
            if (!string.IsNullOrEmpty(Request.QueryString["tableId"]))
            {
                int.TryParse(Request.QueryString["tableId"], out tableId);
            }
            long id = 0;

            if (!string.IsNullOrEmpty(Request.QueryString["id"]) && long.TryParse(Request.QueryString["id"], out id))
            {
                thisIssue = genBll.GetSingleGeneral(id);
            }
            if (thisIssue != null)
            {
                isAdd   = false;
                tableId = thisIssue.general_table_id;
                if (tableId == (int)DTO.GeneralTableEnum.TASK_ISSUE_TYPE)
                {
                    subIssueList = new DAL.d_general_dal().GetGeneralByParentId(thisIssue.id);
                }
            }
        }
예제 #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     id = Convert.ToInt64(Request.QueryString["id"]);
     if (id > 0)
     {
         contract_milestone = new GeneralBLL().GetSingleGeneral(id);
         if (contract_milestone == null)
         {
             Response.Write("<script>alert('获取相关信息失败,无法修改!');</script>");
         }
         else
         {
             this.Name.Text = contract_milestone.name.ToString();
             if (contract_milestone.sort_order != null)
             {
                 this.SortOrder.Text = contract_milestone.sort_order.ToString();
             }
             if (contract_milestone.is_active > 0)
             {
                 this.Active.Checked = true;
             }
             else
             {
                 this.Active.Checked = false;
             }
         }
     }
     else
     {
         this.Active.Checked = true;
     }
 }
예제 #9
0
파일: Suffixes.aspx.cs 프로젝트: evelh/Done
 protected void Page_Load(object sender, EventArgs e)
 {
     id = Convert.ToInt64(Request.QueryString["id"]);
     if (!IsPostBack)
     {
         if (id > 0)
         {
             suffix = new GeneralBLL().GetSingleGeneral(id);
             if (suffix == null)
             {
                 Response.Write("<script>alert('获取相关信息失败,无法修改!');window.close();self.opener.location.reload();</script>");
             }
             else
             {
                 this.Suffix_name.Text = suffix.name.ToString();
                 if (suffix.is_active > 0)
                 {
                     this.Active.Checked = true;
                 }
                 else
                 {
                     this.Active.Checked = false;
                 }
             }
         }
         else
         {
             this.Active.Checked = true;
         }
     }
 }
예제 #10
0
 /// <summary>
 /// 处理需要保存的数据
 /// </summary>
 public bool save_deal()
 {
     if (id > 0)
     {
         region = new GeneralBLL().GetSingleGeneral(id);
     }
     region.name = this.Region_Name.Text.Trim().ToString();
     if (!string.IsNullOrEmpty(this.Region_Description.Text.Trim().ToString()))
     {
         region.remark = this.Region_Description.Text.Trim().ToString();
     }
     if (id > 0)
     {
         var result = new GeneralBLL().Update(region, GetLoginUserId());
         if (result == ERROR_CODE.SUCCESS)
         {
             Response.Write("<script>alert('区域修改成功');</script>");
             return(true);
         }
         else if (result == ERROR_CODE.USER_NOT_FIND)               // 用户丢失
         {
             Response.Write("<script>alert('查询不到用户,请重新登陆');</script>");
             Response.Redirect("../Login.aspx");
         }
         else if (result == DTO.ERROR_CODE.EXIST)
         {
             Response.Write("<script>alert('已经存在相同名称,请修改!');</script>");
         }
         else
         {
             Response.Write("<script>alert('修改区域失败!');</script>");
             return(false);
         }
     }
     else
     {
         region.general_table_id = (int)GeneralTableEnum.REGION;
         var result = new GeneralBLL().Insert(region, GetLoginUserId());
         if (result == ERROR_CODE.SUCCESS)
         {
             Response.Write("<script>alert('新增区域成功');</script>");
             return(true);
         }
         else if (result == ERROR_CODE.USER_NOT_FIND)               // 用户丢失
         {
             Response.Write("<script>alert('查询不到用户,请重新登陆');</script>");
             Response.Redirect("../Login.aspx");
         }
         else if (result == DTO.ERROR_CODE.EXIST)
         {
             Response.Write("<script>alert('已经存在相同名称,请修改');</script>");
         }
         else
         {
             Response.Write("<script>alert('新增区域失败!');</script>");
             return(false);
         }
     }
     return(false);
 }
예제 #11
0
 private bool save_deal()
 {
     if (id > 0)
     {
         mark = new GeneralBLL().GetSingleGeneral(id);
     }
     mark.name = this.Market_Name.Text.Trim().ToString();
     if (!string.IsNullOrEmpty(this.Market_Description.Text.Trim().ToString()))
     {
         mark.remark = this.Market_Description.Text.Trim().ToString();
     }
     if (id > 0)
     {
         var result = smbll.Update(mark, GetLoginUserId());
         if (result == DTO.ERROR_CODE.SUCCESS)
         {
             Response.Write("<script>alert('市场领域修改成功!');</script>");
             return(true);
         }
         if (result == DTO.ERROR_CODE.USER_NOT_FIND)
         {
             Response.Write("<script>alert('查询不到用户,请重新登陆');</script>");
             Response.Redirect("../Login.aspx");
         }
         else if (result == DTO.ERROR_CODE.EXIST)
         {
             Response.Write("<script>alert('已经存在相同名称,请修改!');</script>");
         }
     }
     else
     {
         mark.general_table_id = (int)GeneralTableEnum.MARKET_SEGMENT;
         var result = smbll.Insert(mark, GetLoginUserId());
         if (result == DTO.ERROR_CODE.SUCCESS)
         {
             Response.Write("<script>alert('市场领域添加成功!');</script>");
             return(true);
         }
         else if (result == DTO.ERROR_CODE.USER_NOT_FIND)
         {
             Response.Write("<script>alert('查询不到用户,请重新登陆');</script>");
             Response.Redirect("../Login.aspx");
         }
         else if (result == DTO.ERROR_CODE.EXIST)
         {
             Response.Write("<script>alert('已经存在相同名称,请修改!');</script>");
         }
         else
         {
             return(false);
         }
     }
     return(false);
 }
예제 #12
0
 private bool save_deal()
 {
     if (id > 0)//修改
     {
         compe = new GeneralBLL().GetSingleGeneral(id);
         if (compe == null)
         {
             Response.Write("<script>alert('获取相关信息失败,无法修改!');window.close();self.opener.location.reload();</script>");
         }
     }
     compe.name = this.Competitor_Name.Text.Trim().ToString();
     if (!string.IsNullOrEmpty(this.Competitor_Name.Text.Trim().ToString()))
     {
         compe.remark = this.Competitor_Description.Text.Trim().ToString();
     }
     if (id > 0)
     {
         var result = smbll.Update(compe, GetLoginUserId());
         if (result == DTO.ERROR_CODE.SUCCESS)
         {
             return(true);
         }
         else if (result == DTO.ERROR_CODE.USER_NOT_FIND)               // 用户丢失
         {
             Response.Write("<script>alert('查询不到用户,请重新登陆');</script>");
             Response.Redirect("../Login.aspx");
         }
         else if (result == DTO.ERROR_CODE.EXIST)
         {
             Response.Write("<script>alert('已经存在相同名称,请修改!');</script>");
         }
     }
     else
     {
         compe.general_table_id = (int)GeneralTableEnum.COMPETITOR;
         var result = smbll.Insert(compe, GetLoginUserId());
         if (result == DTO.ERROR_CODE.SUCCESS)
         {
             return(true);
         }
         else if (result == DTO.ERROR_CODE.USER_NOT_FIND)               // 用户丢失
         {
             Response.Write("<script>alert('查询不到用户,请重新登陆');</script>");
             Response.Redirect("../Login.aspx");
         }
         else if (result == DTO.ERROR_CODE.EXIST)
         {
             Response.Write("<script>alert('已经存在相同名称,请修改!');</script>");
         }
     }
     return(false);
 }
예제 #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            long id = 0;

            if (!string.IsNullOrEmpty(Request.QueryString["id"]) && long.TryParse(Request.QueryString["id"], out id))
            {
                ledger = genBll.GetSingleGeneral(id);
            }
            if (ledger != null && ledger.delete_time == 0)
            {
                isAdd    = false;
                codeList = new CostCodeBLL().GetWorkCodeByLedger(ledger.id);
            }
        }
예제 #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            long id = 0;

            if (!string.IsNullOrEmpty(Request.QueryString["id"]))
            {
                if (long.TryParse(Request.QueryString["id"], out id))
                {
                    thisGeneral = genBll.GetSingleGeneral(id);
                }
            }
            if (thisGeneral == null)
            {
                Response.Write("<script>alert('未获取到相关信息');window.close();</script>");
            }
        }
예제 #15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     id = Convert.ToInt64(Request.QueryString["id"]);
     if (!IsPostBack)
     {
         if (id > 0)
         {
             //修改操作
             region = new GeneralBLL().GetSingleGeneral(id);
             this.Region_Name.Text = region.name;
             if (region.remark != null && !string.IsNullOrEmpty(region.remark.ToString()))
             {
                 this.Region_Description.Text = region.remark.ToString();
             }
         }
     }
 }
예제 #16
0
        /// <summary>
        /// 数据保存处理
        /// </summary>
        private bool save_deal()
        {
            bool      status = false;
            d_general terr   = new d_general();

            if (id > 0)
            {
                terr   = new GeneralBLL().GetSingleGeneral(id);
                status = true;
            }
            terr.name = this.Territory_Name.Text.Trim().ToString();
            if (Convert.ToInt32(this.Region.SelectedValue.ToString()) > 0)
            {
                terr.parent_id = Convert.ToInt32(this.Region.SelectedValue.ToString());
            }
            if (!string.IsNullOrEmpty(this.Territory_Description.Text.Trim().ToString()))
            {
                terr.remark = this.Territory_Description.Text.Trim().ToString();
            }
            var result = stbll.SaveTerritory(terr, GetLoginUserId(), ref id);

            if (result == DTO.ERROR_CODE.SUCCESS)
            {
                if (status)
                {
                    Response.Write("<script>alert('客户地域修改成功!');</script>");
                }
                else
                {
                    Response.Write("<script>alert('客户地域添加成功!');</script>");
                }
                return(true);
            }
            else
            if (result == DTO.ERROR_CODE.EXIST)
            {
                Response.Write("<script>alert('已经存在该名称地域');</script>");
            }
            else
            if (result == DTO.ERROR_CODE.USER_NOT_FIND)               // 用户丢失
            {
                Response.Write("<script>alert('查询不到用户,请重新登陆');</script>");
                Response.Redirect("../Login.aspx");
            }
            return(false);
        }
예제 #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var id = Request.QueryString["id"];

            if (!string.IsNullOrEmpty(id))
            {
                thisCate = new DAL.d_general_dal().FindNoDeleteById(long.Parse(id));
            }
            var parentId = Request.QueryString["parentId"];

            if (!string.IsNullOrEmpty(parentId))
            {
                chooseParentId = long.Parse(parentId);
            }
            if (thisCate != null)
            {
                chooseParentId = thisCate.parent_id;
            }
        }
예제 #18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            type = Request.QueryString["type"];

            long id = 0;

            if (long.TryParse(Request.QueryString["id"], out id))
            {
                thisDic = genBll.GetSingleGeneral(id);
            }
            if (thisDic != null)
            {
                isAdd = false;
                if (thisDic.parent_id != null)
                {
                    var thisParent = genBll.GetSingleGeneral((long)thisDic.parent_id);
                    if (thisParent != null)
                    {
                        if (thisParent.parent_id == (int)DicEnum.SKILLS_CATE_TYPE.CERTIFICATION)
                        {
                            type = "Certificate";
                        }
                        else if (thisParent.parent_id == (int)DicEnum.SKILLS_CATE_TYPE.DEGREE)
                        {
                            type = "Degree";
                        }
                    }
                }
            }
            if (type == "Certificate")
            {
                generalId = (int)DicEnum.SKILLS_CATE_TYPE.CERTIFICATION; typeName = "证书";
            }
            else if (type == "Degree")
            {
                generalId = (int)DicEnum.SKILLS_CATE_TYPE.DEGREE; typeName = "学位";
            }
            cateList = new DAL.d_general_dal().GetGeneralByParentId(generalId);
            // 实体读取 table=60
            // 类别读取 table = 175
        }
예제 #19
0
        protected void save_close_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(Request.Form["name"]) || string.IsNullOrEmpty(Request.Form["cateId"]))
            {
                ClientScript.RegisterStartupScript(this.GetType(), "提示信息", $"<script>alert(‘未获取到名称或类别,请重试!');</script>");
                return;
            }
            d_general pageDic = new d_general()
            {
                name             = Request.Form["name"],
                parent_id        = int.Parse(Request.Form["cateId"]),
                remark           = Request.Form["remark"],
                is_active        = (sbyte)(!string.IsNullOrEmpty(Request.Form["isActive"]) && Request.Form["isActive"] == "on" ? 1 : 0),
                general_table_id = (int)GeneralTableEnum.RESOURCE_SKILL_TYPE,
            };

            if (isAdd)
            {
                thisDic = pageDic;
            }
            else
            {
                thisDic.name      = pageDic.name;
                thisDic.parent_id = pageDic.parent_id;
                thisDic.remark    = pageDic.remark;
                thisDic.is_active = pageDic.is_active;
            }
            bool result = false;

            if (isAdd)
            {
                result = genBll.AddGeneral(thisDic, LoginUserId);
            }
            else
            {
                result = genBll.EditGeneral(thisDic, LoginUserId);
            }

            ClientScript.RegisterStartupScript(this.GetType(), "提示信息", $"<script>alert('保存{(result?"成功":"失败")}!');self.opener.location.reload();window.close();</script>");
        }
예제 #20
0
파일: KnowledgeBLL.cs 프로젝트: evelh/Done
        /// <summary>
        /// 新增知识库目录
        /// </summary>
        public bool AddKnowMenu(string name, int parentId, long userId, ref string failReason)
        {
            if (string.IsNullOrEmpty(name))
            {
                failReason = "为获取到相关名称";
                return(false);
            }
            var dgDal    = new d_general_dal();
            var isCanAdd = true;
            var subList  = dgDal.GetGeneralByParentId(parentId);

            if (subList != null && subList.Count > 0)
            {
                if (subList.Any(_ => name.Equals(_.name)))
                {
                    isCanAdd = false;
                }
            }
            if (!isCanAdd)
            {
                failReason = "同一级目录,名称不能相同!";
                return(false);
            }
            var timeNow  = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Now);
            var thisCate = new d_general()
            {
                id = (int)dgDal.GetNextIdCom(),
                general_table_id = (int)DTO.GeneralTableEnum.KNOWLEDGE_BASE_CATE,
                create_time      = timeNow,
                update_time      = timeNow,
                create_user_id   = userId,
                update_user_id   = userId,
                name             = name,
                parent_id        = parentId,
            };

            dgDal.Insert(thisCate);
            OperLogBLL.OperLogAdd <d_general>(thisCate, thisCate.id, userId, OPER_LOG_OBJ_CATE.General_Code, "新增知识库目录");
            return(true);
        }
예제 #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                var artId = Request.QueryString["id"];
                if (!string.IsNullOrEmpty(artId))
                {
                    thisArt = new DAL.sdk_kb_article_dal().FindNoDeleteById(long.Parse(artId));
                }
                if (thisArt == null)
                {
                    Response.Write($"<script>alert('未查询到该知识库!');window.close();</script>");
                    return;
                }
                var dgDal = new DAL.d_general_dal();
                cataString = new KnowledgeBLL().GetCateString(thisArt.kb_category_id, cataString);
                if (!string.IsNullOrEmpty(cataString))
                {
                    cataString = cataString.Substring(0, cataString.Length - 1);
                }
                publish     = dgDal.FindNoDeleteById((long)thisArt.publish_to_type_id);
                creater     = srDal.FindById(thisArt.create_user_id);
                update      = srDal.FindById(thisArt.update_user_id);
                ticList     = new DAL.sdk_kb_article_ticket_dal().GetArtTicket(thisArt.id);
                thisNoteAtt = new DAL.com_attachment_dal().GetAttListByOid(thisArt.id);
                commList    = new DAL.sdk_kb_article_comment_dal().GetCommByArt(thisArt.id);

                var history = new sys_windows_history()
                {
                    title = "知识库文档:" + thisArt.title,
                    url   = Request.RawUrl,
                };
                new IndexBLL().BrowseHistory(history, LoginUserId);
            }
            catch (Exception msg)
            {
                Response.Write($"<script>alert('{msg.Message}');window.close();</script>");
            }
        }
예제 #22
0
 protected void Page_Load(object sender, EventArgs e)
 {
     id = Convert.ToInt64(Request.QueryString["id"]);
     if (!IsPostBack)
     {
         long group_udf_id = 0;
         if (id > 0)  //修改数据
         {
             configtype            = configtypebll.GetSingleGeneral(id);
             this.Config_name.Text = configtype.name;
             if (configtype.is_active > 0)
             {
                 this.Active.Checked = true;
             }
             if (configtype.ext1 != null && !string.IsNullOrEmpty(configtype.ext1.ToString()))
             {
                 group_udf_id = Convert.ToInt64(configtype.ext1.ToString());
             }
         }
         GetAlludf = ctbll.GetAlludf(group_udf_id);
     }
 }
예제 #23
0
 protected void Page_Load(object sender, EventArgs e)
 {
     id = Convert.ToInt32(Request.QueryString["id"]);//获取id
     if (!IsPostBack)
     {
         if (id > 0)//修改
         {
             compe = new GeneralBLL().GetSingleGeneral(id);
             if (compe == null)
             {
                 Response.Write("<script>alert('获取相关信息失败,无法修改!');window.close();self.opener.location.reload();</script>");
             }
             else
             {
                 this.Competitor_Name.Text = compe.name.ToString();
                 if (compe.remark != null && !string.IsNullOrEmpty(compe.remark.ToString()))
                 {
                     this.Competitor_Description.Text = compe.remark.ToString();
                 }
             }
         }
     }
 }
예제 #24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     id = Convert.ToInt64(Request.QueryString["id"]);
     if (!IsPostBack)
     {
         this.View.DataTextField  = "show";
         this.View.DataValueField = "val";
         this.View.DataSource     = atbll.GetCalendarField().FirstOrDefault(_ => _.Key == "View").Value;
         this.View.DataBind();
         this.View.SelectedIndex = 0;
         if (id > 0)
         {
             action = new GeneralBLL().GetSingleGeneral(id);
             if (action == null)
             {
                 Response.Write("<script>alert('获取市场相关信息失败,无法修改!');window.close();self.opener.location.reload();</script>");
             }
             else
             {
                 this.Name.Text          = action.name.ToString();
                 this.View.SelectedValue = action.parent_id.ToString();
                 if (action.is_active > 0)
                 {
                     this.Active.Checked = true;
                 }
                 else
                 {
                     this.Active.Checked = true;
                 }
             }
         }
         else
         {
             this.Active.Checked = true;
         }
     }
 }
예제 #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["cateId"]))
            {
                int.TryParse(Request.QueryString["cateId"], out cateId);
            }
            long id = 0;

            if (!string.IsNullOrEmpty(Request.QueryString["id"]) && long.TryParse(Request.QueryString["id"], out id))
            {
                code = codeBll.GetCodeById(id);
            }
            if (code != null)
            {
                isAdd    = false;
                cateId   = code.cate_id;
                ruleList = codeBll.GetRuleListByCodeId(code.id);
            }
            if (cateId == 0)
            {
                Response.Write("<script>alert('未获取到相关种类!');window.close();</script>");
            }
            cateGeneral = new GeneralBLL().GetSingleGeneral(cateId);
        }
예제 #26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     id = Convert.ToInt64(Request.QueryString["id"]);
     if (id > 0)
     {
         contract = new GeneralBLL().GetSingleGeneral(id);
         if (contract == null)
         {
             Response.Write("<script>alert('获取相关信息失败,无法修改!');window.close();self.opener.location.reload();</script>");
         }
         else
         {
             this.Name.Text = contract.name.ToString();
             if (contract.remark != null)
             {
                 this.Description.Text = contract.remark.ToString();
             }
             if (contract.is_active > 0)
             {
                 this.Active.Checked = true;
             }
             else
             {
                 this.Active.Checked = false;
             }
             if (contract.is_active > 0)
             {
                 this.Active.Checked = true;
             }
         }
     }
     else
     {
         this.Active.Checked = true;
     }
 }
예제 #27
0
        protected void Save_Close_Click(object sender, EventArgs e)
        {
            if (id > 0)
            {
                contract_milestone = new GeneralBLL().GetSingleGeneral(id);
                if (contract_milestone == null)
                {
                    Response.Write("<script>alert('获取相关信息失败,无法修改!');</script>");
                }
            }
            contract_milestone.name = this.Name.Text.Trim().ToString();
            if (!string.IsNullOrEmpty(this.SortOrder.Text.Trim().ToString()))
            {
                contract_milestone.sort_order = Convert.ToDecimal(this.SortOrder.Text.Trim().ToString());
            }
            if (this.Active.Checked)
            {
                contract_milestone.is_active = 1;
            }
            if (id > 0)
            {
                //修改

                if ((contract_milestone.sort_order != null && new GeneralBLL().update_sort_order(contract_milestone.id, contract_milestone.general_table_id, (Decimal)contract_milestone.sort_order)) || contract_milestone.sort_order == null)
                {
                    var result = new GeneralBLL().Update(contract_milestone, GetLoginUserId());
                    if (result == ERROR_CODE.SUCCESS)
                    {
                        Response.Write("<script>alert('里程碑状态修改成功!');window.close();self.opener.location.reload();</script>");
                    }
                    else if (result == ERROR_CODE.USER_NOT_FIND)               // 用户丢失
                    {
                        Response.Write("<script>alert('查询不到用户,请重新登陆');</script>");
                        Response.Redirect("../Login.aspx");
                    }
                    else if (result == DTO.ERROR_CODE.EXIST)
                    {
                        Response.Write("<script>alert('已经存在相同名称,请修改!');</script>");
                    }
                }
                else
                {
                    Response.Write("<script>alert('已经存在相同的排序号,请修改!');</script>");
                }
            }
            else
            {
                //新增
                contract_milestone.general_table_id = (int)GeneralTableEnum.CONTRACT_MILESTONE;
                if ((contract_milestone.sort_order != null && new GeneralBLL().sort_order(contract_milestone.general_table_id, (Decimal)contract_milestone.sort_order)) || contract_milestone.sort_order == null)
                {
                    var result = new GeneralBLL().Insert(contract_milestone, GetLoginUserId());
                    if (result == ERROR_CODE.SUCCESS)
                    {
                        Response.Write("<script>alert('里程碑状态添加成功!');window.close();self.opener.location.reload();</script>");
                    }
                    else if (result == ERROR_CODE.USER_NOT_FIND)               // 用户丢失
                    {
                        Response.Write("<script>alert('查询不到用户,请重新登陆');</script>");
                        Response.Redirect("../Login.aspx");
                    }
                    else if (result == DTO.ERROR_CODE.EXIST)
                    {
                        Response.Write("<script>alert('已经存在相同名称,请修改!');</script>");
                    }
                }
                else
                {
                    Response.Write("<script>alert('已经存在相同的排序号,请修改!');</script>");
                }
            }
        }
예제 #28
0
 private bool save_deal()
 {
     if (id > 0)
     {
         leadsource = new GeneralBLL().GetSingleGeneral(id);
     }
     leadsource.name = this.Name.Text.Trim().ToString();
     if (!string.IsNullOrEmpty(this.Description.Text.Trim()))
     {
         leadsource.remark = this.Description.Text.Trim().ToString();
     }
     if (!string.IsNullOrEmpty(this.Number.Text.Trim().ToString()))
     {
         leadsource.sort_order = Convert.ToDecimal(this.Number.Text.Trim().ToString());
     }
     if (id > 0)
     {
         //修改更新
         if ((leadsource.sort_order != null && sobll.update_sort_order(leadsource.id, leadsource.general_table_id, (Decimal)leadsource.sort_order)) || leadsource.sort_order == null)
         {
             var result = sobll.Update(leadsource, GetLoginUserId());
             if (result == DTO.ERROR_CODE.SUCCESS)
             {
                 Response.Write("<script>alert('商机来源修改成功!');</script>");
                 return(true);
             }
             else if (result == DTO.ERROR_CODE.USER_NOT_FIND)               // 用户丢失
             {
                 Response.Write("<script>alert('查询不到用户,请重新登陆');</script>");
                 Response.Redirect("../Login.aspx");
             }
             else if (result == DTO.ERROR_CODE.EXIST)
             {
                 Response.Write("<script>alert('已经存在相同名称,请修改!');</script>");
             }
         }
         else
         {
             Response.Write("<script>alert('已经存在的商机来源中包含该序列号,请修改!');</script>");
         }
     }
     else
     {
         //新增
         leadsource.general_table_id = (int)GeneralTableEnum.OPPORTUNITY_SOURCE;
         if (leadsource.sort_order == null || (leadsource.sort_order != null && sobll.sort_order(leadsource.general_table_id, (Decimal)leadsource.sort_order)))
         {
             var result = sobll.Insert(leadsource, GetLoginUserId());
             if (result == DTO.ERROR_CODE.SUCCESS)
             {
                 Response.Write("<script>alert('商机来源添加成功!');</script>");
                 return(true);
             }
             else if (result == DTO.ERROR_CODE.USER_NOT_FIND)               // 用户丢失
             {
                 Response.Write("<script>alert('查询不到用户,请重新登陆');</script>");
                 Response.Redirect("../Login.aspx");
             }
             else if (result == DTO.ERROR_CODE.EXIST)
             {
                 Response.Write("<script>alert('已经存在相同名称,请修改!');</script>");
             }
         }
         else
         {
             Response.Write("<script>alert('已经存在的商机来源中包含该序列号,请修改!');</script>");
         }
     }
     return(false);
 }
예제 #29
0
        /// <summary>
        /// 新增地域
        /// </summary>
        /// <param name="data"></param>
        /// <param name="user_id"></param>
        /// <returns></returns>
        public ERROR_CODE SaveTerritory(d_general data, long user_id, ref int id)
        {
            var user = UserInfoBLL.GetUserInfo(user_id);

            if (user == null)
            {   // 查询不到用户,用户丢失
                return(ERROR_CODE.USER_NOT_FIND);
            }
            if (id > 0)
            {
                var res = new GeneralBLL().GetSingleGeneral(data.name, data.general_table_id);
                if (res != null && res.id != data.id)
                {
                    return(ERROR_CODE.EXIST);
                }
                var old = new GeneralBLL().GetSingleGeneral(data.id);
                data.update_time    = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Now);
                data.update_user_id = user_id;
                if (!_dal.Update(data))
                {
                    return(ERROR_CODE.ERROR);
                }
                var add_log = new sys_oper_log()
                {
                    user_cate           = "用户",
                    user_id             = (int)user.id,
                    name                = user.name,
                    phone               = user.mobile == null ? "" : user.mobile,
                    oper_time           = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Now),
                    oper_object_cate_id = (int)OPER_LOG_OBJ_CATE.General_Code, //
                    oper_object_id      = data.id,                             // 操作对象id
                    oper_type_id        = (int)OPER_LOG_TYPE.UPDATE,
                    oper_description    = _dal.CompareValue(old, data),
                    remark              = "修改地域信息"
                };                                      // 创建日志
                new sys_oper_log_dal().Insert(add_log); // 插入日志
            }
            else
            {
                data.general_table_id = (int)GeneralTableEnum.TERRITORY;
                data.create_time      = data.update_time = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Now);
                data.create_user_id   = user_id;
                //唯一性校验
                var res = new GeneralBLL().GetSingleGeneral(data.name, data.general_table_id);
                if (res != null)
                {
                    return(ERROR_CODE.EXIST);
                }
                _dal.Insert(data);
                var re = _dal.FindSignleBySql <d_general>($"select * from d_general where name='{data.name}'");
                if (re != null)
                {
                    id = re.id;
                }
                var add_log = new sys_oper_log()
                {
                    user_cate           = "用户",
                    user_id             = (int)user.id,
                    name                = user.name,
                    phone               = user.mobile == null ? "" : user.mobile,
                    oper_time           = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Now),
                    oper_object_cate_id = (int)OPER_LOG_OBJ_CATE.General_Code,
                    oper_object_id      = data.id,// 操作对象id
                    oper_type_id        = (int)OPER_LOG_TYPE.ADD,
                    oper_description    = _dal.AddValue(data),
                    remark              = "新增地域信息"
                };                                      // 创建日志
                new sys_oper_log_dal().Insert(add_log); // 插入日志
            }
            return(ERROR_CODE.SUCCESS);
        }
예제 #30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            long id = 0;

            if (!string.IsNullOrEmpty(Request.QueryString["id"]) && long.TryParse(Request.QueryString["id"], out id))
            {
                thisTaxCate = genBll.GetSingleGeneral(id, true);
            }
            if (thisTaxCate != null)
            {
                isAdd = false;
                List <d_cost_code> CodeList = codeBll.GetCodeByTaxCate(thisTaxCate.id);
                if (CodeList != null && CodeList.Count > 0)
                {
                    List <d_cost_code> workType      = CodeList.Where(_ => _.cate_id == (int)DicEnum.COST_CODE_CATE.GENERAL_ALLOCATION_CODE).ToList();
                    List <d_cost_code> expenseType   = CodeList.Where(_ => _.cate_id == (int)DicEnum.COST_CODE_CATE.EXPENSE_CATEGORY).ToList();
                    List <d_cost_code> materialType  = CodeList.Where(_ => _.cate_id == (int)DicEnum.COST_CODE_CATE.MATERIAL_COST_CODE).ToList();
                    List <d_cost_code> serviceType   = CodeList.Where(_ => _.cate_id == (int)DicEnum.COST_CODE_CATE.RECURRING_CONTRACT_SERVICE_CODE).ToList();
                    List <d_cost_code> milestoneType = CodeList.Where(_ => _.cate_id == (int)DicEnum.COST_CODE_CATE.MILESTONE_CODE).ToList();
                    if (workType.Count > 0)
                    {
                        workType.ForEach(_ => {
                            workTypeIds += _.id.ToString() + ',';
                        });
                    }
                    if (expenseType.Count > 0)
                    {
                        expenseType.ForEach(_ => {
                            expenseIds += _.id.ToString() + ',';
                        });
                    }
                    if (materialType.Count > 0)
                    {
                        materialType.ForEach(_ => {
                            materialIds += _.id.ToString() + ',';
                        });
                    }
                    if (serviceType.Count > 0)
                    {
                        serviceType.ForEach(_ => {
                            serviceIds += _.id.ToString() + ',';
                        });
                    }
                    if (milestoneType.Count > 0)
                    {
                        milestoneType.ForEach(_ => {
                            milestoneIds += _.id.ToString() + ',';
                        });
                    }

                    if (!string.IsNullOrEmpty(workTypeIds))
                    {
                        workTypeIds = workTypeIds.Substring(0, workTypeIds.Length - 1);
                    }
                    if (!string.IsNullOrEmpty(materialIds))
                    {
                        materialIds = materialIds.Substring(0, materialIds.Length - 1);
                    }
                    if (!string.IsNullOrEmpty(serviceIds))
                    {
                        serviceIds = serviceIds.Substring(0, serviceIds.Length - 1);
                    }
                    if (!string.IsNullOrEmpty(expenseIds))
                    {
                        expenseIds = expenseIds.Substring(0, expenseIds.Length - 1);
                    }
                    if (!string.IsNullOrEmpty(milestoneIds))
                    {
                        milestoneIds = milestoneIds.Substring(0, milestoneIds.Length - 1);
                    }
                }
            }
        }