Example #1
0
        public void InitEveryThing()
        {
            ListModel   = new List <ConsulationDoctorsModel>();
            ConModel    = new ConsulationBaseInfoModel();
            ConDocModel = new ConsulationDoctorsModel();
            if (!string.IsNullOrEmpty(this.IDCardNo))
            {
                this.Model = new RecordsBaseInfoBLL().GetModel(this.IDCardNo);
            }
            this.lbAddress.Text        = this.Model.Address;
            this.lbName.Text           = this.Model.CustomerName;
            this.lbIDCard.Text         = this.Model.IDCardNo;
            this.tbCreateMenName.Text  = this.Model.CreateMenName;
            this.tbCreateUnitName.Text = this.Model.CreateUnitName;
            this.dtpCreatTime.Text     = this.Model.CreateDate.Value.ToString();
            if (this.Model.Sex == "1")
            {
                this.lbSex.Text = "男";
            }
            else if (this.Model.Sex == "2")
            {
                this.lbSex.Text = "女";
            }


            this.ConModel.IDCardNo = lbIDCard.Text;
            this.EveryThingIsOk    = true;
        }
        public ConsulationBaseInfoModel DataRowToModel(DataRow row)
        {
            ConsulationBaseInfoModel ConsulationModel = new ConsulationBaseInfoModel();

            if (row != null)
            {
                if (((row["ID"] != null) && (row["ID"] != DBNull.Value)) && (row["ID"].ToString() != ""))
                {
                    ConsulationModel.ID = int.Parse(row["ID"].ToString());
                }
                if ((row["Sex"] != null) && (row["Sex"] != DBNull.Value))
                {
                    ConsulationModel.Sex = row["Sex"].ToString();
                }
                if (((row["IDCardNo"] != null) && (row["IDCardNo"] != DBNull.Value)))
                {
                    ConsulationModel.IDCardNo = row["IDCardNo"].ToString();
                }
                if ((row["CustomerName"] != null) && (row["CustomerName"] != DBNull.Value))
                {
                    ConsulationModel.CustomerName = row["CustomerName"].ToString();
                }
                if ((row["Address"] != null) && (row["Address"] != DBNull.Value))
                {
                    ConsulationModel.Address = row["Address"].ToString();
                }
                if ((row["Reason"] != null) && (row["Reason"] != DBNull.Value))
                {
                    ConsulationModel.Reason = row["Reason"].ToString();
                }
                if ((row["View"] != null) && (row["View"] != DBNull.Value))
                {
                    ConsulationModel.View = row["View"].ToString();
                }
                if ((row["CreateUnitName"] != null) && (row["CreateUnitName"] != DBNull.Value))
                {
                    ConsulationModel.CreateUnitName = row["CreateUnitName"].ToString();
                }
                if ((row["ResponsibilityDoctor"] != null) && (row["ResponsibilityDoctor"] != DBNull.Value))
                {
                    ConsulationModel.ResponsibilityDoctor = row["ResponsibilityDoctor"].ToString();
                }
                if ((row["CreateMenName"] != null) && (row["CreateMenName"] != DBNull.Value))
                {
                    ConsulationModel.CreateMenName = row["CreateMenName"].ToString();
                }
                if (((row["ConsultationDate"] != null) && (row["ConsultationDate"] != DBNull.Value)) && (row["ConsultationDate"].ToString() != ""))
                {
                    ConsulationModel.ConsultationDate = DateTime.Parse(row["ConsultationDate"].ToString());
                }
                if (((row["CreateDate"] != null) && (row["CreateDate"] != DBNull.Value)) && (row["CreateDate"].ToString() != ""))
                {
                    ConsulationModel.CreateTime = DateTime.Parse(row["CreateDate"].ToString());
                }
            }

            return(ConsulationModel);
        }
Example #3
0
        private void ConsulateModify_Load(object sender, EventArgs e)
        {
            consulateModel = new ConsulationBaseInfoBLL().GetModel(this.ID);
            string strWhere = string.Format("OutKey={0}", this.ID);

            doctorSet = new ConsulationDoctorsBLL().GetList(strWhere);
            if (!this.EveryThingIsOk)
            {
                InitEveryThing();
            }
        }
        public int AddServer(ConsulationBaseInfoModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("insert into ARCHIVE_CONSULTATION_RECORD(");
            builder.Append("IDCardNo,Reason,View,ResponsibilityDoctor,ConsultationDate,UpdateUnitName,UpdatePerson,UpdateDate)");
            builder.Append("values (");
            builder.Append("@IDCardNo,@Reason,@View,@ResponsibilityDoctor,@ConsultationDate,@UpdateUnitName,@UpdatePerson,@UpdateDate)");
            builder.Append(";select @@IDENTITY");

            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@IDCardNo", MySqlDbType.String, 18),
                new MySqlParameter("@Reason", MySqlDbType.String, 100),
                new MySqlParameter("@View", MySqlDbType.String, 100),
                new MySqlParameter("@ResponsibilityDoctor", MySqlDbType.String, 100),
                new MySqlParameter("@ConsultationDate", MySqlDbType.Date),
                new MySqlParameter("@UpdateUnitName", MySqlDbType.String, 100),
                new MySqlParameter("@UpdatePerson", MySqlDbType.String, 100),
                new MySqlParameter("@UpdateDate", MySqlDbType.Date)
            };
            cmdParms[0].Value = model.IDCardNo;
            cmdParms[1].Value = model.Reason;
            cmdParms[2].Value = model.View;
            cmdParms[3].Value = model.ResponsibilityDoctor;
            cmdParms[4].Value = model.ConsultationDate;
            cmdParms[5].Value = model.UpdateUnitName;
            cmdParms[6].Value = model.UpdatePerson;
            cmdParms[7].Value = model.UpdateDate;

            object single = MySQLHelper.GetSingleServer(builder.ToString(), cmdParms);

            if (single == null)
            {
                return(0);
            }
            return(Convert.ToInt32(single));
        }
        public bool Update(ConsulationBaseInfoModel model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("update ARCHIVE_CONSULTATION_RECORD set ");
            builder.Append("IDCardNo=@IDCardNo,");
            builder.Append("Reason=@Reason,");
            builder.Append("View=@View,");
            builder.Append("ResponsibilityDoctor=@ResponsibilityDoctor,");
            builder.Append("ConsultationDate=@ConsultationDate,");
            builder.Append("UpdateUnitName=@UpdateUnitName,");
            builder.Append("UpdatePerson=@UpdatePerson,");
            builder.Append("UpdateDate=@UpdateDate");
            builder.Append(" where ID=@ID");
            MySqlParameter[] cmdParms = new MySqlParameter[] {
                new MySqlParameter("@IDCardNo", MySqlDbType.String, 18),
                new MySqlParameter("@Reason", MySqlDbType.String, 1000),
                new MySqlParameter("@View", MySqlDbType.String, 1000),
                new MySqlParameter("@ResponsibilityDoctor", MySqlDbType.String, 100),
                new MySqlParameter("@ConsultationDate", MySqlDbType.DateTime),
                new MySqlParameter("@UpdateUnitName", MySqlDbType.String, 100),
                new MySqlParameter("@UpdatePerson", MySqlDbType.String, 100),
                new MySqlParameter("@UpdateDate", MySqlDbType.Date),
                new MySqlParameter("@ID", MySqlDbType.Int32, 8)
            };
            cmdParms[0].Value = model.IDCardNo;
            cmdParms[1].Value = model.Reason;
            cmdParms[2].Value = model.View;
            cmdParms[3].Value = model.ResponsibilityDoctor;
            cmdParms[4].Value = model.ConsultationDate;
            cmdParms[5].Value = model.UpdateUnitName;
            cmdParms[6].Value = model.UpdatePerson;
            cmdParms[7].Value = model.UpdateDate;
            cmdParms[8].Value = model.ID;
            return(MySQLHelper.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
Example #6
0
 public bool Update(ConsulationBaseInfoModel model)
 {
     return(this.dal.Update(model));
 }
Example #7
0
 public int Add(ConsulationBaseInfoModel model)
 {
     return(this.dal.Add(model));
 }