/// <summary> /// 删除发货单方法 /// </summary> /// <param name="storeId"></param> /// <returns></returns> public static Boolean DelGoodsOrder(string storeOrderID) { Boolean temp = true; string connString = DBHelper.connString; SqlTransaction tr = null; SqlConnection conn = new SqlConnection(connString); conn.Open(); tr = conn.BeginTransaction(); try { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("StoreOrder", "storeOrderID"); cl_h_info.AddRecordtran(tr, storeOrderID); cl_h_info.DeletedIntoLogstran(tr, BLL.CommonClass.ChangeCategory.Order, storeOrderID, BLL.CommonClass.ENUM_USERTYPE.Company); StockDAL.DelGoodsOrder(tr, OrderDetailDAL.GetOrderDetail(storeOrderID), StoreOrderDAL.GetStoreIdByOrderId(storeOrderID)); //还原店库存 OrderDetailDAL.DelOrderDetailItem(tr, storeOrderID); //明细表删除失败回滚 StoreOrderDAL.DelStoreOrder(storeOrderID, tr); //订单表删除失败回滚 tr.Commit(); } catch { temp = false; tr.Rollback(); } finally { // tr.Connection.Close(); tr.Dispose(); conn.Close(); } return(temp); }
/// <summary> /// 删除指定的适用人群信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbtDelete_Command(object sender, CommandEventArgs e) { int productSexTypeId = Convert.ToInt32(e.CommandArgument); BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("ProductSexType", "ProductSexTypeID"); //Judge the ProductSexTypeId whether exist by Id before delete or update int isExistCount = SetParametersBLL.ProductSexTypeIdIsExist(productSexTypeId); if (isExistCount > 0) { //Judge the ProductSexTypeId whether has operation before delete by Id int getCount = SetParametersBLL.ProductSexTypeIdWhetherHasOperation(productSexTypeId); if (getCount > 0) { Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002220", "对不起,该适用人群已经发生了业务,因此不能删除!"))); divProductSexType.Visible = false; return; } else { //Delete the ProductSexType information by productSexTypeId using (SqlConnection conn = new SqlConnection(DBHelper.connString)) { conn.Open(); using (SqlTransaction tran = conn.BeginTransaction()) { try { cl_h_info.AddRecordtran(tran, productSexTypeId.ToString()); SetParametersBLL.DelProductSexTypeByID(tran, productSexTypeId); language.RemoveTranslationRecord(tran, "ProductSexType", productSexTypeId); cl_h_info.DeletedIntoLogstran(tran, ChangeCategory.company28, Session["Company"].ToString(), ENUM_USERTYPE.objecttype9); tran.Commit(); } catch { tran.Rollback(); Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002223", "删除适用人群失败,请联系管理员!"))); return; } Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002222", "删除适用人群成功!"))); } } } } else { divProductSexType.Visible = false; Page.ClientScript.RegisterStartupScript(GetType(), "", Transforms.ReturnAlert(GetTran("002219", "对不起,该适用人群不存在或者已经被删除!"))); return; } DataBindProductSexType(); }
/// <summary> /// 删除复消单 /// </summary> public string DelOredrAgain(string orderId, double totalPv, string number, int except, string storeId) { double totalMoney = AddOrderDataDAL.GetTotalMoneyByOrderId(orderId); MemberOrderModel order = MemberOrderDAL.GetMemberOrder(orderId); string info = null; using (SqlConnection conn = new SqlConnection(DAL.DBHelper.connString)) { conn.Open(); SqlTransaction tran = conn.BeginTransaction(); try { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("memberorder", "orderid"); //实例日志类 cl_h_info.AddRecordtran(tran, orderId); //添加日志,修改前记录原来数据 //如果该订单不存在 if (!BrowsememberordersDAL.CheckOrderIdExists(orderId)) { info = BLL.Translation.Translate("001661", "抱歉,该订单不存在!"); tran.Rollback(); conn.Close(); return(info); } if (order.DefrayState == 1) { if (totalMoney > 0) { D_AccountBLL.AddAccount(storeId, totalMoney, D_AccountSftype.StoreType, D_AccountKmtype.OrderDelete, DirectionEnum.AccountsIncreased, "会员【" + number + "】报单删除现金扣添加,订单号为【" + orderId + "】", tran); if (order.DefrayType == 2) { IsElecPay(tran, order); D_AccountBLL.AddAccount(order.Number, Convert.ToDouble(order.TotalMoney), D_AccountSftype.MemberType, D_AccountKmtype.OrderUpdateIn, DirectionEnum.AccountsIncreased, "会员【" + order.Number + "】报单删除现金扣添加,订单号为【" + order.OrderId + "】", tran); D_AccountBLL.AddAccount(order.StoreId, Convert.ToDouble(order.TotalMoney), D_AccountSftype.StoreType, D_AccountKmtype.OrderUpdateOut, DirectionEnum.AccountReduced, "会员【" + order.Number + "】报单删除现金添加扣,订单号为【" + order.OrderId + "】", tran, true); } } int result = addOrderDataDAL.Js_delfuxiao(number, totalPv, except, 1, tran); } //删除复消单 addOrderDataDAL.Del_Horder(tran, orderId, storeId, CommonDataBLL.OperateBh, CommonDataBLL.OperateIP); cl_h_info.DeletedIntoLogstran(tran, BLL.CommonClass.ChangeCategory.store1, orderId, BLL.CommonClass.ENUM_USERTYPE.objecttype5);//插入日志 tran.Commit(); } catch { info = BLL.Translation.Translate("000417", "删除失败!"); tran.Rollback(); } finally { conn.Close(); conn.Dispose(); } } return(info); }
/// <summary> /// 删除订单方法 /// </summary> /// <param name="storeId"></param> /// <returns></returns> public static Boolean DelStoreOrderItem(string storeOrderID) { Boolean temp = true; string connString = DBHelper.connString; SqlTransaction tr = null; SqlConnection conn = new SqlConnection(connString); conn.Open(); tr = conn.BeginTransaction(); try { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("OrderGoods", "ordergoodsID"); cl_h_info.AddRecordtran(tr, storeOrderID); BLL.CommonClass.ChangeLogs cl_h_info2 = new BLL.CommonClass.ChangeLogs("OrderGoodsDetail", "ordergoodsID"); cl_h_info2.AddRecordtran(tr, storeOrderID); StoreOrderDAL.DelStoreOrderItemProc(tr, storeOrderID); //StockDAL.DelStoreOrder(tr, OrderDetailDAL.GetOrderGoodsDetail(storeOrderID), StoreOrderDAL.GetStoreIdByGoodsId(storeOrderID));//还原店库存 //OrderDetailDAL.DelOrderGoodsDetail(tr, storeOrderID);//明细表删除失败回滚 //StoreOrderDAL.DelOrderGoods(storeOrderID, tr); //订单表删除失败回滚 cl_h_info.AddRecordtran(tr, storeOrderID); cl_h_info.DeletedIntoLogstran(tr, BLL.CommonClass.ChangeCategory.store10, storeOrderID, BLL.CommonClass.ENUM_USERTYPE.objecttype2); cl_h_info2.AddRecordtran(tr, storeOrderID); cl_h_info2.DeletedIntoLogstran(tr, BLL.CommonClass.ChangeCategory.store10, storeOrderID, BLL.CommonClass.ENUM_USERTYPE.objecttype2); tr.Commit(); } catch { temp = false; tr.Rollback(); } finally { // tr.Connection.Close(); tr.Dispose(); conn.Close(); } return(temp); }
protected void Button1_Click(object sender, EventArgs e) { for (int i = 0; i < this.GridView1.Rows.Count; i++) { if ((this.GridView1.Rows[i].FindControl("CheckBox1") as CheckBox).Checked) { string ss = ((HiddenField)GridView1.Rows[i].FindControl("HiddenField1")).Value; using (SqlConnection con = new SqlConnection(DAL.DBHelper.connString)) { con.Open(); SqlTransaction tran = con.BeginTransaction(); try { BLL.MobileSMS sms = new BLL.MobileSMS(); BLL.CommonClass.ChangeLogs cl = new BLL.CommonClass.ChangeLogs("h_mobileMsg", "ltrim(rtrim(str(id)))"); cl.AddRecordtran(tran, ss); sms.DelSMS(tran, ss); cl.AddRecordtran(tran, ss); cl.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company65, Session["Company"].ToString(), BLL.CommonClass.ENUM_USERTYPE.objecttype10); tran.Commit(); } catch { tran.Rollback(); } finally { con.Close(); } } } } btnSearch_Click(null, null); }
public static string UpdateMemberOrder(string OrderId, IList <MemberDetailsModel> list, MemberOrderModel memberOrderModel, string StoreID) { SqlConnection conn = new SqlConnection(DBHelper.connString); MemberOrderModel order = MemberOrderBLL.GetMemberOrder(memberOrderModel.OrderId); SqlTransaction tran = null; try { conn.Open(); tran = conn.BeginTransaction(); SqlCommand cmd = new SqlCommand(); cmd.Transaction = tran; cmd.Connection = conn; DataTable dhpv = DBHelper.ExecuteDataTable(tran, "select totalpv,LackProductMoney from MemberOrder where OrderID='" + OrderId + "'"); if (memberOrderModel.PayExpect != -1 && memberOrderModel.DefrayState == 1) { if (Convert.ToDecimal(dhpv.Rows[0]["totalpv"]) != memberOrderModel.TotalPv) { //修改后需重新结算 cmd.CommandText = "update config set jsflag='0' where ExpectNum>='" + memberOrderModel.PayExpect + "'"; cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); } } if (memberOrderModel.DefrayState == 1) { decimal oldlackproductmoney = Convert.ToDecimal(dhpv.Rows[0]["LackProductMoney"]); if (memberOrderModel.LackProductMoney != oldlackproductmoney) { D_AccountBLL.AddAccount(StoreID, Convert.ToDouble(oldlackproductmoney), D_AccountSftype.StoreType, D_AccountKmtype.OrderUpdateIn, DirectionEnum.AccountsIncreased, "店铺[" + StoreID + "]修改订单[" + order.OrderId + "]退回钱[" + oldlackproductmoney + "]", tran); //D_AccountBLL.AddAccount(StoreID, Convert.ToDouble(memberOrderModel.LackProductMoney), D_AccountSftype.StoreType, D_AccountKmtype.OrderUpdateOut, DirectionEnum.AccountReduced, "店铺[" + StoreID + "]修改订单[" + memberOrderModel.OrderId + "]扣除钱[" + memberOrderModel.LackProductMoney + "]", tran); if (order.DefrayType == 2) { new MemberOrderBLL().IsElecPay(tran, order); D_AccountBLL.AddAccount(order.Number, Convert.ToDouble(order.LackProductMoney), D_AccountSftype.MemberType, D_AccountKmtype.OrderUpdateIn, DirectionEnum.AccountsIncreased, "会员【" + order.Number + "】报单修改现金扣添加,订单号为【" + order.OrderId + "】", tran); D_AccountBLL.AddAccount(order.StoreId, Convert.ToDouble(order.LackProductMoney), D_AccountSftype.StoreType, D_AccountKmtype.OrderUpdateOut, DirectionEnum.AccountReduced, "会员【" + order.Number + "】报单修改现金添加扣,订单号为【" + order.OrderId + "】", tran, true); } } } int res = 0; SqlParameter[] del_parm = { new SqlParameter("@OrderID", OrderId), new SqlParameter("@StoreID", StoreID), new SqlParameter("@Type", 1), new SqlParameter("@res", res), new SqlParameter("@opnum", memberOrderModel.OperateNumber), new SqlParameter("@opip", memberOrderModel.OperateIp), }; BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("MemberOrder", "ltrim(rtrim(OrderID))"); cl_h_info.AddRecordtran(tran, OrderId); BLL.CommonClass.ChangeLogs cl_h_info1 = new BLL.CommonClass.ChangeLogs("MemberDetails", "ltrim(rtrim(OrderID))"); cl_h_info1.AddRecordtran(tran, OrderId); DBHelper.ExecuteNonQuery(tran, "Delete_H_Order", del_parm, CommandType.StoredProcedure); if (Convert.ToInt32(del_parm[3].Value) == 0) { //添加订单 new AddOrderBLL().SaveHOrder(tran, list, memberOrderModel); cl_h_info.AddRecordtran(tran, OrderId); cl_h_info1.AddRecordtran(tran, OrderId); if (Convert.ToInt32(DAL.DBHelper.ExecuteScalar(tran, "select count(1) from MemberDetails where OrderId='" + OrderId + "'", CommandType.Text)) > 0) { cl_h_info.ModifiedIntoLogstran(tran, ChangeCategory.Order, OrderId, ENUM_USERTYPE.objecttype5); cl_h_info1.ModifiedIntoLogstran(tran, ChangeCategory.Order, OrderId, ENUM_USERTYPE.objecttype5); } tran.Commit(); return("1"); } else { tran.Rollback(); return("-2"); } } catch (Exception ee) { tran.Rollback(); return("-2"); } finally { conn.Close(); conn.Dispose(); } }
/// <summary> /// 确认订单按钮 /// </summary> /// <param name="storeId"></param> /// <returns></returns> public Boolean OrderSubmit(string storeId, List <OrderDetailModel> orderDetails, OrderGoodsMedel storeItem, bool IsEdit) { using (SqlConnection conn = new SqlConnection(DBHelper.connString)) { conn.Open(); SqlTransaction tr = conn.BeginTransaction();//开启事务 try { if (IsEdit) //如果是修改订单,先删除原来的订单并还原原来的信息 { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("OrderGoods", "OrderGoodsID"); //实例日志类 cl_h_info.AddRecordtran(tr, storeItem.OrderGoodsID); //添加日志,修改前记录原来数据 StoreOrderDAL.DelStoreOrderItemProc(tr, storeItem.OrderGoodsID); //StockDAL.DelStoreOrder(tr, OrderDetailDAL.GetOrderGoodsDetail(storeItem.StoreorderId), storeItem.StoreId);//还原店库存 //OrderDetailDAL.DelOrderGoodsDetail(tr, storeItem.StoreorderId);//明细表删除失败回滚 //StoreOrderDAL.DelOrderGoods(storeItem.StoreorderId, tr); //订单表删除失败回滚 cl_h_info.AddRecordtran(tr, storeItem.OrderGoodsID); //添加日志,修改后记录原来数据 cl_h_info.ModifiedIntoLogstran(tr, BLL.CommonClass.ChangeCategory.store10, storeItem.OrderGoodsID, BLL.CommonClass.ENUM_USERTYPE.objecttype2); //插入日志 } //插入订单 if (new StoreOrderDAL().AddOrderGoods(storeItem, tr)) { //订单表插入成功插入明细表 foreach (OrderDetailModel orderDetailItem in orderDetails) { if (!OrderDetailDAL.AddOrderGoodsDetail(tr, orderDetailItem, storeItem.OrderGoodsID)) { tr.Rollback(); return(false); } } //修改库存信息(预订数量) foreach (OrderDetailModel orderDetailItem in orderDetails) { if (!StockDAL.UpdStockHasOrderCount(tr, storeItem.StoreId, orderDetailItem.ProductId, orderDetailItem.Quantity)) { tr.Rollback(); return(false); } } tr.Commit();//插入订单信息完成 } else {//订单插入失败回滚数据 tr.Rollback(); return(false); } } catch { //订单插入失败回滚数据 tr.Rollback(); return(false); } finally { conn.Close(); } } return(true); }
/// <summary> /// 修改推荐或者安置编号 /// </summary> /// <param name="number">会员编号</param> /// <param name="placement">新安置</param> /// <param name="direct">新推荐</param> /// <param name="oldplacement">原安置</param> /// <param name="olddirect">原推荐</param> /// <returns></returns> public static string UpdateNet(string number, string placement, string direct, string oldplacement, string olddirect, int qushu, int flag, out bool isPass) { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("MemberInfo", "Number");//申明日志对象 using (SqlConnection conn = new SqlConnection(DBHelper.connString)) { conn.Open(); SqlTransaction tran = conn.BeginTransaction(); try { int xs = 0; string info = ""; try { /* * @bianhao nvarchar(20), --调网编号 * @srcAnZhi nvarchar(20), --原安置 * @dirAnZhi nvarchar(20), --新安置 * @srcTuiJian nvarchar(20), --原推荐 * @dirTuiJian nvarchar(20), --新推荐 * @azXianShu int, --0:表示无限制,大于0则表示最大的线数 * @info nvarchar(200) output --失败时返回错误信息,反之返回'OK' */ info = TempHistoryDAL.ChangeCheck(number, placement, direct, oldplacement, olddirect, qushu, tran, xs, info); if (info != "OK") { isPass = false; return(info); } int maxExpectNum = CommonDataBLL.GetNumberRegExpect(number); //调层位序号 //@bianhao varchar(20), --编号 //@old varchar(20),--原位置 //@new varchar(20),--新位置 //@IsAz bit, --0:推荐;1:安置 //@qishu int --调网期 TempHistoryDAL.UpdateNet(number, placement, direct, tran, maxExpectNum, flag); int count = TempHistoryDAL.UpdateMemberinfo(number, placement, direct, tran); if (count == 0) { isPass = false; tran.Rollback(); return("修改失败!"); } count = TempHistoryDAL.UpdateConfig(maxExpectNum, tran); if (count == 0) { isPass = false; tran.Rollback(); return("修改失败!"); } cl_h_info.AddRecordtran(tran, number); if (System.Web.HttpContext.Current.Session["Company"] != null) { cl_h_info.ModifiedIntoLogstran(tran, CommonClass.ChangeCategory.Order, number, BLL.CommonClass.ENUM_USERTYPE.objecttype5); } else if (System.Web.HttpContext.Current.Session["Store"] != null) { cl_h_info.ModifiedIntoLogstran(tran, CommonClass.ChangeCategory.Order, number, BLL.CommonClass.ENUM_USERTYPE.objecttype5); } } catch (Exception ex) { isPass = false; string assdgs = ex.Message; tran.Rollback(); return(assdgs); } tran.Commit(); isPass = true; return("修改成功!"); } catch { tran.Rollback(); throw; } finally { conn.Close(); conn.Dispose(); } } }
/// <summary> /// 删除报单信息 /// </summary> /// <param name="strId">报单编号</param> /// <param name="maxExcept">当前期数</param> /// <returns></returns> public string DelMembersDeclaration(string number, int maxExcept, string orderId, string storeId, double lackproductmoney) { OrderDAL orderDAL = new OrderDAL(); string info = null; MemberOrderModel order = MemberOrderDAL.GetMemberOrder(orderId); BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("memberinfo", "number"); //申明日志对象 BLL.CommonClass.ChangeLogs cl_h_order = new BLL.CommonClass.ChangeLogs("MemberOrder", "orderId"); //申明日志对象 using (SqlConnection conn = new SqlConnection(DBHelper.connString)) { conn.Open(); SqlTransaction tran = conn.BeginTransaction(); try { //判断会员下是否有安置 //全球统一可以删除有下级的会员,如果有两个下级则注销,有一个下级则紧缩 info = new AddOrderBLL().GetHavePlace(number, tran); if (info != null) { tran.Rollback(); conn.Close(); return(info); } ////判断会员下是否有推荐 info = new AddOrderBLL().GetHaveDirect(number, tran); if (info != null) { tran.Rollback(); conn.Close(); return(info); } int cnt = new AddOrderBLL().GetHaveStore(number, tran); if (cnt > 0) { info = this.GetTran("007097", "抱歉!该会员已经注册店铺,不可以删除!");// "抱歉!该会员有重复消费请先删除重复消费!"; tran.Rollback(); conn.Close(); return(info); } //判断该会员是否有复效单 int result = browsememberordersDAL.GetHasOrderAgain(number); if (result > 0) { info = this.GetTran("000976", "抱歉!该会员有重复消费请先删除重复消费!");// "抱歉!该会员有重复消费请先删除重复消费!"; tran.Rollback(); conn.Close(); return(info); } else { string electronicaccountid = order.ElectronicaccountId;; int defrayState = order.DefrayState; int defrayType = order.DefrayType; //if (defrayState == 1) //{ // if (lackproductmoney > 0) // { // int deliveryflag = BLL.Logistics.D_AccountBLL.GetDeliveryflag(orderId, tran); // if (deliveryflag == 0) // { // if (defrayType == 2) // { // IsElecPay(tran, order); // BLL.Logistics.D_AccountBLL.AddAccount(storeId, lackproductmoney, D_AccountSftype.StoreType, D_AccountKmtype.OrderDelete, DirectionEnum.AccountsIncreased, "会员【" + number + "】报单删除现金返还,订单号为【" + orderId + "】", tran); // BLL.Logistics.D_AccountBLL.AddAccount(electronicaccountid, lackproductmoney, D_AccountSftype.MemberType, D_AccountKmtype.OrderDelete, DirectionEnum.AccountsIncreased, "会员【" + number + "】报单删除现金返还,订单号为【" + orderId + "】", tran); // } // else if (defrayType == 1) // { // BLL.Logistics.D_AccountBLL.AddAccount(storeId, lackproductmoney, D_AccountSftype.StoreType, D_AccountKmtype.OrderDelete, DirectionEnum.AccountsIncreased, "会员【" + number + "】报单删除现金扣添加,订单号为【" + orderId + "】", tran); // } // } // } //} // cl_h_info.DeletedIntoLogstran(tran, CommonClass.ChangeCategory.Order, storeId, BLL.CommonClass.ENUM_USERTYPE.objecttype5); browsememberordersDAL.DelNew(number, maxExcept, tran); //添加日志 cl_h_info.AddRecordtran(tran, number); cl_h_order.AddRecordtran(tran, orderId); cl_h_order.DeletedIntoLogstran(tran, CommonClass.ChangeCategory.Order, storeId, BLL.CommonClass.ENUM_USERTYPE.objecttype5); addOrderDataDAL.Del_Horder(tran, orderId, storeId, CommonDataBLL.OperateBh, CommonDataBLL.OperateIP); ///删除后,把推荐或安置是他的err赋上值 int checkResult = addOrderDataDAL.Check_WhenDelete(tran, number); } tran.Commit(); } catch (Exception ext) { info = this.GetTran("000985", "抱歉!系统异常");// "抱歉!系统异常"; tran.Rollback(); conn.Close(); return(info); } finally { conn.Close(); conn.Dispose(); } } return(info); }
/// <summary> /// 添加订单信息 /// </summary> /// <param name="mode"></param> /// <param name="memberOrderModel"></param> /// <param name="totalPv"></param> /// <param name="except"></param> /// <param name="memberDetailsModel"></param> /// <param name="storeInfoModel"></param> public static bool AddOrderData(bool isEdit, MemberOrderModel memberOrderModel, IList <MemberDetailsModel> list) { bool state = false; using (SqlConnection conn = new SqlConnection(DBHelper.connString)) { conn.Open(); SqlTransaction tran = conn.BeginTransaction(); try { //如果是编辑 if (isEdit) { BLL.CommonClass.ChangeLogs cl_h_info = new BLL.CommonClass.ChangeLogs("memberorder", "orderid"); //实例日志类 cl_h_info.AddRecordtran(tran, memberOrderModel.OrderId); //添加日志,修改前记录原来数据 MemberOrderModel order = MemberOrderBLL.GetMemberOrder(memberOrderModel.OrderId); if (order.LackProductMoney > 0) { D_AccountBLL.AddAccount(order.StoreId, Convert.ToDouble(order.LackProductMoney), D_AccountSftype.StoreType, D_AccountKmtype.OrderUpdateIn, DirectionEnum.AccountsIncreased, "会员【" + order.Number + "】报单修改现金扣添加,订单号为【" + order.OrderId + "】", tran); if (order.DefrayType == 2) { new Registration_declarations.MemberOrderAgainBLL().IsElecPay(tran, order); D_AccountBLL.AddAccount(order.Number, Convert.ToDouble(order.LackProductMoney), D_AccountSftype.MemberType, D_AccountKmtype.OrderUpdateIn, DirectionEnum.AccountsIncreased, "会员【" + order.Number + "】报单修改现金扣添加,订单号为【" + order.OrderId + "】", tran); D_AccountBLL.AddAccount(order.StoreId, Convert.ToDouble(order.LackProductMoney), D_AccountSftype.StoreType, D_AccountKmtype.OrderUpdateOut, DirectionEnum.AccountReduced, "会员【" + order.Number + "】报单修改现金添加扣,订单号为【" + order.OrderId + "】", tran, true); } } int delResult = new AddOrderDataDAL().Del_Horder(tran, memberOrderModel.OrderId, memberOrderModel.StoreId, CommonDataBLL.OperateBh, CommonDataBLL.OperateIP); if (memberOrderModel.DefrayState == 1)//店铺复消减去业绩 { int js_delfuxiao_Result = new AddOrderDataDAL().Js_delfuxiao(memberOrderModel.Number, Convert.ToDouble(memberOrderModel.TotalPv), memberOrderModel.PayExpect, memberOrderModel.DefrayState, tran); } cl_h_info.ModifiedIntoLogstran(tran, ChangeCategory.Order, memberOrderModel.OrderId, ENUM_USERTYPE.objecttype5);//插入日志 } //添加订单 new AddOrderBLL().SaveHOrder(tran, list, memberOrderModel); //顾客购物业绩上传(注意支付money要改) if (memberOrderModel.DefrayState == 1) { new AddOrderDataDAL().Js_addfuxiao(memberOrderModel.Number, Convert.ToDouble(memberOrderModel.TotalPv), memberOrderModel.PayExpect, memberOrderModel.DefrayState, tran); CommonDataBLL.SetMemberLevel(tran, memberOrderModel.Number, memberOrderModel.OrderId); } state = true; tran.Commit(); } catch { tran.Rollback(); } finally { conn.Close(); conn.Dispose(); } } return(state); }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { string id = e.CommandArgument.ToString(); if (e.CommandName == "Del") { using (SqlConnection con = new SqlConnection(DAL.DBHelper.connString)) { con.Open(); SqlTransaction tran = con.BeginTransaction(); try { BLL.MobileSMS sms = new BLL.MobileSMS(); BLL.CommonClass.ChangeLogs cl = new BLL.CommonClass.ChangeLogs("h_mobileMsg", "ltrim(rtrim(str(id)))"); cl.AddRecordtran(tran, id); sms.DelSMS(tran, id); cl.AddRecordtran(tran, id.ToString()); cl.DeletedIntoLogs(BLL.CommonClass.ChangeCategory.company65, Session["Company"].ToString(), BLL.CommonClass.ENUM_USERTYPE.objecttype10); tran.Commit(); ClientScript.RegisterStartupScript(this.GetType(), "", "alert('" + BLL.Translation.Translate("000008", "删除成功") + "')", true); btnSearch_Click(null, null); } catch { tran.Rollback(); ClientScript.RegisterStartupScript(this.GetType(), "", "alert('" + BLL.Translation.Translate("000009", "删除失败") + "')", true); } finally { con.Close(); } } } if (e.CommandName == "AgainSend") { string info = ""; string[] AllValue = e.CommandArgument.ToString().Split(','); string CommName = e.CommandArgument.ToString(); using (SqlConnection con = new SqlConnection(DAL.DBHelper.connString)) { con.Open(); SqlTransaction tran = con.BeginTransaction(); try { BLL.MobileSMS sms = new BLL.MobileSMS(); BLL.MobileSMS.SendMsgTo(tran, AllValue[2], AllValue[2], AllValue[1], AllValue[3], out info, (Model.SMSCategory)Convert.ToInt32(AllValue[4])); sms.DelSMS(tran, AllValue[0]); tran.Commit(); //BLL.MobileSMS.SendMsgTo(tran, bianhao, bianhao, mobile, msg, out info, Model.SMSCategory.sms_ManualSent); ClientScript.RegisterStartupScript(this.GetType(), "", "alert('" + info + "');", true); btnSearch_Click(null, null); } catch { tran.Rollback(); ClientScript.RegisterStartupScript(this.GetType(), "", "alert('" + info + "');", true); } finally { con.Close(); } } } }