protected void btnSubmit_Click(object sender, EventArgs e) { try { ATTInvDeliveryOrder objDo = new ATTInvDeliveryOrder(); objDo = (ATTInvDeliveryOrder)Session["objReturn"]; ATTInvReturnOrder objRo = new ATTInvReturnOrder(); objRo.OrgID = objDo.OrgID; //objRo.UnitID = objDo.UnitID; objRo.OrderNo = objDo.OrderNo; objRo.DeliverySeq = objDo.DeliverySeq; objRo.ReturnDate = txtReturnDate_RDT.Text; objRo.ReturnRemarks = txtReturnRemark_rqd.Text; objRo.LstReturnOrderDetail = SetReturOrderDetail(); objRo.EntryBy = entryBy; objRo.Action = "A"; if (updReturnFlag) { this.lblStatusMessageTitle.Text = "डेलिभरी सामान फिर्ता"; this.lblStatusMessage.Text = "कति वटा सामान फिर्ता गर्ने हो डाटा राख्नुहोस्।"; this.programmaticModalPopup.Show(); updReturnFlag = false; } else { if (BLLInvReturnOrder.SaveUpdateReturnOrder(objRo)) { ReloadSrchData(); Session["objReturn"] = null; ClearControls(); ClearGridControls(); pnlReturnOrder.Visible = false; this.lblStatusMessageTitle.Text = "डेलिभरी सामान फिर्ता"; this.lblStatusMessage.Text = " सफलतापूर्वक डेलिभरी सामान फिर्ता भयो।"; this.programmaticModalPopup.Show(); } else { this.lblStatusMessageTitle.Text = "डेलिभरी सामान फिर्ता"; this.lblStatusMessage.Text = " डेलिभरी सामान फिर्ता गर्दा वाधा उत्पन्न भयो।"; this.programmaticModalPopup.Show(); } } } catch (Exception ex) { this.lblStatusMessageTitle.Text = "Error Status"; this.lblStatusMessage.Text = ex.Message; this.programmaticModalPopup.Show(); } }
private void DeliveryOrder1_BubbleClick(object sender, EventArgs e) { List <ATTInvDeliveryOrderDetail> lstDeliveryOrder = new List <ATTInvDeliveryOrderDetail>(); lstDeliveryOrder = (List <ATTInvDeliveryOrderDetail>)Session["lstSrchDelivOrder"]; TextBox txtDeliveryDate_RDT = (TextBox)this.DeliveryOrder1.FindControl("txtDeliveryDate_RDT"); TextBox txtDeliveryPer_delv = (TextBox)this.DeliveryOrder1.FindControl("txtDeliveryPer_delv"); TextBox txtInvoiceNo_delv = (TextBox)this.DeliveryOrder1.FindControl("txtInvoiceNo_delv"); TextBox txtReceivedDate_RDT = (TextBox)this.DeliveryOrder1.FindControl("txtReceivedDate_RDT"); ATTInvDeliveryOrder objDo = new ATTInvDeliveryOrder(); objDo.OrgID = lstDeliveryOrder[0].OrgID; objDo.UnitID = lstDeliveryOrder[0].UnitID; objDo.OrderNo = lstDeliveryOrder[0].OrderNo; objDo.DeliveryDate = txtDeliveryDate_RDT.Text; objDo.DeliveryPerson = txtDeliveryPer_delv.Text; objDo.InvoiceNo = txtInvoiceNo_delv.Text; objDo.ReceiverID = loginID; objDo.ReceivedDate = txtReceivedDate_RDT.Text; objDo.lstDeliveryOrderDetail = CalculateDeliveryDetails(); objDo.Action = "A"; objDo.EntryBy = entryBy; if (updDelvFlag) { this.lblStatusMessageTitle.Text = "डेलिभरी अर्डर"; this.lblStatusMessage.Text = "डेलिभरीको लागी सामान हाल्नुहोस्!!!"; this.programmaticModalPopup.Show(); updDelvFlag = false; } else { if (BLLInvDeliveryOrder.SaveUpdateDeliveryOrder(objDo)) { ClearControls(); ClearDeliveryControls(); this.lblStatusMessageTitle.Text = "डेलिभरी अर्डर"; this.lblStatusMessage.Text = "डेलिभरी सफलतापूर्वक भयो!!!"; this.programmaticModalPopup.Show(); } else { this.lblStatusMessageTitle.Text = "डेलिभरी अर्डर"; this.lblStatusMessage.Text = "डेलिभरीमा वाधा उत्पन्न भयो!!!"; this.programmaticModalPopup.Show(); } } }
public static bool SaveUpdateDeliveryOrder(ATTInvDeliveryOrder objDo) { try { DLLInvDeliveryOrder.SaveUpdateDeliveryOrder(objDo); return(true); } catch (Exception ex) { throw (ex); } }
protected void grdDelivery_SelectedIndexChanged(object sender, EventArgs e) { if (Session["lstSrchedDeliveredOrder"] != null) { if (i == 0)//to prevent the event below from executing more than 1 time { List <ATTInvDeliveryOrder> lst = (List <ATTInvDeliveryOrder>)Session["lstSrchedDeliveredOrder"]; List <ATTInvDeliveryOrderDetail> lstDeliveredOrderDetail = new List <ATTInvDeliveryOrderDetail>(); ATTInvDeliveryOrder objDo = lst.Find(delegate(ATTInvDeliveryOrder obj) { return(obj.OrgID == lst[grdDelivery.SelectedIndex].OrgID && obj.UnitID == lst[grdDelivery.SelectedIndex].UnitID && obj.OrderNo == lst[grdDelivery.SelectedIndex].OrderNo && obj.DeliverySeq == lst[grdDelivery.SelectedIndex].DeliverySeq); } ); Session["objReturn"] = objDo; //lst[grdDelivery.SelectedIndex] lstDeliveredOrderDetail = BLLInvSrchDeliveryOrder.DeliveredOrderDetail(objDo); if (lstDeliveredOrderDetail.Count > 0) { hdnReceivedDate.Value = lst[grdDelivery.SelectedIndex].ReceivedDate; grdDeliveryDetails.SelectedIndex = -1; grdDeliveryDetails.DataSource = lstDeliveredOrderDetail; grdDeliveryDetails.DataBind(); } else { //lblCount.Text = "No Records FOUND !!!! "; grdDeliveryDetails.DataSource = ""; grdDeliveryDetails.DataBind(); } i++; OnBubbleClick(e); } } }
public static bool SaveUpdateDeliveryOrderDetail(ATTInvDeliveryOrder objDo, OracleTransaction Tran) { try { string sp = ""; foreach (ATTInvDeliveryOrderDetail objDoDetail in objDo.lstDeliveryOrderDetail) { if (objDoDetail.Action == "A") { sp = "sp_inv_add_delivery_order_det"; } else if (objDoDetail.Action == "E") { sp = "sp_inv_edit_delivery_order_det"; } if (objDoDetail.Action != "N" && sp != "") { objDoDetail.OrgID = objDo.OrgID; objDoDetail.UnitID = objDo.UnitID; objDoDetail.OrderNo = objDo.OrderNo; objDoDetail.DeliverySeq = objDo.DeliverySeq; List <OracleParameter> paramArray = new List <OracleParameter>(); paramArray.Add(Utilities.GetOraParam(":p_org_id", objDoDetail.OrgID, OracleDbType.Int64, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam(":p_order_no", objDoDetail.OrderNo, OracleDbType.Varchar2, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam(":p_delivery_seq", objDoDetail.DeliverySeq, OracleDbType.Int64, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam(":p_items_category_id", objDoDetail.ItemsCategoryID, OracleDbType.Int64, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam(":p_items_sub_category_id", objDoDetail.ItemsSubCategoryID, OracleDbType.Int64, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam(":p_items_id", objDoDetail.ItemsID, OracleDbType.Int64, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam(":p_seq_no", objDoDetail.SeqNo, OracleDbType.Int64, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam(":p_delivery_qty", objDoDetail.TotalDeliveryQty, OracleDbType.Int64, ParameterDirection.Input)); SqlHelper.ExecuteNonQuery(Tran, CommandType.StoredProcedure, sp, paramArray.ToArray()); } } return(true); } catch (Exception ex) { throw (ex); } }
public static List <ATTInvDeliveryOrderDetail> DeliveredOrderDetail(ATTInvDeliveryOrder objDo) { try { List <ATTInvDeliveryOrderDetail> lst = new List <ATTInvDeliveryOrderDetail>(); DataTable tbl = new DataTable(); tbl = DLLInvSrchDeliveryOrder.DeliveredOrderDetail(objDo); foreach (DataRow row in tbl.Rows) { ATTInvDeliveryOrderDetail obj = new ATTInvDeliveryOrderDetail(); obj.OrgID = int.Parse(row["ORG_ID"].ToString()); //obj.UnitID = int.Parse(row["UNIT_ID"].ToString()); obj.OrderNo = row["ORDER_NO"].ToString(); obj.DeliverySeq = int.Parse(row["DELIVERY_SEQ"].ToString()); obj.ItemsCategoryID = int.Parse(row["ITEMS_CATEGORY_ID"].ToString()); obj.ItemsCategoryName = row["ITEMS_CATEGORY_NAME"].ToString(); obj.ItemsSubCategoryID = int.Parse(row["ITEMS_SUB_CATEGORY_ID"].ToString()); obj.ItemsSubCategoryName = row["ITEMS_SUB_CATEGORY_NAME"].ToString(); obj.ItemsID = int.Parse(row["ITEMS_ID"].ToString()); obj.ItemsName = row["ITEMS_NAME"].ToString(); obj.DeliveredQty = row["total_delivered"].ToString() == "" ? 0 : int.Parse(row["total_delivered"].ToString()); obj.ReturnedQty = row["total_returned"].ToString() == "" ? 0 : int.Parse(row["total_returned"].ToString()); obj.SeqNo = int.Parse(row["SEQ_NO"].ToString()); lst.Add(obj); } return(lst); } catch (Exception ex) { throw (ex); } }
public static DataTable DeliveredOrderDetail(ATTInvDeliveryOrder objDo) { GetConnection GetConn = new GetConnection(); OracleConnection DBConn = GetConn.GetDbConn(Module.OAS); OracleTransaction Tran = DBConn.BeginTransaction(); try { string srchSQL = " SELECT DISTINCT org_id, order_no, delivery_seq, items_category_id,items_category_name, " + "items_sub_category_id,items_sub_category_name, items_id,items_name,SEQ_NO, total_delivered,total_returned " + " FROM vw_inv_delivered_orders " + " WHERE 1=1 AND total_delivered > total_returned "; //delivery_qty > total_returned List <OracleParameter> paramArray = new List <OracleParameter>(); if (objDo.OrderNo.Trim() != "") { srchSQL = srchSQL + " AND ORDER_NO =:order_no "; paramArray.Add(Utilities.GetOraParam(":order_no", objDo.OrderNo, OracleDbType.Varchar2, ParameterDirection.Input)); } if (objDo.DeliverySeq != null) { srchSQL = srchSQL + " AND DELIVERY_SEQ =:delivery_seq "; paramArray.Add(Utilities.GetOraParam(":delivery_seq", objDo.DeliverySeq, OracleDbType.Varchar2, ParameterDirection.Input)); } return(SqlHelper.ExecuteDataset(CommandType.Text, srchSQL, Module.OAS, paramArray.ToArray()).Tables[0]); } catch (Exception ex) { throw ex; } }
public static List <ATTInvDeliveryOrder> SrchDeliveredOrder(ATTInvSrchDeliveryOrder objSrchDo) { try { List <ATTInvDeliveryOrder> lst = new List <ATTInvDeliveryOrder>(); DataTable tbl = new DataTable(); tbl = DLLInvSrchDeliveryOrder.SrchDeliveredOrder(objSrchDo); foreach (DataRow row in tbl.Rows) { ATTInvDeliveryOrder obj = new ATTInvDeliveryOrder(); obj.OrgID = int.Parse(row["ORG_ID"].ToString()); obj.OrderNo = row["ORDER_NO"].ToString(); obj.DeliverySeq = int.Parse(row["DELIVERY_SEQ"].ToString()); obj.DeliveryPerson = row["DELIVERY_PERSON"].ToString(); obj.DeliveryDate = row["DELIVERY_DATE"].ToString(); obj.ReceiverID = int.Parse(row["RCVD_BY"].ToString()); obj.ReceiverName = row["FIRST_NAME"].ToString() + (row["MID_NAME"].ToString() == "" ? "" : " " + row["MID_NAME"].ToString()) + (row["SUR_NAME"].ToString() == "" ? "" : " " + row["SUR_NAME"].ToString()); obj.ReceivedDate = row["RCVD_DATE"].ToString(); obj.InvoiceNo = row["INVOICE_NO"].ToString(); lst.Add(obj); } return(lst); } catch (Exception ex) { throw(ex); } }
public static bool SaveUpdateDeliveryOrder(ATTInvDeliveryOrder objDo) { GetConnection GetConn = new GetConnection(); OracleConnection DBConn = GetConn.GetDbConn(Module.OAS); OracleTransaction Tran = DBConn.BeginTransaction(); try { string sp = ""; int countDoDetail = objDo.lstDeliveryOrderDetail.Count; if (objDo.Action == "A") { sp = "sp_inv_add_delivery_order"; } else if (objDo.Action == "E") { sp = "sp_inv_edit_delivery_order"; } if (objDo.Action != "N" && sp != "") { OracleParameter[] paramArray = new OracleParameter[9]; paramArray[0] = Utilities.GetOraParam(":p_org_id", objDo.OrgID, OracleDbType.Int64, ParameterDirection.Input); //paramArray[1] = Utilities.GetOraParam(":p_unit_id",objDo.UnitID, OracleDbType.Int64, ParameterDirection.Input); paramArray[1] = Utilities.GetOraParam(":p_order_no", objDo.OrderNo, OracleDbType.Varchar2, ParameterDirection.Input); paramArray[2] = Utilities.GetOraParam(":p_delivery_seq", null, OracleDbType.Int32, ParameterDirection.InputOutput); paramArray[3] = Utilities.GetOraParam(":p_delivery_person", objDo.DeliveryPerson, OracleDbType.Varchar2, ParameterDirection.Input); paramArray[4] = Utilities.GetOraParam(":p_delivery_date", objDo.DeliveryDate, OracleDbType.Varchar2, ParameterDirection.Input); paramArray[5] = Utilities.GetOraParam(":p_rcvd_by", objDo.ReceiverID, OracleDbType.Int64, ParameterDirection.Input); paramArray[6] = Utilities.GetOraParam(":p_rcvd_date", objDo.ReceivedDate, OracleDbType.Varchar2, ParameterDirection.Input); paramArray[7] = Utilities.GetOraParam(":p_invoice_no", objDo.InvoiceNo, OracleDbType.Varchar2, ParameterDirection.Input); paramArray[8] = Utilities.GetOraParam(":p_entry_by", objDo.EntryBy, OracleDbType.Varchar2, ParameterDirection.Input); SqlHelper.ExecuteNonQuery(Tran, CommandType.StoredProcedure, sp, paramArray); objDo.DeliverySeq = int.Parse(paramArray[2].Value.ToString()); } if (countDoDetail > 0) { DLLInvDeliveryOrderDetail.SaveUpdateDeliveryOrderDetail(objDo, Tran); } Tran.Commit(); return(true); } catch (Exception ex) { Tran.Rollback(); throw (ex); } finally { GetConn.CloseDbConn(); } }