Exemplo n.º 1
0
    private void BindCorpType()
    {
        //string sqlString = "select codeid,CodeName from dbo.XPM_Basic_CodeList where typeId=4 and IsValid=1 and IsVisible=1";
        //DataTable dataSource = publicDbOpClass.DataTableQuary(sqlString);
        //this.ddlCorpType.DataSource = dataSource;
        //this.ddlCorpType.DataValueField = "codeid";
        //this.ddlCorpType.DataTextField = "CodeName";
        //this.ddlCorpType.DataBind();
        //this.ddlCorpType.Items.Insert(0, "请选择类别");
        //if (base.Request["t"] != null || base.Request["ci"] != null || base.Request["cti"] != null)
        //{
        //    base.DealType = (OpType)Enum.Parse(typeof(OpType), base.Request["t"]);
        //    this.CorpID = Convert.ToInt32(base.Request["ci"]);
        //    this.TypeID = Convert.ToInt32(base.Request["cti"]);
        //}
        //this.Custom_PageInit();
        //if (base.DealType == OpType.Upd)
        //{
        //    this.CorpInfoBind();
        //}

        XPMBasicCodeTypeService xPMBasicCodeTypeService = new XPMBasicCodeTypeService();
        XPMBasicCodeType        bySignCode = xPMBasicCodeTypeService.GetBySignCode("CorpType");
        XPMBasicCodeListService xPMBasicCodeListService = new XPMBasicCodeListService();

        System.Collections.Generic.IList <XPMBasicCodeList> byTypeId = xPMBasicCodeListService.GetByTypeId(bySignCode.TypeID, base.UserCode);
        this.dropType.DataSource = byTypeId;
        this.dropType.DataBind();
    }
Exemplo n.º 2
0
        public void AddUser(IList <string> idList, IList <string> userList, string tableName)
        {
            BasicPrivilegeService service = new BasicPrivilegeService();
            IList <string>        subList = idList;

            if (tableName == "XPM_Basic_CodeList")
            {
                subList = new XPMBasicCodeListService().GetSubList(idList[0]);
            }
            foreach (string str in userList)
            {
                foreach (string str2 in subList)
                {
                    BasicPrivilege bp = new BasicPrivilege {
                        PrivilegeId    = Guid.NewGuid().ToString(),
                        RelationsTable = tableName,
                        RelationsKey   = str2,
                        UserCode       = str
                    };
                    if (!service.Exists(bp))
                    {
                        service.Add(bp);
                    }
                }
            }
        }
Exemplo n.º 3
0
    protected string GetTypeByOrderNumber(string orderNumber)
    {
        string result = string.Empty;
        XPMBasicCodeListService xPMBasicCodeListService = new XPMBasicCodeListService();
        XPMBasicCodeList        nameByCodeId            = xPMBasicCodeListService.GetNameByCodeId(orderNumber.Length / 3, "TaskType");

        if (nameByCodeId != null)
        {
            result = nameByCodeId.CodeName;
        }
        return(result);
    }
Exemplo n.º 4
0
    protected void BtnAdd_Click(object sender, EventArgs e)
    {
        CodingInfo codeInfo   = this.GatherInputInfo();
        CodingInfo codingInfo = new CodingInfo();
        int        num        = 0;

        if (base.DealType == OpType.Add)
        {
            codingInfo = this.CodingAct.QuerySingleCodeInfo(codeInfo.CodeName, codeInfo.TypeID);
            if (codingInfo.CodeName != "")
            {
                if (codingInfo.IsValid)
                {
                    this.JS.Text = "alert('该编码已存在!')";
                    return;
                }
                codeInfo.CodeID = codingInfo.CodeID;
                num             = this.CodingAct.RecycleCode(codeInfo);
            }
            else
            {
                num = this.CodingAct.AddBasicCode(codeInfo, "ccd");
                XPMBasicCodeListService source = new XPMBasicCodeListService();
                XPMBasicCodeList        parent = (
                    from c in source
                    where c.CodeID == this.ParentCodeID && c.TypeID == this.TypeID
                    select c).FirstOrDefault <XPMBasicCodeList>();
                if (parent != null)
                {
                    BasicPrivilegeService basicPrivilegeService = new BasicPrivilegeService();
                    IList <string>        user             = basicPrivilegeService.GetUser("XPM_Basic_CodeList", parent.NoteID.ToString());
                    XPMBasicCodeList      xPMBasicCodeList = (
                        from c in source
                        where c.TypeID == this.TypeID && c.ParentCodeID == parent.CodeID && c.CodeName == codeInfo.CodeName
                        select c).FirstOrDefault <XPMBasicCodeList>();
                    foreach (string current in user)
                    {
                        basicPrivilegeService.Add(new BasicPrivilege
                        {
                            PrivilegeId    = Guid.NewGuid().ToString(),
                            RelationsTable = "XPM_Basic_CodeList",
                            RelationsKey   = xPMBasicCodeList.NoteID.ToString(),
                            UserCode       = current
                        });
                    }
                }
            }
        }
        if (base.DealType == OpType.Upd)
        {
            codingInfo = this.CodingAct.QuerySingleCodeInfo(codeInfo.CodeName, codeInfo.TypeID);
            if (codingInfo.CodeName != "")
            {
                if (codingInfo.CodeID != codeInfo.CodeID)
                {
                    this.JS.Text = "alert('该编码已存在!如果没有出现在列表中,那么请重新添加!');";
                }
                else
                {
                    num = this.CodingAct.UpdBasicCode(codeInfo);
                }
            }
            else
            {
                num = this.CodingAct.UpdBasicCode(codeInfo);
            }
        }
        if (num == 1)
        {
            string script = "\r\n\t\t\t\t\t<script>\r\n\t\t\t\t\t\ttop.ui.tabSuccess({ parentName: '_codelist' });\r\n\t\t\t\t\t</script>\r\n\t\t\t\t";
            base.ClientScript.RegisterStartupScript(base.GetType(), Guid.NewGuid().ToString(), script);
            return;
        }
        this.JS.Text = "alert('保存失败!');";
    }