public static void Update(TfApplyUpdateSort sort, MZ_TF_Record _mz_tf, RelationalDatabase _DataBase) { try { string sql = ""; if (_mz_tf.TFSQID == Guid.Empty) { throw new Exception("退费申请id为空!"); } switch (sort) { case TfApplyUpdateSort.取消申请: sql = @"update MZ_TFSQRECORD set BSCBZ=1 WHERE TFSQID='" + _mz_tf.TFSQID + "' AND TFBZ=0"; break; case TfApplyUpdateSort.取消初审: sql = @"update MZ_TFSQRECORD set SHY=null,SHSJ=null,SHBZ=0 WHERE TFSQID='" + _mz_tf.TFSQID + "' AND TFBZ=0"; break; case TfApplyUpdateSort.取消复审: sql = @"update MZ_TFSQRECORD set FSY=null,FSSJ=null,FSBZ=0 WHERE TFSQID='" + _mz_tf.TFSQID + "' AND TFBZ=0"; break; case TfApplyUpdateSort.退费初审: sql = @"update MZ_TFSQRECORD set SHY=" + _mz_tf.SHY + ",SHSJ='" + _mz_tf.SHSJ + "',SHBZ=1 WHERE TFSQID='" + _mz_tf.TFSQID + "' AND TFBZ=0"; break; case TfApplyUpdateSort.退费复审: sql = @"update MZ_TFSQRECORD set FSY=" + _mz_tf.FSY + ",FSSJ='" + _mz_tf.FSSJ + "',FSBZ=1 WHERE TFSQID='" + _mz_tf.TFSQID + "' AND TFBZ=0"; break; case TfApplyUpdateSort.退费: sql = @"update MZ_TFSQRECORD set TFBZ=1,TFSJ='" + _mz_tf.TFSJ + "',TFY=" + _mz_tf.TFY + ",JSID='" + _mz_tf.JSID + "' WHERE TFSQID='" + _mz_tf.TFSQID + "' AND TFBZ=0"; break; } _DataBase.DoCommand(sql); } catch (Exception ea) { throw ea; } }
public static void Update(TfApplyUpdateSort sort, MZ_TF_Record _mz_tf, bool Isqr, RelationalDatabase _DataBase) { try { string sql = ""; if (_mz_tf.TFSQID == Guid.Empty) { throw new Exception("退费申请id为空!"); } switch (sort) { case TfApplyUpdateSort.取消申请: { /*ParameterEx[] parameters = new ParameterEx[10]; * parameters[0].Text = "@CFID"; * parameters[0].Value = _mz_tf.CFID; * parameters[1].Text = "@CFMXID"; * parameters[1].Value = _mz_tf.CFMXID; * parameters[2].Text = "@TCID"; * parameters[2].Value = _mz_tf.TCID; * * parameters[3].Text = "@BQRBZ"; * parameters[3].Value = 1; * parameters[4].Text = "@QRKS"; * parameters[4].Value = InstanceForm.BCurrentDept.DeptId; * parameters[5].Text = "@QRRQ"; * parameters[5].Value = TrasenClasses.GeneralClasses.DateManager.ServerDateTimeByDBType(_DataBase).ToString(); * * parameters[6].Text = "@QRDJY"; * parameters[6].Value = InstanceForm.BCurrentUser.EmployeeId; * * parameters[7].Text = "@err_code"; * parameters[7].ParaDirection = ParameterDirection.Output; * parameters[7].DataType = DbType.Int32; * parameters[7].ParaSize = 100; * * parameters[8].Text = "@err_text"; * parameters[8].ParaDirection = ParameterDirection.Output; * parameters[8].ParaSize = 100; * parameters[9].Text = "@YQRKS"; * parameters[9].Value = InstanceForm.BCurrentUser.EmployeeId; * InstanceForm.BDatabase.GetDataTable("SP_YJ_SAVE_QRJL_MZ", parameters, 60); * int err_code = Convert.ToInt32(parameters[7].Value); * string err_text = Convert.ToString(parameters[8].Value); * if (err_code != 0) throw new Exception(err_text); * */ sql = @"update MZ_TFSQRECORD set BSCBZ=1 WHERE TFSQID='" + _mz_tf.TFSQID + "' AND TFBZ=0"; break; } case TfApplyUpdateSort.取消初审: sql = @"update MZ_TFSQRECORD set SHY=null,SHSJ=null,SHBZ=0 WHERE TFSQID='" + _mz_tf.TFSQID + "' AND TFBZ=0"; break; case TfApplyUpdateSort.取消复审: sql = @"update MZ_TFSQRECORD set FSY=null,FSSJ=null,FSBZ=0 WHERE TFSQID='" + _mz_tf.TFSQID + "' AND TFBZ=0"; break; case TfApplyUpdateSort.退费初审: sql = @"update MZ_TFSQRECORD set SHY=" + _mz_tf.SHY + ",SHSJ='" + _mz_tf.SHSJ + "',SHBZ=1 WHERE TFSQID='" + _mz_tf.TFSQID + "' AND TFBZ=0"; break; case TfApplyUpdateSort.退费复审: sql = @"update MZ_TFSQRECORD set FSY=" + _mz_tf.FSY + ",FSSJ='" + _mz_tf.FSSJ + "',FSBZ=1 WHERE TFSQID='" + _mz_tf.TFSQID + "' AND TFBZ=0"; break; case TfApplyUpdateSort.退费: sql = @"update MZ_TFSQRECORD set TFBZ=1,TFSJ='" + _mz_tf.TFSJ + "',TFY=" + _mz_tf.TFY + ",JSID='" + _mz_tf.JSID + "' WHERE TFSQID='" + _mz_tf.TFSQID + "' AND TFBZ=0"; break; } _DataBase.DoCommand(sql); } catch (Exception ea) { throw ea; } }