Exemplo n.º 1
0
        /// <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);
            }
        }
Exemplo n.º 2
0
        //批量删除
        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);
            }
        }
Exemplo n.º 3
0
        /// <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);
            }
        }