Ejemplo n.º 1
0
    protected void btnReturnProduct_Click(object sender, EventArgs e)
    {
        if (hdnSelectedSubOrderIDs.Value != "" && hdnOrderId.Value != "")
        {
            string strIds = hdnSelectedSubOrderIDs.Value.Trim().TrimEnd(',');
            if (strIds != "")
            {
                string[] arIDs = strIds.Split(',');
                if (arIDs.Length > 0)
                {
                    tblReturnOrder objReturnOrder = new tblReturnOrder();
                    objReturnOrder.AddNew();
                    objReturnOrder.s_AppOrderID                = hdnOrderId.Value;
                    objReturnOrder.AppReason                   = ddlReason.SelectedValue;
                    objReturnOrder.AppNote                     = txtNote.Text;
                    objReturnOrder.s_AppRequestedDate          = GetCurrentDateTime().ToString();
                    objReturnOrder.AppReturnStatus             = Convert.ToInt32(Enums.Enum_ReturnStatus.Requested);
                    objReturnOrder.s_AppPreviousSubOrderStatus = hdnPrevStatus.Value;
                    objReturnOrder.s_AppPickupName             = txtPickupName.Text;
                    objReturnOrder.s_AppPickupContactNo1       = txPickupMobile1.Text;
                    objReturnOrder.s_AppPickupContactNo2       = txtPickupMobile2.Text;
                    objReturnOrder.s_AppPickupAddress          = txtPickupAddress.Text;
                    objReturnOrder.s_AppPickupPIN              = txtPickupPIN.Text;
                    objReturnOrder.s_AppPreferedTime           = txtPreferedTime.Text;
                    //objReturnOrder.s_AppDocketNo = txtDocketNo.Text;
                    objReturnOrder.Save();

                    for (int i = 0; i <= arIDs.Length - 1; i++)
                    {
                        if (!string.IsNullOrEmpty(arIDs.GetValue(i).ToString()))
                        {
                            tblReturnOrderDetail objReturnOrderDetail = new tblReturnOrderDetail();
                            objReturnOrderDetail.AddNew();
                            objReturnOrderDetail.s_AppSubOrderID  = arIDs.GetValue(i).ToString();
                            objReturnOrderDetail.AppReturnOrderID = objReturnOrder.AppReturnOrderID;
                            objReturnOrderDetail.Save();
                            objReturnOrderDetail = null;
                        }
                    }
                    objReturnOrder = null;
                    tblSubOrder objSubOrder = new tblSubOrder();
                    objSubOrder.SetSubOrderStatus(Convert.ToInt32(Enums.Enums_OrderStatus.Returned), strIds, GetCurrentDateTime().ToString());
                    objSubOrder                  = null;
                    ddlReason.SelectedValue      = "0";
                    txtNote.Text                 = "";
                    hdnSelectedSubOrderIDs.Value = "";
                    hdnOrderId.Value             = "";
                    DInfo.ShowMessage("Return Product Request Submitted.", Enums.MessageType.Successfull);
                    LoadMyorderList();
                }
            }
        }
        else
        {
            DInfo.ShowMessage("Choose Valid Product For Return Try again.", Enums.MessageType.Error);
        }
    }
Ejemplo n.º 2
0
 protected void dgvSubDetail_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
 {
     if (!string.IsNullOrEmpty(e.CommandArgument.ToString()))
     {
         if (e.CommandName.ToString() == "CancelOrder")
         {
             objSubOrder = new tblSubOrder();
             objSubOrder.SetSubOrderStatus(Convert.ToInt32(Enums.Enums_OrderStatus.CancelledByAdmin), e.CommandArgument.ToString(), GetCurrentDateTime().ToString(), Convert.ToInt32(Enums.Enums_OrderStatus.ReadyToShip).ToString());
             objSubOrder = null;
             //  SendMail(Convert.ToInt32(Enums.Enums_OrderStatus.CancelledByAdmin), e.CommandArgument.ToString());
             DInfo.ShowMessage("Order status has been  Cancel.", Enums.MessageType.Successfull);
             hdnSelectedIDs.Value = "";
             LoadDataGrid(true, false);
         }
     }
 }
Ejemplo n.º 3
0
 protected void btnCancel_Click(object sender, EventArgs e)
 {
     if (hdnSelectedSubOrderIDs.Value != "")
     {
         string      strIds      = hdnSelectedSubOrderIDs.Value.Trim().TrimEnd(',');
         tblSubOrder objSubOrder = new tblSubOrder();
         objSubOrder.SetSubOrderStatus(Convert.ToInt32(Enums.Enums_OrderStatus.CancelledByCustomer), strIds, GetCurrentDateTime().ToString());
         objSubOrder = null;
         hdnSelectedSubOrderIDs.Value = "";
         DInfo.ShowMessage("Product Order Cancelled.", Enums.MessageType.Successfull);
         LoadMyorderList();
     }
     else
     {
         DInfo.ShowMessage("Choose Valid Product For Cancel Try again.", Enums.MessageType.Error);
     }
 }