Exemple #1
0
        /// <summary>
        /// 取消车辆申请确认信息
        /// </summary>
        /// <param name="CarApplyM">车辆申请信息</param>
        /// <returns>添加是否成功 false:失败,true:成功</returns>
        public static bool UpdateCarApplyCancelConfirm(string BillStatus, string Confirmor, string ConfirmDate, string ID, string userID, string CompanyID)
        {
            try
            {
                #region 车辆申请信息SQL拼写
                StringBuilder sql = new StringBuilder();
                sql.AppendLine("UPDATE officedba.CarApply");
                sql.AppendLine("		SET BillStatus=@BillStatus        ");
                sql.AppendLine("		,Confirmor=@Confirmor        ");
                sql.AppendLine("		,ConfirmDate=@ConfirmDate        ");
                sql.AppendLine("		,ModifiedDate=@ModifiedDate        ");
                sql.AppendLine("		,ModifiedUserID=@ModifiedUserID        ");
                sql.AppendLine("WHERE                  ");
                sql.AppendLine("		ID=@ID   ");

                #endregion
                #region 车辆申请信息参数设置
                SqlParameter[] param;
                param    = new SqlParameter[6];
                param[0] = SqlHelper.GetParameter("@BillStatus", BillStatus);
                param[1] = SqlHelper.GetParameter("@Confirmor", Confirmor);
                param[2] = SqlHelper.GetParameter("@ConfirmDate", ConfirmDate);
                param[3] = SqlHelper.GetParameter("@ModifiedDate", System.DateTime.Now);
                param[4] = SqlHelper.GetParameter("@ModifiedUserID", userID);
                param[5] = SqlHelper.GetParameter("@ID", ID);
                #endregion
                //SqlHelper.ExecuteTransSql(sql.ToString(), param);
                TransactionManager tran = new TransactionManager();
                tran.BeginTransaction();
                try
                {
                    FlowDBHelper.OperateCancelConfirm(CompanyID, 3, 8, Convert.ToInt32(ID), userID, tran);//取消确认
                    SqlHelper.ExecuteNonQuery(tran.Trans, CommandType.Text, sql.ToString(), param);
                    tran.Commit();
                    return(true);
                }
                catch
                {
                    tran.Rollback();
                    return(false);
                }
            }
            catch
            {
                return(false);
            }
        }
Exemple #2
0
        public static bool UpdateMoveApplyCancelConfirm(string BillStatus, string ID, string userID, string CompanyID, string ReprotNo)
        {
            try
            {
                StringBuilder sql = new StringBuilder();
                sql.AppendLine("UPDATE officedba.RectApply");
                sql.AppendLine("		SET BillStatus=@Status        ");
                sql.AppendLine("		,ModifiedDate=getdate()      ");
                sql.AppendLine("		,ModifiedUserID=@ModifiedUserID        ");
                sql.AppendLine(" 	,ConfirmDate = null       ");
                sql.AppendLine(" 	,Confirmor = null ");
                sql.AppendLine("WHERE                  ");
                sql.AppendLine(" 	CompanyCD = @CompanyCD            ");
                sql.AppendLine(" 	AND RectApplyNo = @RectApplyNo          ");



                SqlParameter[] param;
                param    = new SqlParameter[4];
                param[0] = SqlHelper.GetParameter("@Status", BillStatus);
                param[1] = SqlHelper.GetParameter("@ModifiedUserID", userID);
                param[2] = SqlHelper.GetParameter("@CompanyCD", CompanyID);
                param[3] = SqlHelper.GetParameter("@RectApplyNo", ReprotNo);

                //SqlHelper.ExecuteTransSql(sql.ToString(), param);
                TransactionManager tran = new TransactionManager();
                tran.BeginTransaction();
                try
                {
                    FlowDBHelper.OperateCancelConfirm(CompanyID, Convert.ToInt32(XBase.Common.ConstUtil.BILL_TYPEFLAG_HUMAN), Convert.ToInt32(XBase.Common.ConstUtil.BILL_TYPECODE_HUMAN_RECT_APPLY), Convert.ToInt32(ID), userID, tran);//取消确认
                    SqlHelper.ExecuteNonQuery(tran.Trans, CommandType.Text, sql.ToString(), param);
                    tran.Commit();
                    return(true);
                }
                catch
                {
                    tran.Rollback();
                    return(false);
                }
            }
            catch
            {
                return(false);
            }
        }