Ejemplo n.º 1
0
 protected void GetEditICDInfo(int ID_ICD, ref VelocityContext vltContext)
 {
     if (ID_ICD > 0)
     {
         PEIS.Model.DctICDTen model = PEIS.BLL.DctICDTen.Instance.GetModel(ID_ICD);
         if (null != model)
         {
             vltContext.Put("ID_ICD", model.ID_ICD);
             vltContext.Put("ICDCNName", model.ICDCNName);
             vltContext.Put("ICDENName", model.ICDENName);
             vltContext.Put("Code", model.Code);
             vltContext.Put("Codea", model.Codea);
             vltContext.Put("LevelA", model.LevelA);
             vltContext.Put("LevelB", model.LevelB);
             vltContext.Put("LevelC", model.LevelC);
             vltContext.Put("LevelD", model.LevelD);
             vltContext.Put("LevelE", model.LevelE);
             vltContext.Put("LevelTree", model.LevelTree);
             vltContext.Put("Class", model.Class);
             vltContext.Put("Tag", model.Tag);
             vltContext.Put("Note", model.Note);
             vltContext.Put("ICDtoSection", model.ICDtoSection);
             vltContext.Put("Is_Banned", model.Is_Banned);
             vltContext.Put("BanDate", model.BanDate);
             vltContext.Put("BanOperator", model.BanOperator);
             vltContext.Put("BanDescribe", model.BanDescribe);
         }
     }
 }
Ejemplo n.º 2
0
        public int Add(PEIS.Model.DctICDTen model)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("insert into DctICDTen(");
            stringBuilder.Append("ICDCNName,ICDENName,Code,Codea,ID_Creator,Creator,CreateDate,Is_Banned,ID_BanOpr,BanOperator,BanDate,BanDescribe,LevelA,LevelB,LevelC,LevelD,LevelE,LevelTree,Class,Tag,ICDtoSection,Note,InputCode)");
            stringBuilder.Append(" values (");
            stringBuilder.Append("@ICDCNName,@ICDENName,@Code,@Codea,@ID_Creator,@Creator,@CreateDate,@Is_Banned,@ID_BanOpr,@BanOperator,@BanDate,@BanDescribe,@LevelA,@LevelB,@LevelC,@LevelD,@LevelE,@LevelTree,@Class,@Tag,@ICDtoSection,@Note,@InputCode)");
            stringBuilder.Append(";select @@IDENTITY");
            SqlParameter[] array = new SqlParameter[]
            {
                new SqlParameter("@ICDCNName", SqlDbType.VarChar, 100),
                new SqlParameter("@ICDENName", SqlDbType.VarChar, 100),
                new SqlParameter("@Code", SqlDbType.VarChar, 50),
                new SqlParameter("@Codea", SqlDbType.VarChar, 50),
                new SqlParameter("@ID_Creator", SqlDbType.Int, 4),
                new SqlParameter("@Creator", SqlDbType.VarChar, 30),
                new SqlParameter("@CreateDate", SqlDbType.DateTime),
                new SqlParameter("@Is_Banned", SqlDbType.Bit, 1),
                new SqlParameter("@ID_BanOpr", SqlDbType.Int, 4),
                new SqlParameter("@BanOperator", SqlDbType.VarChar, 30),
                new SqlParameter("@BanDate", SqlDbType.DateTime),
                new SqlParameter("@BanDescribe", SqlDbType.VarChar, 100),
                new SqlParameter("@LevelA", SqlDbType.Int, 4),
                new SqlParameter("@LevelB", SqlDbType.Int, 4),
                new SqlParameter("@LevelC", SqlDbType.Int, 4),
                new SqlParameter("@LevelD", SqlDbType.Int, 4),
                new SqlParameter("@LevelE", SqlDbType.Int, 4),
                new SqlParameter("@LevelTree", SqlDbType.Int, 4),
                new SqlParameter("@Class", SqlDbType.VarChar, 50),
                new SqlParameter("@Tag", SqlDbType.VarChar, 50),
                new SqlParameter("@ICDtoSection", SqlDbType.VarChar, 100),
                new SqlParameter("@Note", SqlDbType.VarChar, 100),
                new SqlParameter("@InputCode", SqlDbType.VarChar, 50)
            };
            array[0].Value  = model.ICDCNName;
            array[1].Value  = model.ICDENName;
            array[2].Value  = model.Code;
            array[3].Value  = model.Codea;
            array[4].Value  = model.ID_Creator;
            array[5].Value  = model.Creator;
            array[6].Value  = model.CreateDate;
            array[7].Value  = model.Is_Banned;
            array[8].Value  = model.ID_BanOpr;
            array[9].Value  = model.BanOperator;
            array[10].Value = model.BanDate;
            array[11].Value = model.BanDescribe;
            array[12].Value = model.LevelA;
            array[13].Value = model.LevelB;
            array[14].Value = model.LevelC;
            array[15].Value = model.LevelD;
            array[16].Value = model.LevelE;
            array[17].Value = model.LevelTree;
            array[18].Value = model.Class;
            array[19].Value = model.Tag;
            array[20].Value = model.ICDtoSection;
            array[21].Value = model.Note;
            array[22].Value = model.InputCode;
            object single = DbHelperSQL.GetSingle(stringBuilder.ToString(), array);
            int    result;

            if (single == null)
            {
                result = 0;
            }
            else
            {
                result = Convert.ToInt32(single);
            }
            return(result);
        }
Ejemplo n.º 3
0
        public PEIS.Model.DctICDTen GetModel(int ID_ICD)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("select  top 1 ID_ICD,ICDCNName,ICDENName,Code,Codea,ID_Creator,Creator,CreateDate,Is_Banned,ID_BanOpr,BanOperator,BanDate,BanDescribe,LevelA,LevelB,LevelC,LevelD,LevelE,LevelTree,Class,Tag,ICDtoSection,Note,InputCode from DctICDTen ");
            stringBuilder.Append(" where ID_ICD=@ID_ICD");
            SqlParameter[] array = new SqlParameter[]
            {
                new SqlParameter("@ID_ICD", SqlDbType.Int, 4)
            };
            array[0].Value = ID_ICD;
            PEIS.Model.DctICDTen dctICDTen = new PEIS.Model.DctICDTen();
            DataSet dataSet = DbHelperSQL.Query(stringBuilder.ToString(), array);

            PEIS.Model.DctICDTen result;
            if (dataSet.Tables[0].Rows.Count > 0)
            {
                if (dataSet.Tables[0].Rows[0]["ID_ICD"].ToString() != "")
                {
                    dctICDTen.ID_ICD = int.Parse(dataSet.Tables[0].Rows[0]["ID_ICD"].ToString());
                }
                dctICDTen.ICDCNName = dataSet.Tables[0].Rows[0]["ICDCNName"].ToString();
                dctICDTen.ICDENName = dataSet.Tables[0].Rows[0]["ICDENName"].ToString();
                dctICDTen.Code      = dataSet.Tables[0].Rows[0]["Code"].ToString();
                dctICDTen.Codea     = dataSet.Tables[0].Rows[0]["Codea"].ToString();
                if (dataSet.Tables[0].Rows[0]["ID_Creator"].ToString() != "")
                {
                    dctICDTen.ID_Creator = new int?(int.Parse(dataSet.Tables[0].Rows[0]["ID_Creator"].ToString()));
                }
                dctICDTen.Creator = dataSet.Tables[0].Rows[0]["Creator"].ToString();
                if (dataSet.Tables[0].Rows[0]["CreateDate"].ToString() != "")
                {
                    dctICDTen.CreateDate = new DateTime?(DateTime.Parse(dataSet.Tables[0].Rows[0]["CreateDate"].ToString()));
                }
                if (dataSet.Tables[0].Rows[0]["Is_Banned"].ToString() != "")
                {
                    if (dataSet.Tables[0].Rows[0]["Is_Banned"].ToString() == "1" || dataSet.Tables[0].Rows[0]["Is_Banned"].ToString().ToLower() == "true")
                    {
                        dctICDTen.Is_Banned = new bool?(true);
                    }
                    else
                    {
                        dctICDTen.Is_Banned = new bool?(false);
                    }
                }
                if (dataSet.Tables[0].Rows[0]["ID_BanOpr"].ToString() != "")
                {
                    dctICDTen.ID_BanOpr = new int?(int.Parse(dataSet.Tables[0].Rows[0]["ID_BanOpr"].ToString()));
                }
                dctICDTen.BanOperator = dataSet.Tables[0].Rows[0]["BanOperator"].ToString();
                if (dataSet.Tables[0].Rows[0]["BanDate"].ToString() != "")
                {
                    dctICDTen.BanDate = new DateTime?(DateTime.Parse(dataSet.Tables[0].Rows[0]["BanDate"].ToString()));
                }
                dctICDTen.BanDescribe = dataSet.Tables[0].Rows[0]["BanDescribe"].ToString();
                if (dataSet.Tables[0].Rows[0]["LevelA"].ToString() != "")
                {
                    dctICDTen.LevelA = new int?(int.Parse(dataSet.Tables[0].Rows[0]["LevelA"].ToString()));
                }
                if (dataSet.Tables[0].Rows[0]["LevelB"].ToString() != "")
                {
                    dctICDTen.LevelB = new int?(int.Parse(dataSet.Tables[0].Rows[0]["LevelB"].ToString()));
                }
                if (dataSet.Tables[0].Rows[0]["LevelC"].ToString() != "")
                {
                    dctICDTen.LevelC = new int?(int.Parse(dataSet.Tables[0].Rows[0]["LevelC"].ToString()));
                }
                if (dataSet.Tables[0].Rows[0]["LevelD"].ToString() != "")
                {
                    dctICDTen.LevelD = new int?(int.Parse(dataSet.Tables[0].Rows[0]["LevelD"].ToString()));
                }
                if (dataSet.Tables[0].Rows[0]["LevelE"].ToString() != "")
                {
                    dctICDTen.LevelE = new int?(int.Parse(dataSet.Tables[0].Rows[0]["LevelE"].ToString()));
                }
                if (dataSet.Tables[0].Rows[0]["LevelTree"].ToString() != "")
                {
                    dctICDTen.LevelTree = new int?(int.Parse(dataSet.Tables[0].Rows[0]["LevelTree"].ToString()));
                }
                dctICDTen.Class        = dataSet.Tables[0].Rows[0]["Class"].ToString();
                dctICDTen.Tag          = dataSet.Tables[0].Rows[0]["Tag"].ToString();
                dctICDTen.ICDtoSection = dataSet.Tables[0].Rows[0]["ICDtoSection"].ToString();
                dctICDTen.Note         = dataSet.Tables[0].Rows[0]["Note"].ToString();
                dctICDTen.InputCode    = dataSet.Tables[0].Rows[0]["InputCode"].ToString();
                result = dctICDTen;
            }
            else
            {
                result = null;
            }
            return(result);
        }
Ejemplo n.º 4
0
        public bool Update(PEIS.Model.DctICDTen model)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("update DctICDTen set ");
            stringBuilder.Append("ICDCNName=@ICDCNName,");
            stringBuilder.Append("ICDENName=@ICDENName,");
            stringBuilder.Append("Code=@Code,");
            stringBuilder.Append("Codea=@Codea,");
            stringBuilder.Append("ID_Creator=@ID_Creator,");
            stringBuilder.Append("Creator=@Creator,");
            stringBuilder.Append("CreateDate=@CreateDate,");
            stringBuilder.Append("Is_Banned=@Is_Banned,");
            stringBuilder.Append("ID_BanOpr=@ID_BanOpr,");
            stringBuilder.Append("BanOperator=@BanOperator,");
            stringBuilder.Append("BanDate=@BanDate,");
            stringBuilder.Append("BanDescribe=@BanDescribe,");
            stringBuilder.Append("LevelA=@LevelA,");
            stringBuilder.Append("LevelB=@LevelB,");
            stringBuilder.Append("LevelC=@LevelC,");
            stringBuilder.Append("LevelD=@LevelD,");
            stringBuilder.Append("LevelE=@LevelE,");
            stringBuilder.Append("LevelTree=@LevelTree,");
            stringBuilder.Append("Class=@Class,");
            stringBuilder.Append("Tag=@Tag,");
            stringBuilder.Append("ICDtoSection=@ICDtoSection,");
            stringBuilder.Append("Note=@Note,");
            stringBuilder.Append("InputCode=@InputCode");
            stringBuilder.Append(" where ID_ICD=@ID_ICD");
            SqlParameter[] array = new SqlParameter[]
            {
                new SqlParameter("@ICDCNName", SqlDbType.VarChar, 100),
                new SqlParameter("@ICDENName", SqlDbType.VarChar, 100),
                new SqlParameter("@Code", SqlDbType.VarChar, 50),
                new SqlParameter("@Codea", SqlDbType.VarChar, 50),
                new SqlParameter("@ID_Creator", SqlDbType.Int, 4),
                new SqlParameter("@Creator", SqlDbType.VarChar, 30),
                new SqlParameter("@CreateDate", SqlDbType.DateTime),
                new SqlParameter("@Is_Banned", SqlDbType.Bit, 1),
                new SqlParameter("@ID_BanOpr", SqlDbType.Int, 4),
                new SqlParameter("@BanOperator", SqlDbType.VarChar, 30),
                new SqlParameter("@BanDate", SqlDbType.DateTime),
                new SqlParameter("@BanDescribe", SqlDbType.VarChar, 100),
                new SqlParameter("@LevelA", SqlDbType.Int, 4),
                new SqlParameter("@LevelB", SqlDbType.Int, 4),
                new SqlParameter("@LevelC", SqlDbType.Int, 4),
                new SqlParameter("@LevelD", SqlDbType.Int, 4),
                new SqlParameter("@LevelE", SqlDbType.Int, 4),
                new SqlParameter("@LevelTree", SqlDbType.Int, 4),
                new SqlParameter("@Class", SqlDbType.VarChar, 50),
                new SqlParameter("@Tag", SqlDbType.VarChar, 50),
                new SqlParameter("@ICDtoSection", SqlDbType.VarChar, 100),
                new SqlParameter("@Note", SqlDbType.VarChar, 100),
                new SqlParameter("@InputCode", SqlDbType.VarChar, 50),
                new SqlParameter("@ID_ICD", SqlDbType.Int, 4)
            };
            array[0].Value  = model.ICDCNName;
            array[1].Value  = model.ICDENName;
            array[2].Value  = model.Code;
            array[3].Value  = model.Codea;
            array[4].Value  = model.ID_Creator;
            array[5].Value  = model.Creator;
            array[6].Value  = model.CreateDate;
            array[7].Value  = model.Is_Banned;
            array[8].Value  = model.ID_BanOpr;
            array[9].Value  = model.BanOperator;
            array[10].Value = model.BanDate;
            array[11].Value = model.BanDescribe;
            array[12].Value = model.LevelA;
            array[13].Value = model.LevelB;
            array[14].Value = model.LevelC;
            array[15].Value = model.LevelD;
            array[16].Value = model.LevelE;
            array[17].Value = model.LevelTree;
            array[18].Value = model.Class;
            array[19].Value = model.Tag;
            array[20].Value = model.ICDtoSection;
            array[21].Value = model.Note;
            array[22].Value = model.InputCode;
            array[23].Value = model.ID_ICD;
            int num = DbHelperSQL.ExecuteSql(stringBuilder.ToString(), array);

            return(num > 0);
        }
Ejemplo n.º 5
0
 public int SaveICD(PEIS.Model.DctICDTen ICDTenModel)
 {
     return(CommonConfig.dal.SaveICD(ICDTenModel));
 }
Ejemplo n.º 6
0
        public List <PEIS.Model.DctICDTen> DataTableToList(DataTable dt)
        {
            List <PEIS.Model.DctICDTen> list = new List <PEIS.Model.DctICDTen>();
            int count = dt.Rows.Count;

            if (count > 0)
            {
                for (int i = 0; i < count; i++)
                {
                    PEIS.Model.DctICDTen dctICDTen = new PEIS.Model.DctICDTen();
                    if (dt.Rows[i]["ID_ICD"].ToString() != "")
                    {
                        dctICDTen.ID_ICD = int.Parse(dt.Rows[i]["ID_ICD"].ToString());
                    }
                    dctICDTen.ICDCNName = dt.Rows[i]["ICDCNName"].ToString();
                    dctICDTen.ICDENName = dt.Rows[i]["ICDENName"].ToString();
                    dctICDTen.Code      = dt.Rows[i]["Code"].ToString();
                    dctICDTen.Codea     = dt.Rows[i]["Codea"].ToString();
                    if (dt.Rows[i]["ID_Creator"].ToString() != "")
                    {
                        dctICDTen.ID_Creator = new int?(int.Parse(dt.Rows[i]["ID_Creator"].ToString()));
                    }
                    dctICDTen.Creator = dt.Rows[i]["Creator"].ToString();
                    if (dt.Rows[i]["CreateDate"].ToString() != "")
                    {
                        dctICDTen.CreateDate = new DateTime?(DateTime.Parse(dt.Rows[i]["CreateDate"].ToString()));
                    }
                    if (dt.Rows[i]["Is_Banned"].ToString() != "")
                    {
                        if (dt.Rows[i]["Is_Banned"].ToString() == "1" || dt.Rows[i]["Is_Banned"].ToString().ToLower() == "true")
                        {
                            dctICDTen.Is_Banned = new bool?(true);
                        }
                        else
                        {
                            dctICDTen.Is_Banned = new bool?(false);
                        }
                    }
                    if (dt.Rows[i]["ID_BanOpr"].ToString() != "")
                    {
                        dctICDTen.ID_BanOpr = new int?(int.Parse(dt.Rows[i]["ID_BanOpr"].ToString()));
                    }
                    dctICDTen.BanOperator = dt.Rows[i]["BanOperator"].ToString();
                    if (dt.Rows[i]["BanDate"].ToString() != "")
                    {
                        dctICDTen.BanDate = new DateTime?(DateTime.Parse(dt.Rows[i]["BanDate"].ToString()));
                    }
                    dctICDTen.BanDescribe = dt.Rows[i]["BanDescribe"].ToString();
                    if (dt.Rows[i]["LevelA"].ToString() != "")
                    {
                        dctICDTen.LevelA = new int?(int.Parse(dt.Rows[i]["LevelA"].ToString()));
                    }
                    if (dt.Rows[i]["LevelB"].ToString() != "")
                    {
                        dctICDTen.LevelB = new int?(int.Parse(dt.Rows[i]["LevelB"].ToString()));
                    }
                    if (dt.Rows[i]["LevelC"].ToString() != "")
                    {
                        dctICDTen.LevelC = new int?(int.Parse(dt.Rows[i]["LevelC"].ToString()));
                    }
                    if (dt.Rows[i]["LevelD"].ToString() != "")
                    {
                        dctICDTen.LevelD = new int?(int.Parse(dt.Rows[i]["LevelD"].ToString()));
                    }
                    if (dt.Rows[i]["LevelE"].ToString() != "")
                    {
                        dctICDTen.LevelE = new int?(int.Parse(dt.Rows[i]["LevelE"].ToString()));
                    }
                    if (dt.Rows[i]["LevelTree"].ToString() != "")
                    {
                        dctICDTen.LevelTree = new int?(int.Parse(dt.Rows[i]["LevelTree"].ToString()));
                    }
                    dctICDTen.Class        = dt.Rows[i]["Class"].ToString();
                    dctICDTen.Tag          = dt.Rows[i]["Tag"].ToString();
                    dctICDTen.ICDtoSection = dt.Rows[i]["ICDtoSection"].ToString();
                    dctICDTen.Note         = dt.Rows[i]["Note"].ToString();
                    dctICDTen.InputCode    = dt.Rows[i]["InputCode"].ToString();
                    list.Add(dctICDTen);
                }
            }
            return(list);
        }
Ejemplo n.º 7
0
 public bool Update(PEIS.Model.DctICDTen model)
 {
     return(this.dal.Update(model));
 }
Ejemplo n.º 8
0
 public int Add(PEIS.Model.DctICDTen model)
 {
     return(this.dal.Add(model));
 }