/// <summary>
        /// 新增
        /// </summary>
        /// <returns></returns>
        private int Insert()
        {
            List <children_tcm_record> infolist = GetData();
            List <DBSql> hb = new List <DBSql>();

            foreach (children_tcm_record info in infolist)
            {
                DBSql sqls = new DBSql();
                sqls.sql        = @"insert into children_tcm_record(id,name,aichive_no,id_number,age,visit_date,tcm_info,tcm_other,next_visit_date,visit_doctor,create_user,create_name,create_time,create_org,create_org_name,upload_status
) values(@id,@name,@aichive_no,@id_number,@age,@visit_date,@tcm_info,@tcm_other,@next_visit_date,@visit_doctor,@create_user,@create_name,@create_time,@create_org,@create_org_name,@upload_status);";
                sqls.parameters = new MySqlParameter[] {
                    new MySqlParameter("@id", info.id),
                    new MySqlParameter("@name", info.name),
                    new MySqlParameter("@aichive_no", info.aichive_no),
                    new MySqlParameter("@id_number", info.id_number),
                    new MySqlParameter("@visit_date", info.visit_date),
                    new MySqlParameter("@age", info.age),
                    new MySqlParameter("@tcm_info", info.tcm_info),
                    new MySqlParameter("@tcm_other", info.tcm_other),
                    new MySqlParameter("@next_visit_date", info.next_visit_date),
                    new MySqlParameter("@visit_doctor", info.visit_doctor),
                    new MySqlParameter("@create_user", info.create_user),
                    new MySqlParameter("@create_name", info.create_name),
                    new MySqlParameter("@create_time", info.create_time),
                    new MySqlParameter("@create_org", info.create_org),
                    new MySqlParameter("@create_org_name", info.create_org_name),
                    new MySqlParameter("@upload_status", info.upload_status),
                };
                hb.Add(sqls);
            }
            return(DbHelperMySQL.ExecuteSqlTran(hb));
        }
Пример #2
0
        private PaymentModeActionStatus DeletePaymentMode(PaymentModeInfo paymentMode)
        {
            List <CommandInfo> sqllist = new List <CommandInfo>();

            StringBuilder strSql1 = new StringBuilder();

            strSql1.AppendFormat(" DELETE FROM Pay_PaymentCurrencys WHERE ModeId= {0} ;", paymentMode.ModeId);
            MySqlParameter[] parameters1 =
            {
            };
            sqllist.Add(new CommandInfo(strSql1.ToString(), parameters1, EffentNextType.ExcuteEffectRows));

            StringBuilder strSql2 = new StringBuilder();

            strSql2.AppendFormat(" DELETE FROM Pay_PaymentTypes WHERE ModeId = {0} ;", paymentMode.ModeId);
            MySqlParameter[] parameters2 =
            {
            };
            sqllist.Add(new CommandInfo(strSql2.ToString(), parameters2, EffentNextType.ExcuteEffectRows));

            int count = DbHelperMySQL.ExecuteSqlTran(sqllist);

            if (count != 2)
            {
                return(PaymentModeActionStatus.UnknowError);
            }
            return(PaymentModeActionStatus.Success);
        }
Пример #3
0
        /// <summary>
        /// 删除考核规则、项目、标准
        /// </summary>
        public bool DeleteRSS(string id)
        {
            List <string> strSqlList = new List <string>();
            string        strSql     = string.Empty;

            strSql = string.Format(@" delete from ims_check_rule where id in (" + id + ")");
            strSqlList.Add(strSql);

            strSql = string.Format(@" delete from ims_check_task where rule_id in (" + id + ")");
            strSqlList.Add(strSql);

            strSql = string.Format(@" delete from ims_check_task_standard where rule_id in (" + id + ")");
            strSqlList.Add(strSql);

            int rows = DbHelperMySQL.ExecuteSqlTran(strSqlList);

            if (rows >= 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #4
0
        //增加任务及标准
        public bool AddStandard(int task_id, DataTable dt)
        {
            List <string> strSqlList = new List <string>();
            string        strSql     = string.Empty;

            if (dt != null && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    strSql = string.Format(@"insert into ims_check_task_standard(task_id,standard_name,standard_score,standard_remarks) values ('{0}','{1}','{2}','{3}')",

                                           task_id, dt.Rows[i]["standard"].ToString(), Convert.ToDecimal(dt.Rows[i]["standardScore"]), "");

                    strSqlList.Add(strSql);
                }
            }

            int rows = DbHelperMySQL.ExecuteSqlTran(strSqlList);

            if (rows >= 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #5
0
        /// <summary>
        /// 更新一组数据完成状态
        /// </summary>
        public bool UpdateOKRSStatus(XHD.Model.crm_task_okrs model, string Idlist)
        {
            List <string> strSqlList = new List <string>();
            string        strSql     = string.Empty;
            DataSet       dtokrs     = GetList(" Id in (" + Idlist + ")");

            if (dtokrs != null && dtokrs.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < dtokrs.Tables[0].Rows.Count; i++)
                {
                    if (dtokrs.Tables[0].Rows[i]["task_status_name"].ToString() != "已完成" || dtokrs.Tables[0].Rows[i]["real_time"].ToString() == "0")
                    {
                        strSql = string.Format(@"Update crm_task_okrs set task_status_name='{0}',task_status_id='{1}',update_id='{2}',update_name='{3}',update_time='{4}',real_time='{5}' where Id ='{6}'",
                                               model.task_status_name, model.task_status_id, model.update_id, model.update_name, model.update_time, model.update_time, dtokrs.Tables[0].Rows[i]["Id"].ToString());
                        strSqlList.Add(strSql);
                    }
                }
            }
            int rows = DbHelperMySQL.ExecuteSqlTran(strSqlList);

            if (rows >= 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #6
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool UpdateContact(XHD.Model.CRM_Contact model, int userId)
        {
            List <string> strSqlList = new List <string>();
            string        strSql     = string.Empty;

            //修改crm联系人的电话
            strSql = string.Format(@" Update CRM_Contact set C_name='{0}',C_sex='{1}',C_department='{2}',C_position='{3}',C_birthday='{4}',C_tel='{5}',C_fax='{6}',C_email='{7}',
                                                             C_mobone='{8}',C_mobtwo='{9}',C_QQ='{10}',C_add='{11}',C_hobby='{12}',C_remarks='{13}',C_customerid='{14}',
                                                             C_customername='{15}',C_extentel='{16}' where id='{17}'",
                                   model.C_name, model.C_sex, model.C_department, model.C_position, model.C_birthday, model.C_tel, model.C_fax, model.C_email,
                                   model.C_mobone, model.C_mobtwo, model.C_QQ, model.C_add, model.C_hobby, model.C_remarks, model.C_customerid,
                                   model.C_customername, model.C_extentel, model.id);

            strSqlList.Add(strSql);

            //修改商城

            strSql = string.Format(@" update ecs_users set user_name='{0}' where user_id='{1}'", model.C_tel, userId);
            strSqlList.Add(strSql);

            int rows = DbHelperMySQL.ExecuteSqlTran(strSqlList);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <returns></returns>
        private int Update()
        {
            List <children_tcm_record> infolist = GetData();
            List <DBSql> hb = new List <DBSql>();

            foreach (children_tcm_record info in infolist)
            {
                DBSql sqls = new DBSql();
                sqls.sql        = @"update children_tcm_record set upload_status=0,visit_date=@visit_date,tcm_info=@tcm_info,tcm_other=@tcm_other,next_visit_date=@next_visit_date,visit_doctor=@visit_doctor,update_user=@update_user,update_name=@update_name,update_time=@update_time where name=@name and aichive_no=@aichive_no and id_number=@id_number and age=@age;";
                sqls.parameters = new MySqlParameter[] {
                    new MySqlParameter("@id", info.id),
                    new MySqlParameter("@name", info.name),
                    new MySqlParameter("@aichive_no", info.aichive_no),
                    new MySqlParameter("@id_number", info.id_number),
                    new MySqlParameter("@visit_date", info.visit_date),
                    new MySqlParameter("@age", info.age),
                    new MySqlParameter("@tcm_info", info.tcm_info),
                    new MySqlParameter("@tcm_other", info.tcm_other),
                    new MySqlParameter("@next_visit_date", info.next_visit_date),
                    new MySqlParameter("@visit_doctor", info.visit_doctor),
                    new MySqlParameter("@update_user", info.update_user),
                    new MySqlParameter("@update_name", info.update_name),
                    new MySqlParameter("@update_time", info.update_time),
                };
                hb.Add(sqls);
            }
            return(DbHelperMySQL.ExecuteSqlTran(hb));
        }
Пример #8
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Insert(XHD.Model.crm_customer_handnum modelhandnum, XHD.Model.CRM_Customer model)
        {
            List <string> strSqlList = new List <string>();
            string        strSql     = string.Empty;
            string        strWhere   = string.Empty;

            //1.更新crm_customer_handnum:更新上一条记录的结束时间
            strSql = string.Format(@"update crm_customer_handnum set  End_date='{0}'  where id= (select max( bb1.id ) as a1 from  (select id,Factory_Id,customer_id from  crm_customer_handnum) as bb1 where bb1.customer_id='{1}') ",
                                   modelhandnum.Start_date, modelhandnum.customer_id);

            strSqlList.Add(strSql);

            //2.crm_customer_handnum:保存新的更新记录
            strSql = string.Format(@" INSERT INTO crm_customer_handnum(Factory_Id,customer_id,customer,BeSeats_id_old,BeSeats_old,BeSeats_uid_old,BeSeats_depid_old,BeSeats_depname_old,
                                      emp_id,emp_uid,emp_name,Start_date,End_date,operation_emp_id,operation_emp_uid,operation_emp_name)
                                      VALUES ('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}', '{8}', '{9}', '{10}','{11}','{12}','{13}','{14}','{15}')",
                                   modelhandnum.Factory_Id, modelhandnum.customer_id, modelhandnum.customer, modelhandnum.BeSeats_id_old, modelhandnum.BeSeats_old,
                                   modelhandnum.BeSeats_uid_old, modelhandnum.BeSeats_depid_old, modelhandnum.BeSeats_depname_old, modelhandnum.emp_id, modelhandnum.emp_uid,
                                   modelhandnum.emp_name, modelhandnum.Start_date, modelhandnum.Start_date, modelhandnum.operation_emp_id, modelhandnum.operation_emp_uid, modelhandnum.operation_emp_name);
            strSqlList.Add(strSql);

            int rows = DbHelperMySQL.ExecuteSqlTran(strSqlList);

            if (rows >= 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #9
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(MultiColorPen.Model.sys_menuinfo model, List <string> btncode)
        {
            List <CommandInfo> cmd_list = new List <CommandInfo>();
            StringBuilder      strSql   = new StringBuilder();

            strSql.Append("insert into sys_menuinfo(");
            strSql.Append("pmenucode,menucode,menuname,linkaddress,menuicon,menusort,isenable,createtime,createman,updatetime,updateman)");
            strSql.Append(" values (");
            strSql.Append("'{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}')");
            strSql.Append(";");
            string sql = "";

            if (model.updatetime != null)
            {
                sql = string.Format(strSql.ToString(), model.pmenucode, model.menucode, model.menuname, model.linkaddress, model.menuicon, model.menusort, model.isenable, model.createtime, model.createman, model.updatetime, model.updateman);
            }
            else
            {
                StringBuilder strSql1 = new StringBuilder();
                strSql1.Append("insert into sys_menuinfo(");
                strSql1.Append("pmenucode,menucode,menuname,linkaddress,menuicon,menusort,isenable,createtime,createman)");
                strSql1.Append(" values (");
                strSql1.Append("'{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}')");
                strSql1.Append(";");
                sql = string.Format(strSql1.ToString(), model.pmenucode, model.menucode, model.menuname, model.linkaddress, model.menuicon, model.menusort, model.isenable, model.createtime, model.createman);
            }
            cmd_list.Add(new CommandInfo(sql, null));
            for (int i = 0; i < btncode.Count; i++)
            {
                cmd_list.Add(new CommandInfo("insert into sys_menubutton(menucode,btncode) values('" + model.menucode + "','" + btncode[i].ToString() + "')", null));
            }
            return(DbHelperMySQL.ExecuteSqlTran(cmd_list));
        }
Пример #10
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool UpdateJ(FMS_Model.fms_dkmassage Mmodel, int flag)
        {
            List <string> strSqlList = new List <string>();
            string        strSql     = string.Empty;

            if (flag == 0)
            {
                strSql = string.Format(@" update  xmh_fms.fms_dkmassage set is_inner_Journal='{0}' where id='{1}'",
                                       Mmodel.is_inner_Journal, Mmodel.id);

                strSqlList.Add(strSql);
            }
            else if (flag == 1)
            {
                strSql = string.Format(@" update  xmh_fms.fms_dkmassage set is_out_Journal='{0}' where id='{1}'",
                                       Mmodel.is_inner_Journal, Mmodel.id);

                strSqlList.Add(strSql);
            }

            int rows = DbHelperMySQL.ExecuteSqlTran(strSqlList);

            if (rows >= 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #11
0
        //删除数据
        public bool DelAlls(int dk_id)
        {
            List <string> strSqlList = new List <string>();
            string        strSql     = string.Empty;

            strSql = string.Format(@" delete from xmh_fms.fms_kuan where dkmassage_id='{0}'", dk_id);

            strSqlList.Add(strSql);

            strSql = string.Format(@" delete from xmh_shop.shop_progress_payments where order_sn='{0}' and type='{1}'", dk_id, 2);

            strSqlList.Add(strSql);


            int rows = DbHelperMySQL.ExecuteSqlTran(strSqlList);

            if (rows >= 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #12
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool AddKuan(FMS_Model.fms_kuan model, FMS_Model.shop_progress_payments pmodel)
        {
            List <string> strSqlList = new List <string>();
            string        strSql     = string.Empty;


            strSql = string.Format(@" insert into xmh_fms.fms_kuan (jzdate,jytime,jiefang,daifang,name,number,user_qq,admin_name,admin_id,erp_dakuanhao,status,file_time,confirm_time,dkmassage_id,user_id,acc_type) 
                                       value('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}') ",
                                   model.jzdate, model.jytime, model.jiefang, model.daifang, model.name, model.number, model.user_qq, model.admin_name, model.admin_id, model.erp_dakuanhao, model.status, model.file_time, model.confirm_time, model.dkmassage_id, model.user_id, model.acc_type);
            strSqlList.Add(strSql);



            strSql = string.Format(@" insert into xmh_shop.shop_progress_payments (type,order_sn,add_time,money,user_id,employee_id,emp_code,msg,status,start_valid_time,user_yingshou) 
                                       value('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}') ",
                                   pmodel.type, pmodel.order_sn, pmodel.add_time, pmodel.money, pmodel.user_id, pmodel.employee_id, pmodel.emp_code, pmodel.msg, pmodel.status, pmodel.start_valid_time, pmodel.user_yingshou);
            strSqlList.Add(strSql);

            int rows = DbHelperMySQL.ExecuteSqlTran(strSqlList);

            if (rows >= 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #13
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Updates(FMS_Model.fms_kuan model, FMS_Model.fms_dkmassage Mmodel)
        {
            List <string> strSqlList = new List <string>();
            string        strSql     = string.Empty;

            strSql = string.Format(@" update xmh_fms.fms_kuan set erp_dakuanhao='{0}',kingdee_out_code='{1}' where  id='{2}' ", model.erp_dakuanhao, model.kingdee_out_code, model.id);
            strSqlList.Add(strSql);

            strSql = string.Format(@" update  xmh_fms.fms_dkmassage set stats='{0}', erp_dakuanhao='{1}',user_id='{2}',kingdee_out_code='{3}',is_send_out='{4}',is_inner_Journal='{5}',send_out_reason='{6}'  where id='{7}'",
                                   Mmodel.stats, Mmodel.erp_dakuanhao, Mmodel.user_id, Mmodel.kingdee_out_code, Mmodel.is_send_out, 1, Mmodel.send_out_reason, Mmodel.id);

            strSqlList.Add(strSql);


            int rows = DbHelperMySQL.ExecuteSqlTran(strSqlList);

            if (rows >= 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        private void 确定_Click(object sender, EventArgs e)
        {
            DialogResult rr = MessageBox.Show("确认删除?", "确认删除提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
            int          tt = (int)rr;

            if (tt == 1)
            {
                List <string> sql = new List <string>();
                foreach (Control item in 项目.Controls)
                {
                    if (item is CheckBox)
                    {
                        if (((CheckBox)item).Checked)
                        {
                            sql.Add($"delete from gravida_after_record where name='{Names}' and aichive_no='{aichive_no}' and id_number='{id_number}' and order_num='{((CheckBox)item).Tag.ToString()}';");
                        }
                    }
                }
                if (DbHelperMySQL.ExecuteSqlTran(sql) > 0)
                {
                    MessageBox.Show("删除成功!");
                }
                else
                {
                    MessageBox.Show("删除失败!");
                };
            }
        }
Пример #15
0
        /// <summary>
        /// 向数据库插入招标信息
        /// </summary>
        /// <param name="info">招标信息</param>
        /// <returns>是否插入成功</returns>
        protected bool InsertInfo(BusinessInfo info)
        {
            if (JudegeInfoExist(info))
            {
                return(true);
            }

            List <CommandInfo> commandList    = new List <CommandInfo>();
            CommandInfo        insertBusiness = new CommandInfo();

            insertBusiness.CommandText = "Insert Into business(BusinessID,BusinessTitle,ReleaseCom,Money,ReleaseLocation,ReleaseTime,DetileURL,Source) Values (?BusinessID,?BusinessTitle,?ReleaseCom,?Money,?ReleaseLocation,?ReleaseTime,?DetileURL,?Source);";
            MySqlParameter[] insertBusinessParameters = new MySqlParameter[]
            {
                new MySqlParameter("BusinessID", MySqlDbType.VarChar, 50),
                new MySqlParameter("BusinessTitle", MySqlDbType.VarChar, 200),
                new MySqlParameter("ReleaseCom", MySqlDbType.VarChar, 200),
                new MySqlParameter("Money", MySqlDbType.VarChar, 50),
                new MySqlParameter("ReleaseLocation", MySqlDbType.VarChar, 200),
                new MySqlParameter("ReleaseTime", MySqlDbType.Date),
                new MySqlParameter("DetileURL", MySqlDbType.VarChar, 500),
                new MySqlParameter("Source", MySqlDbType.VarChar, 50)
            };
            insertBusinessParameters[0].Value = info.GUID;
            insertBusinessParameters[1].Value = info.Title ?? "";
            insertBusinessParameters[2].Value = info.ComName ?? "";
            insertBusinessParameters[3].Value = info.Money ?? "";
            insertBusinessParameters[4].Value = info.Location ?? "";
            insertBusinessParameters[5].Value = info.ReleaseTime;
            insertBusinessParameters[6].Value = info.DetileURL ?? "";
            insertBusinessParameters[7].Value = info.Source ?? "";

            insertBusiness.Parameters = insertBusinessParameters;
            commandList.Add(insertBusiness);

            CommandInfo insertDetile = new CommandInfo();

            insertDetile.CommandText = "Insert Into Detile(DetileID,BusinessID,DetileURL,Content) Values(?DetileID,?BusinessID,?DetileURL,?Content);";
            MySqlParameter[] insertDetileParameters =
            {
                new MySqlParameter("DetileID",   MySqlDbType.VarChar,  50),
                new MySqlParameter("BusinessID", MySqlDbType.VarChar,  50),
                new MySqlParameter("DetileURL",  MySqlDbType.VarChar, 500),
                new MySqlParameter("Content",    MySqlDbType.VarChar, 5000)
            };
            insertDetileParameters[0].Value = Guid.NewGuid().ToString();
            insertDetileParameters[1].Value = info.GUID;
            insertDetileParameters[2].Value = info.DetileURL ?? "";
            info.Content = info.Content.Length > 20000 ? info.Content.Substring(0, 20000) : info.Content;
            insertDetileParameters[3].Value = info.Content ?? "";
            insertDetile.Parameters         = insertDetileParameters;
            commandList.Add(insertDetile);
            int result = DbHelperMySQL.ExecuteSqlTran(commandList);

            if (result > 0)
            {
                return(true);
            }
            return(false);
        }
Пример #16
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <returns></returns>
        private int Insert()
        {
            List <gravida_after_record> infolist = GetData();
            List <DBSql> hb   = new List <DBSql>();
            DBSql        sqls = null;

            foreach (gravida_after_record info in infolist)
            {
                sqls            = new DBSql();
                sqls.sql        = @"insert into gravida_after_record(id,name,aichive_no,id_number,order_num,visit_date,childbirth,discharge_date,temperature,general_health_status,general_psychology_status,blood_pressure_high,blood_pressure_low,breast,breast_error,lyma,lyma_error,womb,womb_error,wound,wound_error,other,`condition`,error_info,guidance,guidance_other,transfer_treatment,transfer_treatment_reason,transfer_treatment_department,next_visit_date,visit_doctor,create_user,create_name,create_time,create_org,create_org_name,upload_status) values(@id,@name,@aichive_no,@id_number,@order_num,@visit_date,@childbirth,@discharge_date,@temperature,@general_health_status,@general_psychology_status,@blood_pressure_high,@blood_pressure_low,@breast,@breast_error,@lyma,@lyma_error,@womb,@womb_error,@wound,@wound_error,@other,@condition,@error_info,@guidance,@guidance_other,@transfer_treatment,@transfer_treatment_reason,@transfer_treatment_department,@next_visit_date,@visit_doctor,@create_user,@create_name,@create_time,@create_org,@create_org_name,@upload_status);";
                sqls.parameters = new MySqlParameter[] {
                    new MySqlParameter("@id", info.id),
                    new MySqlParameter("@name", info.name),
                    new MySqlParameter("@aichive_no", info.aichive_no),
                    new MySqlParameter("@id_number", info.id_number),
                    new MySqlParameter("@visit_date", info.visit_date),
                    new MySqlParameter("@order_num", info.order_num),
                    new MySqlParameter("@childbirth", info.childbirth),
                    new MySqlParameter("@discharge_date", info.discharge_date),
                    new MySqlParameter("@temperature", info.temperature),
                    new MySqlParameter("@general_health_status", info.general_health_status),
                    new MySqlParameter("@general_psychology_status", info.general_psychology_status),
                    new MySqlParameter("@blood_pressure_high", info.blood_pressure_high),
                    new MySqlParameter("@blood_pressure_low", info.blood_pressure_low),
                    new MySqlParameter("@breast", info.breast),
                    new MySqlParameter("@breast_error", info.breast_error),
                    new MySqlParameter("@lyma", info.lyma),
                    new MySqlParameter("@lyma_error", info.lyma_error),
                    new MySqlParameter("@womb", info.womb),
                    new MySqlParameter("@womb_error", info.womb_error),
                    new MySqlParameter("@wound", info.wound),
                    new MySqlParameter("@wound_error", info.wound_error),
                    new MySqlParameter("@other", info.other),
                    new MySqlParameter("@condition", info.condition),
                    new MySqlParameter("@error_info", info.error_info),
                    new MySqlParameter("@guidance", info.guidance),
                    new MySqlParameter("@guidance_other", info.guidance_other),
                    new MySqlParameter("@transfer_treatment", info.transfer_treatment),
                    new MySqlParameter("@transfer_treatment_reason", info.transfer_treatment_reason),
                    new MySqlParameter("@transfer_treatment_department", info.transfer_treatment_department),
                    new MySqlParameter("@next_visit_date", info.next_visit_date),
                    new MySqlParameter("@visit_doctor", info.visit_doctor),
                    new MySqlParameter("@create_user", info.create_user),
                    new MySqlParameter("@create_name", info.create_name),
                    new MySqlParameter("@create_time", info.create_time),
                    new MySqlParameter("@create_org", info.create_org),
                    new MySqlParameter("@create_org_name", info.create_org_name),
                    new MySqlParameter("@upload_status", info.upload_status),
                };
                hb.Add(sqls);
            }
            return(DbHelperMySQL.ExecuteSqlTran(hb));
        }
Пример #17
0
        private static bool InsertInfo(BusinessInfo info)
        {
            List <CommandInfo> commandList = new List <CommandInfo>();

            CommandInfo insertBusiness = new CommandInfo();

            insertBusiness.CommandText = "Insert Into business(BusinessID,BusinessTitle,ReleaseCom,ReleaseLocation,ReleaseTime,DetileURL,Source) Values (?BusinessID,?BusinessTitle,?ReleaseCom,?ReleaseLocation,?ReleaseTime,?DetileURL,?Source);";
            MySqlParameter[] insertBusinessParameters = new MySqlParameter[]
            {
                new MySqlParameter("BusinessID", MySqlDbType.VarChar, 50),
                new MySqlParameter("BusinessTitle", MySqlDbType.VarChar, 200),
                new MySqlParameter("ReleaseCom", MySqlDbType.VarChar, 200),
                new MySqlParameter("ReleaseLocation", MySqlDbType.VarChar, 200),
                new MySqlParameter("ReleaseTime", MySqlDbType.Date),
                new MySqlParameter("DetileURL", MySqlDbType.VarChar, 500),
                new MySqlParameter("Source", MySqlDbType.VarChar, 50)
            };
            insertBusinessParameters[0].Value = info.GUID;
            insertBusinessParameters[1].Value = info.Title;
            insertBusinessParameters[2].Value = info.ComName;
            insertBusinessParameters[3].Value = info.Location;
            insertBusinessParameters[4].Value = info.ReleaseTime;
            insertBusinessParameters[5].Value = info.DetileURL;
            insertBusinessParameters[6].Value = info.Source;

            insertBusiness.Parameters = insertBusinessParameters;
            commandList.Add(insertBusiness);

            CommandInfo insertDetile = new CommandInfo();

            insertDetile.CommandText = "Insert Into Detile(DetileID,BusinessID,DetileURL,Content) Values(?DetileID,?BusinessID,?DetileURL,?Content);";
            MySqlParameter[] insertDetileParameters =
            {
                new MySqlParameter("DetileID",   MySqlDbType.VarChar,  50),
                new MySqlParameter("BusinessID", MySqlDbType.VarChar,  50),
                new MySqlParameter("DetileURL",  MySqlDbType.VarChar, 500),
                new MySqlParameter("Content",    MySqlDbType.VarChar, 5000)
            };
            insertDetileParameters[0].Value = Guid.NewGuid().ToString();
            insertDetileParameters[1].Value = info.GUID;
            insertDetileParameters[2].Value = info.DetileURL;
            insertDetileParameters[3].Value = info.Content;

            insertDetile.Parameters = insertDetileParameters;
            commandList.Add(insertDetile);
            int result = DbHelperMySQL.ExecuteSqlTran(commandList);

            if (result > 0)
            {
                return(true);
            }
            return(false);
        }
Пример #18
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <returns></returns>
        private int Insert()
        {
            List <gravida_follow_record> infolist = GetData();
            List <DBSql> hb   = new List <DBSql>();
            DBSql        sqls = null;

            foreach (gravida_follow_record info in infolist)
            {
                sqls            = new DBSql();
                sqls.sql        = @"insert into gravida_follow_record(id,name,aichive_no,id_number,order_num,visit_date,gestational_weeks,symptom,weight,fundus_height,abdomen_circumference,fetus_position,fetal_heart_rate,blood_pressure_high,blood_pressure_low,hemoglobin,urine_protein,check_other,`condition`,error_info,guidance,guidance_other,transfer_treatment,transfer_treatment_reason,transfer_treatment_department,next_visit_date,visit_doctor,create_user,create_name,create_time,create_org,create_org_name,upload_status) values(@id,@name,@aichive_no,@id_number,@order_num,@visit_date,@gestational_weeks,@symptom,@weight,@fundus_height,@abdomen_circumference,@fetus_position,@fetal_heart_rate,@blood_pressure_high,@blood_pressure_low,@hemoglobin,@urine_protein,@check_other,@condition,@error_info,@guidance,@guidance_other,@transfer_treatment,@transfer_treatment_reason,@transfer_treatment_department,@next_visit_date,@visit_doctor,@create_user,@create_name,@create_time,@create_org,@create_org_name,@upload_status);";
                sqls.parameters = new MySqlParameter[] {
                    new MySqlParameter("@id", info.id),
                    new MySqlParameter("@name", info.name),
                    new MySqlParameter("@aichive_no", info.aichive_no),
                    new MySqlParameter("@id_number", info.id_number),
                    new MySqlParameter("@visit_date", info.visit_date),
                    new MySqlParameter("@order_num", info.order_num),
                    new MySqlParameter("@gestational_weeks", info.gestational_weeks),
                    new MySqlParameter("@symptom", info.symptom),
                    new MySqlParameter("@weight", info.weight),
                    new MySqlParameter("@fundus_height", info.fundus_height),
                    new MySqlParameter("@abdomen_circumference", info.abdomen_circumference),
                    new MySqlParameter("@fetus_position", info.fetus_position),
                    new MySqlParameter("@fetal_heart_rate", info.fetal_heart_rate),
                    new MySqlParameter("@blood_pressure_high", info.blood_pressure_high),
                    new MySqlParameter("@blood_pressure_low", info.blood_pressure_low),
                    new MySqlParameter("@hemoglobin", info.hemoglobin),
                    new MySqlParameter("@urine_protein", info.urine_protein),
                    new MySqlParameter("@check_other", info.check_other),
                    new MySqlParameter("@condition", info.condition),
                    new MySqlParameter("@error_info", info.error_info),
                    new MySqlParameter("@guidance", info.guidance),
                    new MySqlParameter("@guidance_other", info.guidance_other),
                    new MySqlParameter("@transfer_treatment", info.transfer_treatment),
                    new MySqlParameter("@transfer_treatment_reason", info.transfer_treatment_reason),
                    new MySqlParameter("@transfer_treatment_department", info.transfer_treatment_department),
                    new MySqlParameter("@next_visit_date", info.next_visit_date),
                    new MySqlParameter("@visit_doctor", info.visit_doctor),
                    new MySqlParameter("@create_user", info.create_user),
                    new MySqlParameter("@create_name", info.create_name),
                    new MySqlParameter("@create_time", info.create_time),
                    new MySqlParameter("@create_org", info.create_org),
                    new MySqlParameter("@create_org_name", info.create_org_name),
                    new MySqlParameter("@upload_status", info.upload_status),
                };
                hb.Add(sqls);
            }
            return(DbHelperMySQL.ExecuteSqlTran(hb));
        }
Пример #19
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <returns></returns>
        private int Update()
        {
            List <gravida_after_record> infolist = GetData();
            List <DBSql> hb = new List <DBSql>();

            foreach (gravida_after_record info in infolist)
            {
                DBSql sqls = new DBSql();
                sqls.sql        = @"update gravida_after_record set upload_status=0,visit_date=@visit_date,childbirth=@childbirth,discharge_date=@discharge_date,temperature=@temperature,general_health_status=@general_health_status,general_psychology_status=@general_psychology_status,blood_pressure_high=@blood_pressure_high,blood_pressure_low=@blood_pressure_low,breast=@breast,breast_error=@breast_error,lyma=@lyma,lyma_error=@lyma_error,womb=@womb,womb_error=@womb_error,wound=@wound,wound_error=@wound_error,other=@other,`condition`=@condition,error_info=@error_info,guidance=@guidance,guidance_other=@guidance_other,transfer_treatment=@transfer_treatment,transfer_treatment_reason=@transfer_treatment_reason,transfer_treatment_department=@transfer_treatment_department,next_visit_date=@next_visit_date,visit_doctor=@visit_doctor,update_user=@update_user,update_name=@update_name,update_time=@update_time where name=@name and aichive_no=@aichive_no and id_number=@id_number and order_num=@order_num;";
                sqls.parameters = new MySqlParameter[] {
                    new MySqlParameter("@id", info.id),
                    new MySqlParameter("@name", info.name),
                    new MySqlParameter("@aichive_no", info.aichive_no),
                    new MySqlParameter("@id_number", info.id_number),
                    new MySqlParameter("@visit_date", info.visit_date),
                    new MySqlParameter("@order_num", info.order_num),
                    new MySqlParameter("@childbirth", info.childbirth),
                    new MySqlParameter("@discharge_date", info.discharge_date),
                    new MySqlParameter("@temperature", info.temperature),
                    new MySqlParameter("@general_health_status", info.general_health_status),
                    new MySqlParameter("@general_psychology_status", info.general_psychology_status),
                    new MySqlParameter("@blood_pressure_high", info.blood_pressure_high),
                    new MySqlParameter("@blood_pressure_low", info.blood_pressure_low),
                    new MySqlParameter("@breast", info.breast),
                    new MySqlParameter("@breast_error", info.breast_error),
                    new MySqlParameter("@lyma", info.lyma),
                    new MySqlParameter("@lyma_error", info.lyma_error),
                    new MySqlParameter("@womb", info.womb),
                    new MySqlParameter("@womb_error", info.womb_error),
                    new MySqlParameter("@wound", info.wound),
                    new MySqlParameter("@wound_error", info.wound_error),
                    new MySqlParameter("@other", info.other),
                    new MySqlParameter("@condition", info.condition),
                    new MySqlParameter("@error_info", info.error_info),
                    new MySqlParameter("@guidance", info.guidance),
                    new MySqlParameter("@guidance_other", info.guidance_other),
                    new MySqlParameter("@transfer_treatment", info.transfer_treatment),
                    new MySqlParameter("@transfer_treatment_reason", info.transfer_treatment_reason),
                    new MySqlParameter("@transfer_treatment_department", info.transfer_treatment_department),
                    new MySqlParameter("@next_visit_date", info.next_visit_date),
                    new MySqlParameter("@visit_doctor", info.visit_doctor),
                    new MySqlParameter("@update_user", info.update_user),
                    new MySqlParameter("@update_name", info.update_name),
                    new MySqlParameter("@update_time", info.update_time),
                };
                hb.Add(sqls);
            }
            return(DbHelperMySQL.ExecuteSqlTran(hb));
        }
Пример #20
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <returns></returns>
        private int Update()
        {
            List <gravida_follow_record> infolist = GetData();
            List <DBSql> hb = new List <DBSql>();

            foreach (gravida_follow_record info in infolist)
            {
                DBSql sqls = new DBSql();
                sqls.sql        = @"update gravida_follow_record set upload_status=0,visit_date=@visit_date,gestational_weeks=@gestational_weeks,symptom=@symptom,
weight=@weight,fundus_height=@fundus_height,abdomen_circumference=@abdomen_circumference,fetus_position=@fetus_position,
fetal_heart_rate=@fetal_heart_rate,blood_pressure_high=@blood_pressure_high,blood_pressure_low=@blood_pressure_low,
hemoglobin=@hemoglobin,urine_protein=@urine_protein,check_other=@check_other,`condition`=@condition,error_info=@error_info,
guidance=@guidance,guidance_other=@guidance_other,transfer_treatment=@transfer_treatment,transfer_treatment_reason=@transfer_treatment_reason,transfer_treatment_department=@transfer_treatment_department,next_visit_date=@next_visit_date,visit_doctor=@visit_doctor,update_user=@update_user,update_name=@update_name,update_time=@update_time where name=@name and aichive_no=@aichive_no and id_number=@id_number and order_num=@order_num;";
                sqls.parameters = new MySqlParameter[] {
                    new MySqlParameter("@id", info.id),
                    new MySqlParameter("@name", info.name),
                    new MySqlParameter("@aichive_no", info.aichive_no),
                    new MySqlParameter("@id_number", info.id_number),
                    new MySqlParameter("@visit_date", info.visit_date),
                    new MySqlParameter("@order_num", info.order_num),
                    new MySqlParameter("@gestational_weeks", info.gestational_weeks),
                    new MySqlParameter("@symptom", info.symptom),
                    new MySqlParameter("@weight", info.weight),
                    new MySqlParameter("@fundus_height", info.fundus_height),
                    new MySqlParameter("@abdomen_circumference", info.abdomen_circumference),
                    new MySqlParameter("@fetus_position", info.fetus_position),
                    new MySqlParameter("@fetal_heart_rate", info.fetal_heart_rate),
                    new MySqlParameter("@blood_pressure_high", info.blood_pressure_high),
                    new MySqlParameter("@blood_pressure_low", info.blood_pressure_low),
                    new MySqlParameter("@hemoglobin", info.hemoglobin),
                    new MySqlParameter("@urine_protein", info.urine_protein),
                    new MySqlParameter("@check_other", info.check_other),
                    new MySqlParameter("@condition", info.condition),
                    new MySqlParameter("@error_info", info.error_info),
                    new MySqlParameter("@guidance", info.guidance),
                    new MySqlParameter("@guidance_other", info.guidance_other),
                    new MySqlParameter("@transfer_treatment", info.transfer_treatment),
                    new MySqlParameter("@transfer_treatment_reason", info.transfer_treatment_reason),
                    new MySqlParameter("@transfer_treatment_department", info.transfer_treatment_department),
                    new MySqlParameter("@next_visit_date", info.next_visit_date),
                    new MySqlParameter("@visit_doctor", info.visit_doctor),
                    new MySqlParameter("@update_user", info.update_user),
                    new MySqlParameter("@update_name", info.update_name),
                    new MySqlParameter("@update_time", info.update_time),
                };
                hb.Add(sqls);
            }
            return(DbHelperMySQL.ExecuteSqlTran(hb));
        }
Пример #21
0
        //修改
        public bool UpdateN(string oldRoleId, string newRoleId, string art_id, string factory_Id, int menu_id, int emp_id)  //a7,
        {
            List <string> strSqlList = new List <string>();
            string        strSql     = string.Empty;
            string        strSql1    = string.Empty;

            //更新原来的文章与角色对应关系
            //先移除此文章对应的所有角色的权限
            strSql = string.Format(@"UPDATE ssn_visit  SET Art_id = (REPLACE(Art_id, '{0}', ''))  WHERE role_id in ({1}) and Factory_Id='{2}' and menu_ids ={3}", art_id, oldRoleId, factory_Id, menu_id);
            strSqlList.Add(strSql);

            //把前台保留的角色,以‘,’进行分组,循环进行操作
            if (!string.IsNullOrEmpty(newRoleId))
            {
                string[] arr = newRoleId.Split(',');

                foreach (string item in arr)
                {
                    //进行更新或新增,让角色获取此文章权限

                    if (DbHelperMySQL.Exists(" select count(1) from ssn_visit where Factory_Id='" + factory_Id + "' and role_id = " + int.Parse(item) + " and menu_ids = " + menu_id))
                    {
                        strSql1 = string.Format(@" update ssn_visit set Art_id=CONCAT(Art_id,'{0}') where role_id = {1} and Factory_Id='{2}' and menu_ids = {3}", art_id, int.Parse(item), factory_Id, menu_id);
                        strSqlList.Add(strSql1);
                    }
                    else
                    {
                        strSql1 = string.Format(@" insert into  ssn_visit (Factory_Id,Role_id,App_ids,Menu_ids,Art_id,Create_id,Create_date) 
                                                values ('{0}',{1},{2},{3},'{4}',{5},'{6}')", factory_Id, int.Parse(item), 1, menu_id, art_id, emp_id, DateTime.Now);
                        strSqlList.Add(strSql1);
                    }
                }
            }


            int rows = DbHelperMySQL.ExecuteSqlTran(strSqlList);

            if (rows >= 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #22
0
        /*
         *      /// <summary>
         *      /// 分页获取数据列表
         *      /// </summary>
         *      public DataSet GetList(int PageSize,int PageIndex,string strWhere)
         *      {
         *              MySqlParameter[] parameters = {
         *                              new MySqlParameter("?tblName", MySqlDbType.VarChar, 255),
         *                              new MySqlParameter("?fldName", MySqlDbType.VarChar, 255),
         *                              new MySqlParameter("?PageSize", MySqlDbType.Int32),
         *                              new MySqlParameter("?PageIndex", MySqlDbType.Int32),
         *                              new MySqlParameter("?IsReCount", MySqlDbType.Bit),
         *                              new MySqlParameter("?OrderType", MySqlDbType.Bit),
         *                              new MySqlParameter("?strWhere", MySqlDbType.VarChar,1000),
         *                              };
         *              parameters[0].Value = "sys_rolemenu";
         *              parameters[1].Value = "id";
         *              parameters[2].Value = PageSize;
         *              parameters[3].Value = PageIndex;
         *              parameters[4].Value = 0;
         *              parameters[5].Value = 0;
         *              parameters[6].Value = strWhere;
         *              return DbHelperMySQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
         *      }*/

        #endregion  BasicMethod
        #region  ExtensionMethod
        /// <summary>
        /// 添加角色权限
        /// </summary>
        /// <param name="rolecode">角色编号</param>
        /// <param name="r_str">菜单按钮编号字符串</param>
        /// <returns></returns>
        public int SaveRoleMenu(string rolecode, string r_str)
        {
            List <CommandInfo> cmd_list = new List <CommandInfo>();

            string[] mb_list = r_str.Split('|');
            cmd_list.Add(new CommandInfo("delete from sys_rolemenu where rolecode='" + rolecode + "'", null));
            string t_sql = "insert into sys_rolemenu(rolecode,menucode,btncode) values('{0}','{1}','{2}')";

            foreach (string mb in mb_list)
            {
                string menucode    = mb.Split('@')[0].ToString();
                string btncodelist = mb.Split('@')[1].ToString();
                string sql         = string.Format(t_sql, rolecode, menucode, btncodelist);
                cmd_list.Add(new CommandInfo(sql, null));
            }
            return(DbHelperMySQL.ExecuteSqlTran(cmd_list));
        }
Пример #23
0
        /// <summary>
        /// 增加积分
        /// </summary>
        public bool AddScore(XHD.Model.Personal_Score model, DataTable dt)
        {
            List <string> strSqlList = new List <string>();
            string        strSql     = string.Empty;

            int scoreTotal = 0;


            if (dt != null && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    scoreTotal += Convert.ToInt32(dt.Rows[i]["standardScore"].ToString());

                    strSql = string.Format(@" insert into Personal_Score(Factory_Id,DtypeName,DtypeId,UserName,UserId,ItemName,ItemId,Item_StandardId,Content,IsTure,Score,OperationName,OperationId,CreateDate) 
                                                 values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}')",
                                           model.Factory_Id, model.DtypeName, model.DtypeId, model.UserName, model.UserId, model.ItemName, model.ItemId, Convert.ToInt32(dt.Rows[i]["standardId"].ToString()),
                                           model.Content, model.IsTure, Convert.ToDecimal(dt.Rows[i]["standardScore"].ToString()), model.OperationName, model.OperationId, model.CreateDate);

                    strSqlList.Add(strSql);
                }
            }

            strSql = string.Format(@" insert into Personal_Score(Factory_Id,DtypeName,DtypeId,UserName,UserId,ItemName,ItemId,Item_StandardId,Content,IsTure,Score,OperationName,OperationId,CreateDate) 
                                      values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}')",
                                   model.Factory_Id, model.DtypeName, model.DtypeId, model.UserName, model.UserId, model.ItemName, model.ItemId, "",
                                   model.Content, model.IsTure, scoreTotal, model.OperationName, model.OperationId, model.CreateDate);

            strSqlList.Add(strSql);


            int rows = DbHelperMySQL.ExecuteSqlTran(strSqlList);

            if (rows >= 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #24
0
        /// <summary>
        /// 根据多个条件去更新记录
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Alter(XHD.Model.crm_task_delegate model)
        {
            List <string> strSqlList = new List <string>();
            string        strSql     = string.Format(@" update crm_task_delegate set reply_content='{0}' where task_id='{1}' and apply_empid='{2}' and reply_empid='{3}'",
                                                     model.reply_content, model.task_id, model.apply_empid, model.reply_empid);

            strSqlList.Add(strSql);

            strSql = string.Format(@" update crm_task_okrs set ischeck='{0}' where id='{1}'", 2, model.task_id);
            strSqlList.Add(strSql);

            int rows = DbHelperMySQL.ExecuteSqlTran(strSqlList);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// 批量删除数据
        /// </summary>
        public bool DeleteWhere(string suppliers_id, string menu_ids)
        {
            List <string> strSqlList = new List <string>();
            string        strSql     = string.Empty;

            string[] menuIds = menu_ids.Split(',');
            foreach (var item in menuIds)
            {
                if (!string.IsNullOrEmpty(item))
                {
                    strSql = string.Format(@"delete from scm_authority_dtcolumn  where suppliers_id='{0}' and Menu_ids='{1}'", suppliers_id, item);
                    strSqlList.Add(strSql);
                }
            }

            int rows = DbHelperMySQL.ExecuteSqlTran(strSqlList);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }

            //StringBuilder strSql = new StringBuilder();
            //strSql.Append("delete from scm_authority_dtcolumn ");
            //strSql.Append(" where " + wherestr + "  ");
            //int rows = DbHelperMySQL.ExecuteSql(strSql.ToString());
            //if (rows > 0)
            //{
            //    return true;
            //}
            //else
            //{
            //    return false;
            //}
        }
Пример #26
0
 //执行存储过程
 public bool ExecuteSqlTran(List <string> sqlLst, out string msg)
 {
     try
     {
         int count = DbHelperMySQL.ExecuteSqlTran(sqlLst);
         if (count > 0)
         {
             msg = "执行成功";
             return(true);
         }
         else
         {
             msg = "执行失败";
             return(false);
         }
     }
     catch (Exception e)
     {
         msg = e.ToString();
         return(false);
     }
 }
Пример #27
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(MultiColorPen.Model.sys_menuinfo model, List <string> btncode)
        {
            List <CommandInfo> cmd_list = new List <CommandInfo>();
            StringBuilder      strSql   = new StringBuilder();

            strSql.Append("update sys_menuinfo set ");
            strSql.Append("pmenucode='{0}',");
            strSql.Append("menuname='{1}',");
            strSql.Append("linkaddress='{2}',");
            strSql.Append("menuicon='{3}',");
            strSql.Append("menusort='{4}',");
            strSql.Append("isenable='{5}',");
            strSql.Append("createtime='{6}',");
            strSql.Append("createman='{7}',");
            strSql.Append("updatetime='{8}',");
            strSql.Append("updateman='{9}'");
            strSql.Append(" where id='{10}'");

            string sql = string.Format(strSql.ToString(), model.pmenucode, model.menuname, model.linkaddress, model.menuicon, model.menusort, model.isenable, model.createtime, model.createman, model.updatetime, model.updateman, model.id);

            cmd_list.Add(new CommandInfo(sql, null));
            cmd_list.Add(new CommandInfo(string.Format("delete from sys_menubutton where menucode='{0}'", model.menucode), null));

            for (int i = 0; i < btncode.Count; i++)
            {
                cmd_list.Add(new CommandInfo(string.Format("insert into sys_menubutton(menucode,btncode) values('{0}','{1}')", model.menucode, btncode[i]), null));
            }
            int rows = DbHelperMySQL.ExecuteSqlTran(cmd_list);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #28
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool UpdateCode(FMS_Model.fms_kuan model, FMS_Model.fms_dkmassage Mmodel)
        {
            List <string> strSqlList = new List <string>();
            string        strSql     = string.Empty;

            strSql = string.Format(@" update xmh_fms.fms_kuan set kingdee_out_code='{0}' where  id='{1}' ", model.kingdee_out_code, model.id);
            strSqlList.Add(strSql);

            strSql = string.Format(@" update  xmh_fms.fms_dkmassage set kingdee_out_code='{0}',send_out_reason='{1}' where id='{2}'", Mmodel.kingdee_out_code, Mmodel.send_out_reason, Mmodel.id);
            strSqlList.Add(strSql);


            int rows = DbHelperMySQL.ExecuteSqlTran(strSqlList);

            if (rows >= 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Adds(XHD.Model.scm_authority_dtcolumn model)
        {
            List <string> strSqlList = new List <string>();

            string[] menu_ids = model.Menu_ids.Split(',');

            string[] column_ids;
            string   strSql = string.Empty;

            string ids = model.column_ids.Replace(",", "");

            if (!string.IsNullOrEmpty(ids))
            {
                foreach (var item in menu_ids)
                {
                    if (!string.IsNullOrEmpty(item))
                    {
                        //查询该页面下的列
                        DataSet ds = GetListColumn("Menu_id='" + item + "'");
                        if (ds != null && ds.Tables[0].Rows.Count > 0)
                        {
                            string columnIds = model.column_ids.Substring(2, model.column_ids.Length - 3);

                            if (columnIds.Length > 2)
                            {
                                string s = string.Empty;
                                column_ids = columnIds.Split(',');
                                foreach (var items in column_ids)
                                {
                                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                                    {
                                        int column_id = Convert.ToInt32(ds.Tables[0].Rows[i]["column_id"].ToString());
                                        if (column_id == Convert.ToInt32(items))
                                        {
                                            s += items + ",";
                                            break;
                                        }
                                    }
                                }
                                strSql = string.Format(@"insert into scm_authority_dtcolumn (factory_Id,suppliers_id,Menu_ids,column_ids,Create_id,Create_date)
                                            values('{0}','{1}','{2}','{3}','{4}','{5}')", model.factory_Id, model.suppliers_id, item, s, model.Create_id, model.Create_date);
                                strSqlList.Add(strSql);
                            }
                            else
                            {
                                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                                {
                                    int column_id = Convert.ToInt32(ds.Tables[0].Rows[i]["column_id"].ToString());
                                    if (column_id == Convert.ToInt32(columnIds))
                                    {
                                        strSql = string.Format(@"insert into scm_authority_dtcolumn (factory_Id,suppliers_id,Menu_ids,column_ids,Create_id,Create_date)
                                            values('{0}','{1}','{2}','{3}','{4}','{5}')", model.factory_Id, model.suppliers_id, item, columnIds, model.Create_id, model.Create_date);
                                        strSqlList.Add(strSql);
                                    }
                                }
                            }
                        }
                    }
                }
            }

            int rows = DbHelperMySQL.ExecuteSqlTran(strSqlList);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #30
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Adds(FMS_Model.fms_kuan model, FMS_Model.fms_dkmassage Mmodel, FMS_Model.shop_progress_payments pmodel, DataSet ds)
        {
            List <string> strSqlList = new List <string>();
            string        strSql     = string.Empty;

            strSql = string.Format(@" insert into xmh_fms.fms_kuan (jzdate,jytime,jiefang,daifang,name,number,user_qq,admin_name,admin_id,erp_dakuanhao,status,file_time,confirm_time,dkmassage_id,user_id,acc_type) 
                                       value('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}') ",
                                   model.jzdate, model.jytime, model.jiefang, model.daifang, model.name, model.number, model.user_qq, model.admin_name, model.admin_id, model.erp_dakuanhao, model.status, model.file_time, model.confirm_time, model.dkmassage_id, model.user_id, model.acc_type);
            strSqlList.Add(strSql);

            strSql = string.Format(@" update  xmh_fms.fms_dkmassage set erp_dakuanhao='{0}',confirm_admin_id='{1}',confirm_time='{2}',erp_time='{3}',user_id='{4}',operate_userId='{5}',operate_time='{6}' where id='{7}'",
                                   Mmodel.erp_dakuanhao, Mmodel.confirm_admin_id, Mmodel.confirm_time, Mmodel.erp_time, Mmodel.user_id, Mmodel.operate_userId, Mmodel.operate_time, Mmodel.id);

            strSqlList.Add(strSql);


            strSql = string.Format(@" insert into xmh_shop.shop_progress_payments (type,order_sn,add_time,money,user_id,employee_id,emp_code,msg,status,start_valid_time,user_yingshou) 
                                       value('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}') ",
                                   pmodel.type, pmodel.order_sn, pmodel.add_time, pmodel.money, pmodel.user_id, pmodel.employee_id, pmodel.emp_code, pmodel.msg, pmodel.status, pmodel.start_valid_time, pmodel.user_yingshou);
            strSqlList.Add(strSql);

            if (!string.IsNullOrEmpty(Mmodel.account))
            {
                if (string.IsNullOrEmpty(ds.Tables[0].Rows[0]["bill_bank_code1"].ToString()))
                {
                    strSql = string.Format(@" Update CRM_Contact set bill_bank_code1='{0}' where  id='{1}'", Mmodel.account, ds.Tables[0].Rows[0]["id"].ToString());
                    strSqlList.Add(strSql);
                }
                else if (string.IsNullOrEmpty(ds.Tables[0].Rows[0]["bill_bank_code2"].ToString()))
                {
                    strSql = string.Format(@" Update CRM_Contact set bill_bank_code2='{0}' where  id='{1}'", Mmodel.account, ds.Tables[0].Rows[0]["id"].ToString());
                    strSqlList.Add(strSql);
                }
                else if (string.IsNullOrEmpty(ds.Tables[0].Rows[0]["bill_bank_code3"].ToString()))
                {
                    strSql = string.Format(@" Update CRM_Contact set bill_bank_code3='{0}' where  id='{1}'", Mmodel.account, ds.Tables[0].Rows[0]["id"].ToString());
                    strSqlList.Add(strSql);
                }
                else if (string.IsNullOrEmpty(ds.Tables[0].Rows[0]["bill_bank_code4"].ToString()))
                {
                    strSql = string.Format(@" Update CRM_Contact set bill_bank_code4='{0}' where  id='{1}'", Mmodel.account, ds.Tables[0].Rows[0]["id"].ToString());
                    strSqlList.Add(strSql);
                }
                else if (string.IsNullOrEmpty(ds.Tables[0].Rows[0]["bill_bank_code5"].ToString()))
                {
                    strSql = string.Format(@" Update CRM_Contact set bill_bank_code5='{0}' where  id='{1}'", Mmodel.account, ds.Tables[0].Rows[0]["id"].ToString());
                    strSqlList.Add(strSql);
                }
                else if (string.IsNullOrEmpty(ds.Tables[0].Rows[0]["bill_bank_code6"].ToString()))
                {
                    strSql = string.Format(@" Update CRM_Contact set bill_bank_code6='{0}' where  id='{1}'", Mmodel.account, ds.Tables[0].Rows[0]["id"].ToString());
                    strSqlList.Add(strSql);
                }
                else if (string.IsNullOrEmpty(ds.Tables[0].Rows[0]["bill_alipay_code"].ToString()))
                {
                    strSql = string.Format(@" Update CRM_Contact set bill_alipay_code='{0}' where  id='{1}'", Mmodel.account, ds.Tables[0].Rows[0]["id"].ToString());
                    strSqlList.Add(strSql);
                }
                else if (string.IsNullOrEmpty(ds.Tables[0].Rows[0]["bill_wei_code"].ToString()))
                {
                    strSql = string.Format(@" Update CRM_Contact set bill_wei_code='{0}' where  id='{1}'", Mmodel.account, ds.Tables[0].Rows[0]["id"].ToString());
                    strSqlList.Add(strSql);
                }
            }


            int rows = DbHelperMySQL.ExecuteSqlTran(strSqlList);

            if (rows >= 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }