예제 #1
0
        public static PayInfo GetPayInfo(string PayId)
        {
            string    sql     = "select PayId, PaymentMethod, PayMoney, hkhorzph, PayCompany, PayType, SFKP, RendingReason, Remark, PayTime, CreateTime, CreateUser, Validate from PayInfo where PayId='" + PayId + "'";
            DataTable dt      = SQLBase.FillTable(sql);
            PayInfo   payInfo = new PayInfo();

            return(GSqlSentence.SetTValueD <PayInfo>(payInfo, dt.Rows[0]));
        }
예제 #2
0
        public static bool SavePayInfo(PayInfo payInfo, List <ConsumptionInfo> list, double yk, ref string err)
        {
            if (payInfo != null)
            {
                string paySql = GSqlSentence.GetInsertInfoByD <PayInfo>(payInfo, "PayInfo");
                if (SQLBase.ExecuteNonQuery(paySql) <= 0)
                {
                    err = "缴费信息添加失败";
                    return(false);
                }
                if (!UpdatePayId(payInfo.PayId))
                {
                    err = "缴费单号更新失败";
                    return(false);
                }
            }
            string conSql = GSqlSentence.GetInsertByList <ConsumptionInfo>(list, "ConsumptionInfo");

            if (SQLBase.ExecuteNonQuery(conSql) <= 0)
            {
                err = "消费信息添加失败";
                return(false);
            }
            if (yk > 0)
            {
                string sql = "update ClientPayInfo set Money = Money-" + yk + " where ClienName ='" + payInfo.PayCompany + "'";
                if (SQLBase.ExecuteNonQuery(sql) <= 0)
                {
                    err = "更新余额失败";
                    return(false);
                }
            }
            string YYCode  = "";
            string Content = "";

            for (int i = 0; i < list.Count; i++)
            {
                YYCode  += list[i].YYCode + ",";
                Content += "缴费,缴费状态为" + list[i].Type + ",";
            }
            if (!insertLog(YYCode.Substring(0, YYCode.Length - 1), Content.Substring(0, Content.Length - 1)))
            {
                err = "更新日志失败";
                return(false);
            }
            return(true);
        }
예제 #3
0
        public static bool UpdatePayInfo(PayInfo payInfo, string YYCode, ref string err)
        {
            string sql   = "select PayType from PayInfo where payId='" + payInfo.PayId + "'";
            string pType = SQLBase.ExecuteScalar(sql).ToString();

            string paySql = GSqlSentence.GetUpdateInfoByD <PayInfo>(payInfo, "PayId", "PayInfo");

            if (SQLBase.ExecuteNonQuery(paySql) <= 0)
            {
                err = "缴费信息更新失败";
                return(false);
            }
            sql = "update ConsumptionInfo set type=" + payInfo.PayType + " where PayId='" + payInfo.PayId + "'";
            if (SQLBase.ExecuteNonQuery(sql) <= 0)
            {
                err = "消费信息更新失败";
                return(false);
            }

            if (pType != payInfo.PayType && payInfo.PayType == "2")
            {
                sql = "select ClienName from ClientPayInfo where ClienName = '" + payInfo.PayCompany + "'";
                DataTable dt = SQLBase.FillTable(sql);
                if (dt.Rows.Count > 0)
                {
                    sql = "update ClientPayInfo set Money = Money+" + payInfo.PayMoney + " where ClienName = '" + payInfo.PayCompany + "'";
                    if (SQLBase.ExecuteNonQuery(sql) <= 0)
                    {
                        return(false);
                    }
                }
                else
                {
                    sql = "insert into ClientPayInfo(ClienName,Money) values('" + payInfo.PayCompany + "'," + payInfo.PayMoney + ")";
                    if (SQLBase.ExecuteNonQuery(sql) <= 0)
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
예제 #4
0
 public static bool UpdatePayInfo(PayInfo payInfo, string YYCode, ref string err)
 {
     return(MandateInfoPro.UpdatePayInfo(payInfo, YYCode, ref err));
 }
예제 #5
0
 public static bool SavePayInfo(PayInfo payInfo, List <ConsumptionInfo> list, double yk, ref string err)
 {
     return(MandateInfoPro.SavePayInfo(payInfo, list, yk, ref err));
 }