public static List <ATTInvItemsWriteOff> GetWriteOffDateDetails(int orgid, string WriteOffDate, string AppYesNo) { List <ATTInvItemsWriteOff> lstitems = new List <ATTInvItemsWriteOff>(); try { foreach (DataRow row in DLLInvItemsWiiteOffAprove.GetWriteOffDateDetails(orgid, WriteOffDate, AppYesNo).Rows) { ATTInvItemsWriteOff objitems = new ATTInvItemsWriteOff(); objitems.OrgID = int.Parse(row["ORG_ID"].ToString()); objitems.WriteOffSEQ = int.Parse(row["WRITEOFF_SEQ"].ToString()); objitems.WriteoffDate = row["WRITEOFF_DATE"].ToString(); //objitems.App_By = int.Parse(row["APP_BY"].ToString()); objitems.AppDate = row["APP_DATE"].ToString(); objitems.AppYesNo = row["APP_YES_NO"].ToString(); lstitems.Add(objitems); } return(lstitems); } catch (Exception ex) { throw ex; } }
protected void grdMinahaList_RowDeleting(object sender, GridViewDeleteEventArgs e) { int i = e.RowIndex; ATTInvItemsWriteOff itemsWriteOff = (ATTInvItemsWriteOff)Session["ItemsWriteOff"]; List <ATTInvItemsWriteOffDT> itemsWriteOffDT = itemsWriteOff.LstItemsWriteOffDT; if ((itemsWriteOffDT[i].Action == null) || (itemsWriteOffDT[i].Action == "E")) { itemsWriteOffDT[i].Action = "D"; } else if (itemsWriteOffDT[i].Action == "D") { itemsWriteOffDT[i].Action = "E"; } else if (itemsWriteOffDT[i].Action == "A") { itemsWriteOffDT.RemoveAt(i); } this.grdMinahaList.DataSource = itemsWriteOffDT; this.grdMinahaList.DataBind(); this.grdMinahaList.SelectedIndex = -1; SetGridColor(7, 9, this.grdMinahaList); }
public static bool AddUpdateItemsWriteOff(ATTInvItemsWriteOff itemsWriteOff) { try { return(DLLInvItemsWriteOff.AddUpdateItemsWriteOff(itemsWriteOff)); } catch (Exception ex) { throw ex; } }
void ClearControl() { this.grdMinahaList.SelectedIndex = -1; this.grdMinahaList.DataSource = ""; grdMinahaList.DataBind(); this.ddlItemCategory.SelectedIndex = 0; this.ddlItemSubCategory.SelectedIndex = 0; this.ddlItem.SelectedIndex = 0; this.txtRemarks.Text = ""; Session["ItemsWriteOff"] = new ATTInvItemsWriteOff(); }
public static bool AddUpdateItemsWriteOff(ATTInvItemsWriteOff itemsWriteOff) { GetConnection getConn = new GetConnection(); OracleConnection DBConn = getConn.GetDbConn(Module.OAS); OracleTransaction Tran = DBConn.BeginTransaction(); string InsertSP = ""; if (itemsWriteOff.Action == "A") { InsertSP = "SP_INV_ADD_ITEMS_WRITE_OFF"; } else if (itemsWriteOff.Action == "E") { InsertSP = "SP_INV_EDIT_ITEMS_WRITE_OFF"; } else if (itemsWriteOff.Action == "App") { InsertSP = "SP_INV_APP_ITEMS_WRITE_OFF"; } List <OracleParameter> paramArray = new List <OracleParameter>(); paramArray.Add(Utilities.GetOraParam(":p_org_id", itemsWriteOff.OrgID, OracleDbType.Int64, System.Data.ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam(":p_writeoff_seq", itemsWriteOff.WriteOffSEQ, OracleDbType.Int64, System.Data.ParameterDirection.InputOutput)); paramArray.Add(Utilities.GetOraParam(":p_writeoff_date", itemsWriteOff.WriteoffDate, OracleDbType.Varchar2, System.Data.ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam(":p_app_by", itemsWriteOff.AppBy, OracleDbType.Int64, System.Data.ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam(":p_app_date", itemsWriteOff.AppDate, OracleDbType.Varchar2, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam(":p_app_yes_no", itemsWriteOff.AppYesNo, OracleDbType.Varchar2, ParameterDirection.Input)); paramArray.Add(Utilities.GetOraParam(":p_entry_by", itemsWriteOff.EntryBy, OracleDbType.Varchar2, System.Data.ParameterDirection.Input)); try { SqlHelper.ExecuteNonQuery(Tran, System.Data.CommandType.StoredProcedure, InsertSP, paramArray.ToArray()); itemsWriteOff.WriteOffSEQ = int.Parse(paramArray[1].Value.ToString()); DLLInvItemsWriteOffDT.AddUpdateDeleteItemsWriteOffDT(itemsWriteOff.LstItemsWriteOffDT, itemsWriteOff.WriteOffSEQ, Tran); Tran.Commit(); return(true); } catch (Exception ex) { Tran.Rollback(); throw ex; } finally { getConn.CloseDbConn(); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["Login_User_Detail"] == null) { Response.Redirect("~/MODULES/Login.aspx", true); } ATTUserLogin user = ((ATTUserLogin)Session["Login_User_Detail"]); if (!IsPostBack) { this.ddlItemSubCategory.Enabled = false; this.ddlItem.Enabled = false; Session["ItemsWriteOff"] = new ATTInvItemsWriteOff(); LoadItemsCategory(); } }
protected void grdMinahaList_SelectedIndexChanged(object sender, EventArgs e) { ATTInvItemsWriteOff obj = (ATTInvItemsWriteOff)Session["ItemsWriteOff"]; List <ATTInvItemsWriteOffDT> itemsWriteOffDT = obj.LstItemsWriteOffDT; this.ddlItemCategory.SelectedValue = itemsWriteOffDT[this.grdMinahaList.SelectedIndex].ItemsCategoryID.ToString(); this.ddlItemSubCategory.SelectedValue = itemsWriteOffDT[this.grdMinahaList.SelectedIndex].ItemsSubCategoryID.ToString(); //ItemID values can be set from session GridViewRow row = grdMinahaList.SelectedRow; string selVal = (row.Cells[0].Text + row.Cells[2].Text + row.Cells[3].Text + row.Cells[4].Text + row.Cells[5].Text); this.ddlItem.SelectedValue = selVal; this.txtRemarks.Text = itemsWriteOffDT[this.grdMinahaList.SelectedIndex].Remarks; itemsWriteOffDT[grdMinahaList.SelectedIndex].Action = (itemsWriteOffDT[grdMinahaList.SelectedIndex].Action == "A" ? "A" : "E"); }
protected void btnSubmit_Click(object sender, EventArgs e) { if (this.grdMinahaDetails.SelectedIndex > -1) { List <ATTInvItemsWriteOff> LSTAucDateDetails = (List <ATTInvItemsWriteOff>)Session["WriteOffDateDetails"]; ATTInvItemsWriteOff objData = new ATTInvItemsWriteOff(); objData.OrgID = ((ATTUserLogin)Session["Login_User_Detail"]).OrgID; objData.WriteOffSEQ = LSTAucDateDetails[this.grdMinahaDetails.SelectedIndex].WriteOffSEQ; objData.WriteoffDate = LSTAucDateDetails[this.grdMinahaDetails.SelectedIndex].WriteoffDate; objData.AppBy = ((ATTUserLogin)Session["Login_User_Detail"]).PID; if (this.txtCurrentDate.Text != "") { objData.AppDate = this.txtCurrentDate.Text; } if (this.chkApprove.Checked == true) { objData.AppYesNo = "Y"; } else { objData.AppYesNo = "N"; } objData.EntryBy = ((ATTUserLogin)Session["Login_User_Detail"]).UserName; objData.Action = "App"; objData.LstItemsWriteOffDT = (List <ATTInvItemsWriteOffDT>)Session["MinahaDetails"]; if (BLLInvItemsWriteOff.AddUpdateItemsWriteOff(objData)) { this.lblStatusMessage.Text = "Auction Details Approved Successfully"; this.programmaticModalPopup.Show(); } ClearControls("submit"); } else { this.lblStatusMessage.Text = "**र्कपया मिनाहा मिति छान्नुहोस्"; this.programmaticModalPopup.Show(); return; } }
protected void btnSubmit_Click(object sender, EventArgs e) { ATTInvItemsWriteOff itemsWriteOff = (ATTInvItemsWriteOff)Session["ItemsWriteOff"]; ATTUserLogin user = ((ATTUserLogin)Session["Login_User_Detail"]); itemsWriteOff.OrgID = user.OrgID; if (txtMinahaDate.Text == "") { //DateTime.Now.ToShortDateString(); string shortDateString = DateTime.Now.ToString("dd/MM/yyyy"); itemsWriteOff.WriteoffDate = shortDateString; } else { itemsWriteOff.WriteoffDate = txtMinahaDate.Text; } //itemsWriteOff.WriteoffDate = txtMinahaDate.Text; itemsWriteOff.AppBy = null; //This is field at the time of Approval itemsWriteOff.AppDate = null; //This is field at the time of Approval itemsWriteOff.AppYesNo = null; //This is field at the time of Approval itemsWriteOff.EntryBy = ((ATTUserLogin)Session["Login_User_Detail"]).UserName; itemsWriteOff.Action = "A"; if (BLLInvItemsWriteOff.AddUpdateItemsWriteOff(itemsWriteOff)) { this.lblStatusMessage.Text = "Information Saved"; this.programmaticModalPopup.Show(); } else { this.lblStatusMessage.Text = "Information could not be Saved"; this.programmaticModalPopup.Show(); } ClearControl(); }
protected void btnAdd_Click(object sender, EventArgs e) { if (this.ddlItemCategory.SelectedIndex == -1) { this.lblStatusMessage.Text = "Please select Item Name Name."; this.programmaticModalPopup.Show(); this.lblStatus.Focus(); return; } if (this.ddlItemSubCategory.SelectedIndex == 0) { this.lblStatusMessage.Text = "Please select Iten Category Name."; this.programmaticModalPopup.Show(); this.lblStatus.Focus(); return; } if (this.ddlItem.SelectedIndex == 0) { this.lblStatusMessage.Text = "Please select the Item Name."; this.programmaticModalPopup.Show(); this.lblStatus.Focus(); return; } if (this.txtRemarks.Text == "") { this.lblStatusMessage.Text = "Please Enter Remarks."; this.programmaticModalPopup.Show(); this.lblStatus.Focus(); return; } ATTInvItemsWriteOff obj = (ATTInvItemsWriteOff)Session["ItemsWriteOff"]; //List<ATTInvItemsWriteOff> lstItemsWriteOff = (List<ATTInvItemsWriteOff>)Session["ItemsWriteOff"]; if (grdMinahaList.SelectedIndex > -1) { List <ATTInvOrgItemsKNJ> LSTSeq = (List <ATTInvOrgItemsKNJ>)Session["Items"];// how to get seq no it comes from DLLInvOrgItemsKNJ obj.LstItemsWriteOffDT[grdMinahaList.SelectedIndex].ItemsCategoryID = int.Parse(ddlItemCategory.SelectedValue); obj.LstItemsWriteOffDT[grdMinahaList.SelectedIndex].ItemsSubCategoryID = int.Parse(ddlItemSubCategory.SelectedValue); obj.LstItemsWriteOffDT[grdMinahaList.SelectedIndex].ItemsID = LSTSeq[ddlItem.SelectedIndex - 1].ItemsID; obj.LstItemsWriteOffDT[grdMinahaList.SelectedIndex].Remarks = txtRemarks.Text; obj.LstItemsWriteOffDT[grdMinahaList.SelectedIndex].Action = (obj.LstItemsWriteOffDT[grdMinahaList.SelectedIndex].Action == "A" ? "A" : "E"); } else { //List<ATTInvOrgItemsKNJ> LSTAucItems = (List<ATTInvOrgItemsKNJ>)Session["Items"]; //int itemID = LSTAucItems[this.ddlItem.SelectedIndex - 1].ItemsID; List <ATTInvOrgItemsKNJ> LSTSeq = (List <ATTInvOrgItemsKNJ>)Session["Items"]; ATTInvItemsWriteOffDT ob = new ATTInvItemsWriteOffDT(); int itemid = LSTSeq[ddlItem.SelectedIndex - 1].ItemsID; foreach (GridViewRow row in this.grdMinahaList.Rows) { if (int.Parse(row.Cells[4].Text) == itemid) { this.lblStatusMessage.Text = "**सामान पहिले नै उपलब्द छ"; this.programmaticModalPopup.Show(); return; } } ATTUserLogin user = ((ATTUserLogin)Session["Login_User_Detail"]); //ATTInvItemsWriteOffDT ob = new ATTInvItemsWriteOffDT(); ob.OrgID = user.OrgID; ob.ItemsCategoryID = int.Parse(ddlItemCategory.SelectedValue); ob.ItemsSubCategoryID = int.Parse(ddlItemSubCategory.SelectedValue); //get ItemID from session // List<ATTInvOrgItemsKNJ> LSTSeq = (List<ATTInvOrgItemsKNJ>)Session["Items"];// get ItemID from session -- (DLLInvOrgItemsKNJ) ob.ItemsID = itemid; ob.SeqNo = LSTSeq[ddlItem.SelectedIndex - 1].KNJSeq; ob.Remarks = txtRemarks.Text; ob.Action = "A"; obj.LstItemsWriteOffDT.Add(ob); this.grdMinahaList.SelectedIndex = -1; this.ddlItemCategory.SelectedIndex = 0; this.ddlItemSubCategory.SelectedIndex = 0; this.ddlItem.SelectedIndex = 0; this.txtRemarks.Text = ""; } this.grdMinahaList.DataSource = obj.LstItemsWriteOffDT; this.grdMinahaList.DataBind(); this.grdMinahaList.SelectedIndex = -1; this.txtRemarks.Text = ""; this.ddlItemCategory.SelectedIndex = 0; this.ddlItemSubCategory.SelectedIndex = 0; this.ddlItem.SelectedIndex = 0; }