Exemple #1
0
 private void RestoreCodeInfoToPage(CodingInfo codeInfo)
 {
     this.TxtCodeName.Text     = codeInfo.CodeName.Trim();
     this.ChkIsDefault.Checked = codeInfo.IsDefault;
     this.ParentCodeList       = codeInfo.ParentCodeList;
     I_xh.Text = codeInfo.I_xh.ToString();
 }
Exemple #2
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         if (base.Request.Params["t"] == null || base.Request.Params["cid"] == null || base.Request.Params["pid"] == null || base.Request.Params["tid"] == null)
         {
             this.JS.Text = "alert('参数错误');window.returnValue=false;window.close();";
         }
         else
         {
             base.DealType     = (OpType)System.Enum.Parse(typeof(OpType), base.Request.Params["t"]);
             this.CodeID       = System.Convert.ToInt32((base.Request.Params["cid"] == "") ? "0" : base.Request.Params["cid"]);
             this.ParentCodeID = System.Convert.ToInt32((base.Request.Params["pid"] == "") ? "0" : base.Request.Params["pid"]);
             this.TypeID       = System.Convert.ToInt32((base.Request.Params["tid"] == "") ? "0" : base.Request.Params["tid"]);
         }
         if (base.DealType == OpType.Add)
         {
             this.LblBasicCode.Text = "编码增加";
             this.ParentCodeID      = this.CodeID;
             this.CodeID            = 0;
             CodingInfo codingInfo = this.CodingAct.QuerySingleCodeInfo(this.ParentCodeID, this.TypeID);
             this.ParentCodeList = ((codingInfo.ParentCodeList == "") ? "," : codingInfo.ParentCodeList);
             return;
         }
         this.LblBasicCode.Text = "编码编辑";
         CodingInfo codeInfo = this.CodingAct.QuerySingleCodeInfo(this.CodeID, this.TypeID);
         this.RestoreCodeInfoToPage(codeInfo);
     }
 }
Exemple #3
0
        public FhirRequestContext(
            string method,
            string uriString,
            string baseUriString,
            CodingInfo requestType,
            string correlationId,
            IDictionary <string, StringValues> requestHeaders,
            IDictionary <string, StringValues> responseHeaders)
        {
            EnsureArg.IsNotNullOrWhiteSpace(method, nameof(method));
            EnsureArg.IsNotNullOrWhiteSpace(uriString, nameof(uriString));
            EnsureArg.IsNotNullOrWhiteSpace(baseUriString, nameof(baseUriString));
            EnsureArg.IsNotNull(requestType, nameof(requestType));
            EnsureArg.IsNotNullOrWhiteSpace(correlationId, nameof(correlationId));
            EnsureArg.IsNotNull(responseHeaders, nameof(responseHeaders));
            EnsureArg.IsNotNull(requestHeaders, nameof(requestHeaders));

            Method          = method;
            _uriString      = uriString;
            _baseUriString  = baseUriString;
            RequestType     = requestType;
            CorrelationId   = correlationId;
            RequestHeaders  = requestHeaders;
            ResponseHeaders = responseHeaders;
        }
Exemple #4
0
 private void RestoreCodeInfoToPage(CodingInfo codeInfo)
 {
     this.TxtCodeName.Text     = codeInfo.CodeName;
     this.ChkIsDefault.Checked = codeInfo.IsDefault;
     this.ParentCodeList       = codeInfo.ParentCodeList;
     this.TxtSimpleCode.Text   = codeInfo.Owner;
     this.txtXh.Text           = codeInfo.I_xh.ToString();
 }
Exemple #5
0
        public int UpdBasicCode(CodingInfo model)
        {
            int           num     = 0;
            StringBuilder builder = new StringBuilder();

            builder.Append(" begin ");
            if (model.IsDefault)
            {
                builder.Append("update XPM_Basic_CodeList set ");
                builder.Append("IsDefault=0,");
                builder.Append("VersionTime=getdate()");
                builder.Append(" where TypeID=@TypeID AND IsDefault=1 ");
            }
            builder.Append("  update XPM_Basic_CodeList set CodeName=@CodeName ,IsDefault=@IsDefault,VersionTime = getdate(),Owner=@Owner,I_xh=@I_xh ");
            builder.Append(" where CodeID =@CodeID and TypeID =@TypeID1 and IsFixed = 0 ");
            builder.Append("  update XPM_Basic_CodeList set ChildNumber = (select count(1) from XPM_Basic_CodeList  ");
            builder.Append(" where (ParentCodeID=@ParentCodeID1");
            builder.Append(" )and(IsValid = 1)and(TypeID=@TypeID2");
            builder.Append("  )),VersionTime=getdate() ");
            builder.Append(" where (TypeID=@TypeID3");
            builder.Append(" )and(CodeID=@ParentCodeID3)  END");
            if (model.IsDefault)
            {
                SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@TypeID", SqlDbType.Int, 4), new SqlParameter("@CodeName", SqlDbType.VarChar), new SqlParameter("@IsDefault", SqlDbType.Int, 4), new SqlParameter("@CodeID", SqlDbType.Int, 4), new SqlParameter("@TypeID1", SqlDbType.Int, 4), new SqlParameter("@ParentCodeID1", SqlDbType.Int, 4), new SqlParameter("@TypeID2", SqlDbType.Int, 4), new SqlParameter("@TypeID3", SqlDbType.Int, 4), new SqlParameter("@ParentCodeID3", SqlDbType.Int, 4), new SqlParameter("@Owner", SqlDbType.VarChar), new SqlParameter("@I_xh", SqlDbType.Int) };
                commandParameters[0].Value  = model.TypeID;
                commandParameters[1].Value  = model.CodeName;
                commandParameters[2].Value  = model.IsDefault ? 1 : 0;
                commandParameters[3].Value  = model.CodeID;
                commandParameters[4].Value  = model.TypeID;
                commandParameters[5].Value  = model.ParentCodeID;
                commandParameters[6].Value  = model.TypeID;
                commandParameters[7].Value  = model.TypeID;
                commandParameters[8].Value  = model.ParentCodeID;
                commandParameters[9].Value  = model.Owner;
                commandParameters[10].Value = model.I_xh;
                num = publicDbOpClass.ExecuteNonQuery(CommandType.Text, builder.ToString(), commandParameters);
            }
            else
            {
                SqlParameter[] parameterArray2 = new SqlParameter[] { new SqlParameter("@CodeName", SqlDbType.VarChar), new SqlParameter("@IsDefault", SqlDbType.Int, 4), new SqlParameter("@CodeID", SqlDbType.Int, 4), new SqlParameter("@TypeID1", SqlDbType.Int, 4), new SqlParameter("@ParentCodeID1", SqlDbType.Int, 4), new SqlParameter("@TypeID2", SqlDbType.Int, 4), new SqlParameter("@TypeID3", SqlDbType.Int, 4), new SqlParameter("@ParentCodeID3", SqlDbType.Int, 4), new SqlParameter("@Owner", SqlDbType.VarChar), new SqlParameter("@I_xh", SqlDbType.Int) };
                parameterArray2[0].Value = model.CodeName;
                parameterArray2[1].Value = model.IsDefault ? 1 : 0;
                parameterArray2[2].Value = model.CodeID;
                parameterArray2[3].Value = model.TypeID;
                parameterArray2[4].Value = model.ParentCodeID;
                parameterArray2[5].Value = model.TypeID;
                parameterArray2[6].Value = model.TypeID;
                parameterArray2[7].Value = model.ParentCodeID;
                parameterArray2[8].Value = model.Owner;
                parameterArray2[9].Value = model.I_xh;
                num = publicDbOpClass.ExecuteNonQuery(CommandType.Text, builder.ToString(), parameterArray2);
            }
            if (num > 0)
            {
                return(1);
            }
            return(0);
        }
Exemple #6
0
        public int RecycleCode(CodingInfo codingInfo)
        {
            object obj2 = ("" + " begin ") + " update XPM_Basic_CodeList set ParentCodeID = " + codingInfo.ParentCodeID.ToString();

            object[] objArray = new object[] { obj2, " ,ParentCodeList='", codingInfo.ParentCodeList, codingInfo.CodeID, ",',IsDefault=", (codingInfo.IsDefault ? 1 : 0).ToString() };
            string   str2     = string.Concat(objArray) + " ,IsValid = 1,VersionTime = getdate() ";
            string   str3     = (str2 + " where (TypeID = " + codingInfo.TypeID.ToString() + ")and(CodeName='" + codingInfo.CodeName + "')and(IsValid=0)") + " update XPM_Basic_CodeList set ChildNumber = (select count(1) from XPM_Basic_CodeList ";
            string   str4     = str3 + " where (ParentCodeID=" + codingInfo.ParentCodeID.ToString() + ")and(IsValid = 1)and(TypeID=" + codingInfo.TypeID.ToString() + ")),VersionTime=getdate() ";

            return(publicDbOpClass.ExecSqlString((str4 + " where (TypeID=" + codingInfo.TypeID.ToString() + ")and(CodeID=" + codingInfo.ParentCodeID.ToString() + ")") + " end "));
        }
Exemple #7
0
        public CodingInfo QuerySingleCodeInfo(int codeID, int typeID)
        {
            CodingInfo codingInfoFromDataRow = new CodingInfo();

            using (DataTable table = publicDbOpClass.DataTableQuary(" select * from XPM_Basic_CodeList where (CodeID=" + codeID.ToString() + ")and(TypeID=" + typeID.ToString() + ") and (IsVisible=1) "))
            {
                if (table.Rows.Count == 1)
                {
                    codingInfoFromDataRow = this.GetCodingInfoFromDataRow(table.Rows[0]);
                }
            }
            return(codingInfoFromDataRow);
        }
Exemple #8
0
        public int DelBasicCode(int typeID, int CodeID)
        {
            CodingInfo info = this.QuerySingleCodeInfo(CodeID, typeID);

            if (info.IsValid)
            {
                string str  = "";
                string str2 = str + " begin ";
                string str3 = (str2 + " update XPM_Basic_CodeList set IsValid = 0,VersionTime=getdate() where TypeID = " + typeID.ToString() + " and CodeID = " + CodeID.ToString() + " and IsFixed = 0 and IsDefault = 0") + " update XPM_Basic_CodeList set ChildNumber = (select count(1) from XPM_Basic_CodeList ";
                object obj2 = str3 + " where (ParentCodeID=" + info.ParentCodeID.ToString() + ")and(IsValid = 1)and(TypeID=" + typeID.ToString() + ")),VersionTime=getdate() ";
                return(publicDbOpClass.ExecSqlString(string.Concat(new object[] { obj2, " where (TypeID=", typeID, ")and(CodeID=", info.ParentCodeID.ToString(), ")" }) + " end "));
            }
            return(1);
        }
Exemple #9
0
        public int AddBasicCode(CodingInfo model, string _new)
        {
            int           codeMaxID = this.GetCodeMaxID(model.TypeID);
            StringBuilder builder   = new StringBuilder();

            if (string.IsNullOrEmpty(model.SignCode2))
            {
                CodingType type = this.QuerySingleCodingType(model.TypeID);
                if (type != null)
                {
                    model.SignCode2 = type.SignCode;
                }
            }
            builder.Append(" begin \n");
            if (model.IsDefault)
            {
                builder.Append(" update XPM_Basic_CodeList set IsDefault=0, VersionTime=getdate()\n");
                builder.Append(" where TypeID=@TypeID AND IsDefault=1; \n");
            }
            builder.Append(" insert into XPM_Basic_CodeList values( \n");
            builder.Append("\t\t@CodeID,@TypeID1,@ParentCodeID,@ParentCodeList,@CodeName,0,@IsFixed,@IsDefault,1,1,@Owner,getdate(),@I_xh, @SignCode2) \n");
            builder.Append(" update XPM_Basic_CodeList set ChildNumber = (select count(1) from XPM_Basic_CodeList  \n");
            builder.Append(" where (ParentCodeID=@ParentCodeID1 \n");
            builder.Append(" ) and (IsValid = 1) and (TypeID=@TypeID2 \n");
            builder.Append(" )),VersionTime=getdate() \n");
            builder.Append(" where (TypeID=@TypeID3 \n");
            builder.Append(" ) and (CodeID=@ParentCodeID3) \n");
            builder.Append(" end \n");
            int num2 = 0;

            if (model.IsDefault)
            {
                SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@TypeID", model.TypeID), new SqlParameter("@CodeID", codeMaxID), new SqlParameter("@TypeID1", model.TypeID), new SqlParameter("@ParentCodeID", model.ParentCodeID), new SqlParameter("@ParentCodeList", model.ParentCodeList + codeMaxID.ToString() + ","), new SqlParameter("@CodeName", model.CodeName), new SqlParameter("@IsFixed", model.IsFixed ? 1 : 0), new SqlParameter("@IsDefault", model.IsDefault ? 1 : 0), new SqlParameter("@ParentCodeID1", model.ParentCodeID), new SqlParameter("@TypeID2", model.TypeID), new SqlParameter("@TypeID3", model.TypeID), new SqlParameter("@ParentCodeID3", model.ParentCodeID), new SqlParameter("@I_xh", model.I_xh), new SqlParameter("@Owner", model.Owner), new SqlParameter("@SignCode2", model.SignCode2) };
                num2 = publicDbOpClass.ExecuteNonQuery(CommandType.Text, builder.ToString(), commandParameters);
            }
            else
            {
                SqlParameter[] parameterArray2 = new SqlParameter[] { new SqlParameter("@CodeID", codeMaxID), new SqlParameter("@TypeID1", model.TypeID), new SqlParameter("@ParentCodeID", model.ParentCodeID), new SqlParameter("@ParentCodeList", model.ParentCodeList + codeMaxID.ToString() + ","), new SqlParameter("@CodeName", model.CodeName), new SqlParameter("@IsFixed", model.IsFixed ? 1 : 0), new SqlParameter("@IsDefault", model.IsDefault ? 1 : 0), new SqlParameter("@ParentCodeID1", model.ParentCodeID), new SqlParameter("@TypeID2", model.TypeID), new SqlParameter("@TypeID3", model.TypeID), new SqlParameter("@ParentCodeID3", model.ParentCodeID), new SqlParameter("@I_xh", model.I_xh), new SqlParameter("@Owner", model.Owner), new SqlParameter("@SignCode2", model.SignCode2) };
                num2 = publicDbOpClass.ExecuteNonQuery(CommandType.Text, builder.ToString(), parameterArray2);
            }
            if (num2 > 0)
            {
                return(1);
            }
            return(0);
        }
Exemple #10
0
        public CodingInfo QuerySingleCodeInfo(string codeName, int typeID)
        {
            CodingInfo codingInfoFromDataRow = new CodingInfo();
            string     spName = "";

            spName = " select * from XPM_Basic_CodeList where CodeName=@codeName and TypeID=@typeID AND IsValid=1 and IsVisible=1";
            SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@codeName", SqlDbType.VarChar), new SqlParameter("@typeID", SqlDbType.Int, 4) };
            commandParameters[0].Value = codeName;
            commandParameters[1].Value = typeID;
            using (DataTable table = publicDbOpClass.ExecuteDataTable(CommandType.Text, spName, commandParameters))
            {
                if (table.Rows.Count == 1)
                {
                    codingInfoFromDataRow = this.GetCodingInfoFromDataRow(table.Rows[0]);
                }
            }
            return(codingInfoFromDataRow);
        }
Exemple #11
0
        public int AddBasicCode(CodingInfo codingInfo)
        {
            string str       = "";
            int    codeMaxID = this.GetCodeMaxID(codingInfo.TypeID);

            str = str + " begin ";
            if (codingInfo.IsDefault)
            {
                str = str + " update XPM_Basic_CodeList set IsDefault = 0,VersioniTime = getdate() where (TypeID=" + codingInfo.TypeID.ToString() + ")and(IsDefault=1) ";
            }
            string str2 = str;
            string str3 = str2 + " insert into XPM_Basic_CodeList values(" + codeMaxID.ToString() + "," + codingInfo.TypeID.ToString();
            string str4 = str3 + "," + codingInfo.ParentCodeID.ToString() + ",'" + codingInfo.ParentCodeList + codeMaxID.ToString() + ",','" + codingInfo.CodeName;

            string[] strArray3 = new string[] { str4, "',0,", (codingInfo.IsFixed ? 1 : 0).ToString(), ",", (codingInfo.IsDefault ? 1 : 0).ToString(), ",1,1,'000000',getdate())" };
            string   str5      = string.Concat(strArray3) + " update XPM_Basic_CodeList set ChildNumber = (select count(1) from XPM_Basic_CodeList ";
            string   str6      = str5 + " where (ParentCodeID=" + codingInfo.ParentCodeID.ToString() + ")and(IsValid = 1)and(TypeID=" + codingInfo.TypeID.ToString() + ")),VersionTime=getdate() ";

            return(publicDbOpClass.ExecSqlString((str6 + " where (TypeID=" + codingInfo.TypeID.ToString() + ")and(CodeID=" + codingInfo.ParentCodeID.ToString() + ")") + " end "));
        }
Exemple #12
0
        public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
        {
            EnsureArg.IsNotNull(writer, nameof(writer));
            EnsureArg.IsNotNull(serializer, nameof(serializer));

            if (value is Coding obj)
            {
                var newObj = new CodingInfo
                {
                    Coding      = obj.Code,
                    System      = obj.System,
                    DisplayName = obj.Display,
                };

                serializer.Serialize(writer, newObj);
            }
            else
            {
                serializer.Serialize(writer, value);
            }
        }
Exemple #13
0
    private CodingInfo GatherInputInfo()
    {
        CodingInfo codingInfo = new CodingInfo();

        codingInfo.CodeID         = this.CodeID;
        codingInfo.CodeName       = this.TxtCodeName.Text;
        codingInfo.ParentCodeID   = this.ParentCodeID;
        codingInfo.ParentCodeList = this.ParentCodeList;
        codingInfo.IsDefault      = this.ChkIsDefault.Checked;
        codingInfo.TypeID         = this.TypeID;
        codingInfo.SignCode2      = this.GetSingCode(this.TypeID);
        codingInfo.Owner          = this.TxtSimpleCode.Text.Trim();
        if (this.txtXh.Text.Trim() != "")
        {
            codingInfo.I_xh = System.Convert.ToInt32(this.txtXh.Text.Trim());
        }
        else
        {
            codingInfo.I_xh = 0;
        }
        return(codingInfo);
    }
Exemple #14
0
        public static CodeableConcept ToPoco(this CodingInfo model)
        {
            EnsureArg.IsNotNull(model, nameof(model));

            return(new CodeableConcept(model.System, model.Code));
        }
Exemple #15
0
    protected void BtnAdd_Click(object sender, System.EventArgs e)
    {
        int num;

        if (!string.IsNullOrEmpty(this.txtXh.Text.Trim()) && !int.TryParse(this.txtXh.Text.Trim(), out num))
        {
            this.JS.Text = "top.ui.alert('请输入整数类型的序号!');";
            return;
        }
        CodingInfo codingInfo  = this.GatherInputInfo();
        CodingInfo codingInfo2 = new CodingInfo();
        int        num2        = 0;

        if (base.DealType == OpType.Add)
        {
            codingInfo2 = this.CodingAct.QuerySingleCodeInfo(codingInfo.CodeName, codingInfo.TypeID);
            if (codingInfo2.CodeName != "")
            {
                if (codingInfo2.IsValid)
                {
                    this.JS.Text = "top.ui.alert('该编码已存在!')";
                    return;
                }
                codingInfo.CodeID = codingInfo2.CodeID;
                num2 = this.CodingAct.RecycleCode(codingInfo);
            }
            else
            {
                num2 = this.CodingAct.AddBasicCode(codingInfo, "ccd");
            }
        }
        if (base.DealType == OpType.Upd)
        {
            codingInfo2 = this.CodingAct.QuerySingleCodeInfo(codingInfo.CodeName, codingInfo.TypeID);
            if (codingInfo2.CodeName != "")
            {
                if (codingInfo2.CodeID != codingInfo.CodeID)
                {
                    this.JS.Text = "top.ui.alert('该编码已存在!如果没有出现在列表中,那么请重新添加!');";
                    return;
                }
                num2 = this.CodingAct.UpdBasicCode(codingInfo);
            }
            else
            {
                num2 = this.CodingAct.UpdBasicCode(codingInfo);
            }
        }
        if (num2 == 1)
        {
            publicDbOpClass.ExecSqlString(string.Concat(new object[]
            {
                " update XPM_Basic_CodeList set Owner='",
                this.TxtSimpleCode.Text,
                "'  where  CodeID=",
                codingInfo.CodeID,
                "  "
            }));
            this.RegisterScript("top.ui.tabSuccess({ parentName: '_codeedit' });");
            return;
        }
        this.JS.Text = "top.ui.alert('保存失败!');";
    }
Exemple #16
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('保存失败!');";
    }