protected void DataListSubOrder_ItemCommand(object source, DataListCommandEventArgs e) { if (e.CommandArgument.ToString() != "") { if (e.CommandName == "ReturnAddress") { hdnReturnOrderID.Value = e.CommandArgument.ToString(); tblReturnOrder objReturnOrder = new tblReturnOrder(); if (objReturnOrder.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()))) { if (objReturnOrder.AppReturnStatus == Convert.ToInt32(Enums.Enum_ReturnStatus.Slip) && objReturnOrder.s_AppDocketNo != "") { if (objReturnOrder.AppReturnStatus == Convert.ToInt32(Enums.Enum_ReturnStatus.Approved)) { objReturnOrder.AppReturnStatus = Convert.ToInt32(Enums.Enum_ReturnStatus.Slip); objReturnOrder.Save(); } objEncrypt = new clsEncryption(); hdnReturnOrderID.Value = GetAlias("Productslip.aspx") + objEncrypt.Encrypt(objReturnOrder.s_AppReturnOrderID, appFunctions.strKey); objEncrypt = null; ScriptManager.RegisterStartupScript(UpMain, UpMain.GetType(), "myFunction", "CallProductInvoice();", true); } else { if (objReturnOrder.s_AppDocketNo != "") { txtDocketNo.Text = objReturnOrder.s_AppDocketNo; txtDocketNo.Enabled = false; } else { ddlCourierCompany.SelectedIndex = 0; txtCourierContactNo.Text = ""; txtSiteName.Text = ""; txtDocketNo.Text = ""; txtDocketNo.Enabled = true; } Mpeslip.Show(); } // Mpeslip.Show(); } objReturnOrder = null; } if (e.CommandName == "ReturnRequest") { tblSubOrder objTempSubOrder = new tblSubOrder(); objDataTable = objTempSubOrder.GetProductInvoiceInfo(e.CommandArgument.ToString()); if (objDataTable.Rows.Count > 0) { hdnPrevStatus.Value = objDataTable.Rows[0][tblSubOrder.ColumnNames.AppSubOrderStatusID].ToString(); txtPickupName.Text = objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverName].ToString(); txtPickupAddress.Text = objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverAddress].ToString(); txPickupMobile1.Text = objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverContactNo1].ToString(); txtPickupMobile2.Text = objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverContactNo2].ToString(); txtPickupPIN.Text = objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverPIN].ToString(); } objTempSubOrder = null; MpeReturnRequest.Show(); } if (e.CommandName == "Dispatch") { tblReturnOrder objReturnOrder = new tblReturnOrder(); if (objReturnOrder.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()))) { objReturnOrder.AppReturnStatus = Convert.ToInt32(Enums.Enum_ReturnStatus.Dispatched); objReturnOrder.Save(); objReturnOrder = null; } LoadMyorderList(); } } }