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); }
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('保存失败!');"; }