protected void btnDelivered_Click(object sender, System.EventArgs e) { if (hdnSelectedIDs.Value != "") { string[] arIDs = hdnSelectedIDs.Value.ToString().TrimEnd(',').Split(','); if (arIDs.Length > 0) { objSubOrder = new tblSubOrder(); //objSubOrder.SetOrderMoveToDelivered(Convert.ToInt32(Enums.Enums_OrderStatus.Shipped), Convert.ToInt32(Enums.Enums_OrderStatus.Delivered), hdnSelectedIDs.Value.ToString().TrimEnd(','), GetCurrentDateTime().ToString()); objSubOrder.SetOrderStatus(Convert.ToInt32(Enums.Enums_OrderStatus.Delivered), hdnSelectedIDs.Value.ToString().TrimEnd(','), GetCurrentDateTime().ToString(), Convert.ToInt32(Enums.Enums_OrderStatus.Shipped).ToString()); objSubOrder = null; for (int i = 0; i < arIDs.Length; i++) { if (arIDs[i].ToString() != "") { SendMail(Convert.ToInt32(Enums.Enums_OrderStatus.Delivered), arIDs[i].ToString()); } } DInfo.ShowMessage("Order status has been Change.", Enums.MessageType.Successfull); hdnSelectedIDs.Value = ""; UcOrderStratus.SetOrderCount(); LoadDataGrid(true, false); } else { DInfo.ShowMessage("Select any one Order for Delivered.", Enums.MessageType.Error); } } else { DInfo.ShowMessage("Select any one Order for Delivered.", Enums.MessageType.Error); } }
protected void btnCancelled_Click(object sender, EventArgs e) { if (hdnSelectedIDs.Value != "") { string[] arIDs = hdnSelectedIDs.Value.ToString().TrimEnd(',').Split(','); if (arIDs.Length > 0) { objSubOrder = new tblSubOrder(); objSubOrder.SetOrderStatus(Convert.ToInt32(Enums.Enums_OrderStatus.CancelledByAdmin), hdnSelectedIDs.Value.ToString().TrimEnd(','), GetCurrentDateTime().ToString()); objSubOrder.SetProductQty(hdnSelectedIDs.Value.ToString().TrimEnd(',')); objSubOrder = null; //for (int i = 0; i < arIDs.Length; i++) //{ // if (arIDs[i].ToString() != "") // { // SendMail(Convert.ToInt32(Enums.Enums_OrderStatus.CancelledByAdmin), arIDs[i].ToString()); // } //} DInfo.ShowMessage("Order status has been change ordered to Cancel status", Enums.MessageType.Successfull); hdnSelectedIDs.Value = ""; LoadDataGrid(true, false); } else { DInfo.ShowMessage("Order status has been change ordered to Cancel status", Enums.MessageType.Error); } } else { DInfo.ShowMessage("Select any one Order ", Enums.MessageType.Error); } }
protected void dgvCart_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandArgument.ToString() != "") { if (e.CommandName == "Cancel") { objSubOrder = new tblSubOrder(); objSubOrder.SetOrderStatus(Convert.ToInt32(Enums.Enums_OrderStatus.CancelledByCustomer), e.CommandArgument.ToString(), GetCurrentDateTime().ToString()); objSubOrder.SetProductQty(e.CommandArgument.ToString()); objSubOrder = null; LoadMyorderList(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckSession(); SetUpPageContent(ref metaDescription, ref metaKeywords); objCommon = new clsCommon(); try { string strOrderId = ""; bool IsSuccess = false; if (Session[appFunctions.Session.PaymetnOrderId.ToString()] != null) { if (Session[appFunctions.Session.PaymetnOrderId.ToString()].ToString() != "") { strOrderId = Session[appFunctions.Session.PaymetnOrderId.ToString()].ToString(); Session[appFunctions.Session.PaymetnOrderId.ToString()] = ""; Session[appFunctions.Session.PaymetnOrderId.ToString()] = null; } } if (Session[appFunctions.Session.PaymentTransactionId.ToString()] != null) { if (Session[appFunctions.Session.PaymentTransactionId.ToString()].ToString() != "") { Session[appFunctions.Session.PaymentTransactionId.ToString()] = ""; Session[appFunctions.Session.PaymentTransactionId.ToString()] = null; } } if (strOrderId != "") { tblOrder objOrder = new tblOrder(); if (objOrder.LoadByPrimaryKey(Convert.ToInt32(strOrderId))) { if (IsSuccess == false) { objOrder.AppPaymentStatus = Convert.ToInt32(Enums.Enums_PaymentStatus.Failure); objOrder.AppOrderStatusID = Convert.ToInt32(Enums.Enums_OrderStatus.PaymentFail); tblSubOrder objSubOrder = new tblSubOrder(); objSubOrder.SetOrderStatus(Convert.ToInt32(Enums.Enums_OrderStatus.PaymentFail), strOrderId, GetCurrentDateTime().ToString(), Convert.ToInt32(Enums.Enums_OrderStatus.PaymentFail).ToString()); objSubOrder = null; objOrder.Save(); try { SendMail(objOrder.s_AppOrderNo, objOrder.s_AppReceiverName, objOrder.s_AppReceiverContactNo1, objOrder.s_AppRecevierEmail, IsSuccess, objOrder.s_AppTransactionID, objOrder.s_AppBankRefNo); } catch (Exception ex) { Response.Write(ex); } objOrder = null; objOrder = new tblOrder(); objDataTable = objOrder.LoadMyOrderList(Session[appFunctions.Session.ClientUserID.ToString()].ToString(), "", strOrderId); objOrder = null; DataListMyOrder.DataSource = null; DataListMyOrder.DataBind(); if (objDataTable.Rows.Count > 0) { DataListMyOrder.DataSource = objDataTable; DataListMyOrder.DataBind(); } } } objOrder = null; } } catch (Exception ex) { } objCommon = null; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckSession(); SetUpPageContent(ref metaDescription, ref metaKeywords); objCommon = new clsCommon(); try { string[] merc_hash_vars_seq; string merc_hash_string = string.Empty; string merc_hash = string.Empty; string order_id = string.Empty; string strOrderId = ""; string strTransactionId = ""; bool IsSuccess = false; if (Session[appFunctions.Session.PaymetnOrderId.ToString()] != null) { if (Session[appFunctions.Session.PaymetnOrderId.ToString()].ToString() != "") { strOrderId = Session[appFunctions.Session.PaymetnOrderId.ToString()].ToString(); Session[appFunctions.Session.PaymetnOrderId.ToString()] = ""; Session[appFunctions.Session.PaymetnOrderId.ToString()] = null; } } if (Session[appFunctions.Session.PaymentTransactionId.ToString()] != null) { if (Session[appFunctions.Session.PaymentTransactionId.ToString()].ToString() != "") { strTransactionId = Session[appFunctions.Session.PaymentTransactionId.ToString()].ToString(); Session[appFunctions.Session.PaymentTransactionId.ToString()] = ""; Session[appFunctions.Session.PaymentTransactionId.ToString()] = null; } } if (Request.Form["status"] == "success") { merc_hash_vars_seq = appFunctions.hashSequence.Split('|'); Array.Reverse(merc_hash_vars_seq); merc_hash_string = appFunctions.SALT + "|" + Request.Form["status"]; foreach (string merc_hash_var in merc_hash_vars_seq) { merc_hash_string += "|"; merc_hash_string = merc_hash_string + (Request.Form[merc_hash_var] != null ? Request.Form[merc_hash_var] : ""); } // Response.Write(merc_hash_string); //return; merc_hash = objCommon.Generatehash512(merc_hash_string).ToLower(); if (merc_hash != Request.Form["hash"]) { //Response.Write("Hash value did not matched"); DInfo.ShowMessage("Your online payment Failed", BusinessLayer.Enums.MessageType.Error); IsSuccess = false; } else { IsSuccess = true; order_id = Request.Form["txnid"]; DInfo.ShowMessage("Your online payment is done successfully and your transction ID is " + order_id + "", BusinessLayer.Enums.MessageType.Successfull); } } else { //Response.Write("Hash value did not matched"); IsSuccess = false; DInfo.ShowMessage("Your online payment Failed", BusinessLayer.Enums.MessageType.Error); } if (strOrderId != "") { tblOrder objOrder = new tblOrder(); if (objOrder.LoadByPrimaryKey(Convert.ToInt32(strOrderId))) { objOrder.s_AppTransactionID = order_id; if (IsSuccess) { objOrder.AppPaymentStatus = Convert.ToInt32(Enums.Enums_PaymentStatus.success); string strDefaultOrderStatusID = ""; tblOrderStatus objStatus = new tblOrderStatus(); objStatus.Where.AppIsDefault.Value = true; objStatus.Query.Load(); if (objStatus.RowCount > 0) { strDefaultOrderStatusID = objStatus.s_AppOrderStatusID; } objStatus = null; objOrder.s_AppOrderStatusID = strDefaultOrderStatusID; tblSubOrder objSubOrder = new tblSubOrder(); objSubOrder.SetOrderStatus(Convert.ToInt32(Enums.Enums_OrderStatus.PaymentFail), strOrderId, GetCurrentDateTime().ToString(), strDefaultOrderStatusID); objSubOrder = null; } else { objOrder.AppPaymentStatus = Convert.ToInt32(Enums.Enums_PaymentStatus.Failure); objOrder.AppOrderStatusID = Convert.ToInt32(Enums.Enums_OrderStatus.PaymentFail); tblSubOrder objSubOrder = new tblSubOrder(); objSubOrder.SetOrderStatus(Convert.ToInt32(Enums.Enums_OrderStatus.PaymentFail), strOrderId, GetCurrentDateTime().ToString(), Convert.ToInt32(Enums.Enums_OrderStatus.Ordered).ToString()); objSubOrder = null; } objOrder.Save(); SendMail(objOrder.s_AppOrderNo, objOrder.s_AppReceiverName, objOrder.s_AppReceiverContactNo1, objOrder.s_AppRecevierEmail, IsSuccess, objOrder.s_AppTransactionID, objOrder.s_AppBankRefNo); objOrder = null; objOrder = new tblOrder(); objDataTable = objOrder.LoadMyOrderList(Session[appFunctions.Session.ClientUserID.ToString()].ToString(), "", strOrderId); DataListMyOrder.DataSource = null; DataListMyOrder.DataBind(); if (objDataTable.Rows.Count > 0) { DataListMyOrder.DataSource = objDataTable; DataListMyOrder.DataBind(); } } objOrder = null; } } catch (Exception ex) { } objCommon = null; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CheckSession(); SetUpPageContent(ref metaDescription, ref metaKeywords); objCommon = new clsCommon(); try { string strOrderId = ""; string strTransactionId = ""; string order_id = ""; string tracking_id = ""; string bank_ref_no = ""; string order_status = ""; string payment_mode = ""; string card_name = ""; string currency = ""; bool IsSuccess = false; if (Session[appFunctions.Session.PaymetnOrderId.ToString()] != null) { if (Session[appFunctions.Session.PaymetnOrderId.ToString()].ToString() != "") { strOrderId = Session[appFunctions.Session.PaymetnOrderId.ToString()].ToString(); Session[appFunctions.Session.PaymetnOrderId.ToString()] = ""; Session[appFunctions.Session.PaymetnOrderId.ToString()] = null; } } if (Session[appFunctions.Session.PaymentTransactionId.ToString()] != null) { if (Session[appFunctions.Session.PaymentTransactionId.ToString()].ToString() != "") { strTransactionId = Session[appFunctions.Session.PaymentTransactionId.ToString()].ToString(); Session[appFunctions.Session.PaymentTransactionId.ToString()] = ""; Session[appFunctions.Session.PaymentTransactionId.ToString()] = null; } } CCACrypto ccaCrypto = new CCACrypto(); string encResponse = ccaCrypto.Decrypt(Request.Form["encResp"], appFunctions.strCCAvenueworkingKey); NameValueCollection Params = new NameValueCollection(); string[] segments = encResponse.Split('&'); foreach (string seg in segments) { string[] parts = seg.Split('='); if (parts.Length > 0) { string Key = parts[0].Trim(); string Value = parts[1].Trim(); Params.Add(Key, Value); } } for (int i = 0; i < Params.Count; i++) { if (Params.Keys[i].ToString().ToLower() == "order_id") { order_id = Params[i].ToString().ToLower(); } else if (Params.Keys[i].ToString().ToLower() == "tracking_id") { tracking_id = Params[i].ToString().ToLower(); } else if (Params.Keys[i].ToString().ToLower() == "bank_ref_no") { bank_ref_no = Params[i].ToString().ToLower(); } else if (Params.Keys[i].ToString().ToLower() == "order_status") { order_status = Params[i].ToString().ToLower(); } else if (Params.Keys[i].ToString().ToLower() == "payment_mode") { payment_mode = Params[i].ToString().ToLower(); } else if (Params.Keys[i].ToString().ToLower() == "card_name") { card_name = Params[i].ToString().ToLower(); } else if (Params.Keys[i].ToString().ToLower() == "currency") { currency = Params[i].ToString().ToLower(); } //Response.Write(Params.Keys[i] + " = " + Params[i] + "<br>"); } //Response.Write("order_id : " + order_id + "<br>"); //Response.Write("tracking_id : " + tracking_id + "<br>"); //Response.Write("bank_ref_no : " + bank_ref_no + "<br>"); //Response.Write("order_status : " + order_status + "<br>"); //Response.Write("payment_mode : " + payment_mode + "<br>"); //Response.Write("card_name : " + card_name + "<br>"); //Response.Write("currency : " + currency + "<br>"); if (order_status == "success") { IsSuccess = true; //DInfo.ShowMessage("You Successfull Pay for order.", BusinessLayer.Enums.MessageType.Successfull); } else { //DInfo.ShowMessage("Your online payment Failure.", BusinessLayer.Enums.MessageType.Error); } if (strOrderId != "") { tblOrder objOrder = new tblOrder(); if (objOrder.LoadByPrimaryKey(Convert.ToInt32(strOrderId))) { objOrder.s_AppTransactionID = order_id; objOrder.s_AppBankRefNo = bank_ref_no; objOrder.s_AppPaymentType = payment_mode; objOrder.s_AppCardName = card_name; objOrder.s_AppCurrency = currency; if (IsSuccess) { objOrder.AppPaymentStatus = Convert.ToInt32(Enums.Enums_PaymentStatus.success); string strDefaultOrderStatusID = ""; tblOrderStatus objStatus = new tblOrderStatus(); objStatus.Where.AppIsDefault.Value = true; objStatus.Query.Load(); if (objStatus.RowCount > 0) { strDefaultOrderStatusID = objStatus.s_AppOrderStatusID; } objStatus = null; objOrder.s_AppOrderStatusID = strDefaultOrderStatusID; tblSubOrder objSubOrder = new tblSubOrder(); objSubOrder.SetOrderStatus(Convert.ToInt32(strDefaultOrderStatusID), strOrderId, GetCurrentDateTime().ToString(), Convert.ToInt32(Enums.Enums_OrderStatus.PaymentFail).ToString()); objSubOrder = null; } else { objOrder.AppPaymentStatus = Convert.ToInt32(Enums.Enums_PaymentStatus.Failure); objOrder.AppOrderStatusID = Convert.ToInt32(Enums.Enums_OrderStatus.PaymentFail); tblSubOrder objSubOrder = new tblSubOrder(); objSubOrder.SetOrderStatus(Convert.ToInt32(Enums.Enums_OrderStatus.PaymentFail), strOrderId, GetCurrentDateTime().ToString(), Convert.ToInt32(Enums.Enums_OrderStatus.PaymentFail).ToString()); objSubOrder = null; } objOrder.Save(); SendMail(objOrder.s_AppOrderNo, objOrder.s_AppReceiverName, objOrder.s_AppReceiverContactNo1, objOrder.s_AppRecevierEmail, IsSuccess, objOrder.s_AppTransactionID, objOrder.s_AppBankRefNo); objOrder = null; objOrder = new tblOrder(); objDataTable = objOrder.LoadMyOrderList(Session[appFunctions.Session.ClientUserID.ToString()].ToString(), "", strOrderId); DataListMyOrder.DataSource = null; DataListMyOrder.DataBind(); if (objDataTable.Rows.Count > 0) { DataListMyOrder.DataSource = objDataTable; DataListMyOrder.DataBind(); } } objOrder = null; } } catch (Exception ex) { } objCommon = null; } }