/// <summary> /// 只更改商城数据 /// </summary> public bool adopt(string idList, int empId, int time) { List <string> strSqlList = new List <string>(); string strSql = string.Empty; DataSet ds = GetListInfo(" k.id in (" + idList + ")"); if (ds != null && ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { strSql = string.Format(@"update fms_kuan_adjust set status='{0}',operate_empId='{1}',operate_date='{2}' where id ='{3}'", 7, empId, DateTime.Now, Convert.ToInt32(ds.Tables[0].Rows[i]["id"].ToString())); strSqlList.Add(strSql); strSql = string.Format(@"update xmh_shop.shop_progress_payments set type='{0}',add_time='{1}',money='{2}',user_id='{3}',employee_id='{4}',emp_code='{5}',msg='{6}', status='{7}',start_valid_time='{8}',order_sn='{9}' where id ='{10}'", 4, time, Convert.ToDecimal(ds.Tables[0].Rows[i]["change_total"].ToString()), Convert.ToInt32(ds.Tables[0].Rows[i]["user_id"].ToString()), Convert.ToInt32(ds.Tables[0].Rows[i]["BeSeats_id"].ToString()), ds.Tables[0].Rows[i]["emp_code"].ToString(), "款项来源于调账流程", 1, time, ds.Tables[0].Rows[i]["id"].ToString(), Convert.ToInt32(ds.Tables[0].Rows[i]["id"].ToString())); strSqlList.Add(strSql); } } int rows = FMS_DbHelperMySQL.ExecuteSqlTran(strSqlList); if (rows >= 0) { return(true); } else { return(false); } }
/// <summary> /// 重新认款 /// </summary> public bool KnowKuans(FMS_Model.fms_dkmassage model, FMS_Model.shop_progress_payments progress) { fms_kuan kuan = new fms_kuan(); shop_progress_payments _proPayments = new shop_progress_payments(); List <string> strSqlList = new List <string>(); string strSql = string.Empty; DataSet ds = kuan.GetList(" dkmassage_id='" + model.id + "'"); //已认款、待收款的重新认款 strSql = string.Format(@" update fms_dkmassage set stats='{0}',operate_userId='{1}',operate_time='{2}' where id='{3}'", model.stats, model.operate_userId, model.operate_time, model.id); strSqlList.Add(strSql); if (ds != null && ds.Tables[0].Rows.Count > 0) { strSql = string.Format(" Delete from fms_kuan where dkmassage_id='{0}'", model.id); //strSql = string.Format(" update fms_kuan set status ='{0}'where dkmassage_id='{1}'", 1, model.id); strSqlList.Add(strSql); } //3.shop_progress_payments DataSet dp = _proPayments.GetLists(" order_sn='" + model.id + "' and type='2' "); if (dp != null && dp.Tables[0].Rows.Count > 0) { strSql = string.Format(" Delete from xmh_shop.shop_progress_payments where order_sn='{0}' and type='{1}' ", model.id, 2); //strSql = string.Format(" update xmh_shop.shop_progress_payments set status='{0}' where order_sn='{2}'",2, model.id); strSqlList.Add(strSql); } //_proPayments.Add(progress); //strSqlList.Add(strSql); int rows = FMS_DbHelperMySQL.ExecuteSqlTran(strSqlList); if (rows > 0) { return(true); } else { return(false); } }
//批量删除 public bool DelAllKuan(string idList, FMS_Model.fms_dkmassage mModel) { fms_kuan kuan = new fms_kuan(); shop_progress_payments _proPayments = new shop_progress_payments(); List <string> strSqlList = new List <string>(); string strSql = string.Empty; DataSet ds = GetList(" id in(" + idList + ")"); if (ds != null && ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { //strSql = string.Format(@" delete from fms_dkmassage where id='{0}'", Convert.ToInt32(ds.Tables[0].Rows[i]["id"].ToString())); strSql = string.Format(@" update fms_dkmassage set is_delete='{0}',operate_userId='{1}',operate_time='{2}' where id='{3}'", 1, mModel.operate_userId, mModel.operate_time, Convert.ToInt32(ds.Tables[0].Rows[i]["id"].ToString())); strSqlList.Add(strSql); DataSet dk = kuan.GetList(" dkmassage_id='" + ds.Tables[0].Rows[i]["id"].ToString() + "'"); if (dk != null && dk.Tables[0].Rows.Count > 0) { strSql = string.Format(" Delete from fms_kuan where dkmassage_id='{0}'", Convert.ToInt32(ds.Tables[0].Rows[i]["id"].ToString())); //strSql = string.Format(" update fms_kuan set status ='{0}'where dkmassage_id='{1}'", 1, Convert.ToInt32(ds.Tables[0].Rows[i]["id"].ToString())); strSqlList.Add(strSql); } DataSet dp = _proPayments.GetLists(" order_sn='" + ds.Tables[0].Rows[i]["id"].ToString() + "' and type='2' "); if (dp != null && dp.Tables[0].Rows.Count > 0) { strSql = string.Format(" Delete from xmh_shop.shop_progress_payments where order_sn='{0}' and type='{1}'", Convert.ToInt32(ds.Tables[0].Rows[i]["id"].ToString()), 2); strSqlList.Add(strSql); } } } int rows = FMS_DbHelperMySQL.ExecuteSqlTran(strSqlList); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 认款 /// </summary> public bool KnowKuan(int flag, FMS_Model.fms_dkmassage model) { fms_kuan kuan = new fms_kuan(); List <string> strSqlList = new List <string>(); string strSql = string.Empty; switch (flag) { case 1: //认款 strSql = string.Format(@" update fms_dkmassage set user_id='{0}',confirm_admin_id='{1}',confirm_time='{2}',stats='{3}' where id='{4}'", model.user_id, model.confirm_admin_id, model.confirm_time, model.stats, model.id); strSqlList.Add(strSql); break; case 2: //未确认、待确认的重新认款 DataSet ds = kuan.GetList(" dkmassage_id='" + model.id + "'"); strSql = string.Format(@" update fms_dkmassage set stats='{0}',operate_userId='{1}',operate_time='{2}' where id='{3}'", model.stats, model.operate_userId, model.operate_time, model.id); strSqlList.Add(strSql); if (ds != null && ds.Tables[0].Rows.Count > 0) { strSql = string.Format(" update fms_kuan set status ='{0}'where dkmassage_id='{1}'", 1, model.id); strSqlList.Add(strSql); } break; default: break; } int rows = FMS_DbHelperMySQL.ExecuteSqlTran(strSqlList); if (rows > 0) { return(true); } else { return(false); } }
/// <summary> /// 审核 /// </summary> public bool updateStatus(FMS_Model.fms_refund_bill model, string idList) { List <string> strSqlList = new List <string>(); string strSql = string.Empty; DataSet ds = GetList(" refund_id in (" + idList + ")"); if (ds != null && ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { switch (model.refund_status.ToString()) { case "1": case "2": strSql = string.Format(@" update fms_refund_bill set refund_status='{0}',approvalOne_id='{1}',approvalOne_code='{2}',approvalOne_name='{3}',approvalOne_date='{4}' where refund_id='{5}'", model.refund_status, model.approvalOne_id, model.approvalOne_code, model.approvalOne_name, model.approvalOne_date, Convert.ToInt32(ds.Tables[0].Rows[i]["refund_id"].ToString())); strSqlList.Add(strSql); break; case "3": case "4": strSql = string.Format(@" update fms_refund_bill set refund_status='{0}',approvalTwo_id='{1}',approvalTwo_code='{2}',approvalTwo_name='{3}',approvalTwo_date='{4}' where refund_id='{5}'", model.refund_status, model.approvalTwo_id, model.approvalTwo_code, model.approvalTwo_name, model.approvalTwo_date, Convert.ToInt32(ds.Tables[0].Rows[i]["refund_id"].ToString())); strSqlList.Add(strSql); break; case "5": //判断是三级审核还是四级审核 0:三级审核;1:四级审核 int state = model.refund_status; if (ds.Tables[0].Rows[i]["refund_type"].ToString() == "0") { state = 9; } strSql = string.Format(@" update fms_refund_bill set refund_status='{0}',approvalThree_id='{1}',approvalThree_code='{2}',approvalThree_name='{3}',approvalThree_date='{4}' where refund_id='{5}'", state, model.approvalThree_id, model.approvalThree_code, model.approvalThree_name, model.approvalThree_date, Convert.ToInt32(ds.Tables[0].Rows[i]["refund_id"].ToString())); strSqlList.Add(strSql); break; case "6": strSql = string.Format(@" update fms_refund_bill set refund_status='{0}',approvalThree_id='{1}',approvalThree_code='{2}',approvalThree_name='{3}',approvalThree_date='{4}' where refund_id='{5}'", model.refund_status, model.approvalThree_id, model.approvalThree_code, model.approvalThree_name, model.approvalThree_date, Convert.ToInt32(ds.Tables[0].Rows[i]["refund_id"].ToString())); strSqlList.Add(strSql); break; case "8": case "9": strSql = string.Format(@" update fms_refund_bill set refund_status='{0}',approvalFour_id='{1}',approvalFour_code='{2}',approvalFour_name='{3}',approvalFour_date='{4}' where refund_id='{5}'", model.refund_status, model.approvalFour_id, model.approvalFour_code, model.approvalFour_name, model.approvalFour_date, Convert.ToInt32(ds.Tables[0].Rows[i]["refund_id"].ToString())); strSqlList.Add(strSql); break; default: break; } } } int rows = FMS_DbHelperMySQL.ExecuteSqlTran(strSqlList); if (rows >= 0) { return(true); } else { return(false); } }