protected void btnUpdate_Click(object sender, EventArgs e) { try { if (new ChequeBookDAO().UpdateCheques(this.ChequeBook)) { lblError.Text = Constant.MSG_Save_SavedSeccessfully; lblError.Visible = true; } else { lblError.Text = Constant.MSG_Save_NotSavedSeccessfully; lblError.Visible = true; } } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void btnUpdate_Click(object sender, EventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void gvItemList_RowDeleting(object sender, GridViewDeleteEventArgs e) { try { Int32 temp = e.RowIndex; DataRow[] dr = PurchaseReturn.DsReturnDetails.Tables[0].Select("GRNDetailsId=" + gvItemList.DataKeys[temp]["GRNDetailsId"].ToString()); dr[0].Delete(); //DataRow[] dr = ObjGRN.GRNItems.Tables[0].Select("Id=" + gvItemList.DataKeys[temp]["Id"].ToString()); //dr[0].Delete(); btnConfirm_Click(btnConfirm, EventArgs.Empty);//Fill gvItemList.DataSource = PurchaseReturn.DsReturnDetails; gvItemList.DataBind(); txtLineItemsCount.Value = gvItemList.Rows.Count.ToString(); Session["ObjPurchaseReturn"] = PurchaseReturn; this.ShowHideGrid(); this.CalculateTotal(); } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void gvItemList_RowDeleting(object sender, GridViewDeleteEventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void btnCancel_Click(object sender, EventArgs e) { try { if (hdnFromURL.Value != null && hdnFromURL.Value != String.Empty) { Response.Redirect(hdnFromURL.Value.Trim(), false); } else { Response.Redirect("Home.aspx", false); } } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void btnCancel_Click(object sender, EventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { Master.ClearSessions();//Clear all sessions dxgvReceivedVouchers.DataSource = DsReceivableVouchers; dxgvReceivedVouchers.DataBind(); } if (IsCallback) { dxgvReceivedVouchers.DataSource = DsReceivableVouchers; dxgvReceivedVouchers.DataBind(); } } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void Page_Load(object sender, EventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
//protected void lbtnAddGroupItem_Click(object sender, EventArgs e) //{ // try // { // Response.Redirect("GroupItemAdd.aspx", false); // } // catch (Exception ex) // { // ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void lbtnAddGroupItem_Click(object sender, EventArgs e)"); // if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) // Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); // else // Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); // } //} protected void ddlBrandCode_SelectedIndexChanged(object sender, EventArgs e) { try { Brand tmpBrand = new Brand(); tmpBrand.BrandId = Int32.Parse(ddlBrandCode.SelectedItem.Value.Trim() == String.Empty ? "-1" : ddlBrandCode.SelectedItem.Value.Trim()); DataSet dsCategories = tmpBrand.GetBrandCategoriesByBrandID(); if (dsCategories == null || dsCategories.Tables.Count == 0) { ddlCatCode.Items.Add(new ListItem("--No Data Found--", "-1")); } else { Master.BindDropdown("CategoryType", "CategoryId", dsCategories, ddlCatCode); ddlCatCode.Items.Add(new ListItem("--Please Select--", "-1")); ddlCatCode.SelectedValue = "-1"; } } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void ddlBrandCode_SelectedIndexChanged(object sender, EventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { Master.ClearSessions();//Clear all sessions dtpFromDate.Date = DateTime.Today.Date; dtpToDate.Date = DateTime.Today.Date; FillReport(); this.Authorise(); } if (IsCallback) { this.FillSession(); FillReport(); } } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void Page_Load(object sender, EventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void btnLogin_Click(object sender, EventArgs e) { try { loginUser = new User(); loginUser.UserName = txtUserName.Text.Trim(); loginUser.Password = txtPassword.Text.Trim(); if (loginUser.CheckLogin()) { Session["LoggedUser"] = loginUser; Response.Redirect("Home.aspx", false); } else { lblError.Visible = true; lblError.Text = Constant.MSG_User_InvalidUserNameOrPassword; } } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void btnLogin_Click(object sender, EventArgs e)"); Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } }
protected void btnSaveTransfer_Click(object sender, EventArgs e) { try { ObjItemTransfer.BranchFrom = Int32.Parse(ddlFromBranch.SelectedValue); ObjItemTransfer.BranchTo = Int32.Parse(ddlToBranch.SelectedValue); if (ObjItemTransfer.BranchFrom > 0 && ObjItemTransfer.BranchTo > 0 && ObjItemTransfer.Add()) { lblError.Text = Constant.MSG_Save_SavedSeccessfully; lblError.Visible = true; } else { lblError.Text = Constant.MSG_Save_NotSavedSeccessfully; lblError.Visible = true; } } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void btnSaveTransfer_Click(object sender, EventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { Session["ObjVoucher"] = null; this.CheckFromURL(); this.GetVoucherId(); this.LoadInitialData(); this.SetData(); } if (IsCallback) { DataSet ds; if (Session["VoucherPOList"] == null) { ds = new PODAO().GetAllPayablePOs(); Session["VoucherPOList"] = ds; } else { ds = (DataSet)Session["VoucherPOList"]; } dxgvPODetails.DataSource = ds; dxgvPODetails.DataBind(); } } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void Page_Load(object sender, EventArgs e)"); Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } }
//Session["CustomerFullReport"] protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { Session["CustomerFullReport"] = null; this.LoadInitialData(); } if (IsCallback) { BindGrid(); } } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void Page_Load(object sender, EventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void ddlFromBranch_SelectedIndexChanged(object sender, EventArgs e) { try { this.FillToBranch(); if (ddlFromBranch.SelectedValue == "-1") { return; } ListItem li = ddlToBranch.Items.FindByValue(ddlFromBranch.SelectedValue.Trim()); if (li != null) { ddlToBranch.Items.Remove(li); } } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void ddlFromBranch_SelectedIndexChanged(object sender, EventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void btnSearch_Click(object sender, EventArgs e) { try { VoucherRecievableSearch voucherSearch = new VoucherRecievableSearch(); voucherSearch.FromDate = dtpFromDate.Date; voucherSearch.ToDate = dtpToDate.Date; DataSet dsPOs = (new VoucherRecievableDAO()).GetPaymentsReveivedForReporting(voucherSearch); Session["PaymentsRecieved"] = dsPOs; if (dsPOs != null && dsPOs.Tables[0].Rows.Count > 0) { dxgvPaymentsReceived.DataSource = dsPOs; dxgvPaymentsReceived.DataBind(); } else { dxgvPaymentsReceived.DataSource = dsPOs; dxgvPaymentsReceived.DataBind(); } } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void btnSearch_Click(object sender, EventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
private void LoadInitialData() { try { // // Suppliers // DataSet dsSuppliers = (new SupplierDAO()).GetAllSuppliers(); if (dsSuppliers == null || dsSuppliers.Tables.Count == 0) { ddlSupplier.Items.Add(new ListItem("--No Records--", "-1")); } else { Master.BindDropdown("SupplierName", "SupId", dsSuppliers, ddlSupplier); ddlSupplier.Items.Insert(0, new ListItem("--Please Select--", "-1")); } } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "private void LoadInitialData()"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void btnClear_Click(object sender, EventArgs e) { try { Session["ObjIGroup"] = null; txtGICode.Text = (new GroupsDAO()).GetNextGroupsCode(); txtGroupName.Text = String.Empty; txtDescription.Text = String.Empty; txtItemCode.Text = String.Empty; txtItemName.Text = String.Empty; txtBrand.Text = String.Empty; txtCategory.Text = String.Empty; gvItemList.DataSource = null; gvItemList.DataBind(); this.ShowHideGrid(); } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void btnClear_Click(object sender, EventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { Master.ClearSessions();//Clear all sessions POSearchParameters searchPO = new POSearchParameters(); searchPO.FromDateRep = null; searchPO.ToDateRep = null; Session["PurchaseItemReport"] = searchPO.SearchPOItemsForReporting(); dxgvPurchaseByItems.DataSource = (DataSet)Session["PurchaseItemReport"]; dxgvPurchaseByItems.DataBind(); } if (IsCallback) { dxgvPurchaseByItems.DataSource = (DataSet)Session["PurchaseItemReport"]; dxgvPurchaseByItems.DataBind(); } } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void Page_Load(object sender, EventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void gvItemList_RowEditing(object sender, GridViewEditEventArgs e) { try { hdnItemId.Value = gvItemList.DataKeys[e.NewEditIndex].Value.ToString(); txtItemCode.Text = gvItemList.Rows[e.NewEditIndex].Cells[(int)Structures.PurchaseOrderGridColumnNames.ItemCode].Text.Trim(); //ItemCode txtItemCost.Text = gvItemList.Rows[e.NewEditIndex].Cells[(int)Structures.PurchaseOrderGridColumnNames.POItemCost].Text.Trim(); //ItemCost txtQuantity.Text = gvItemList.Rows[e.NewEditIndex].Cells[(int)Structures.PurchaseOrderGridColumnNames.Qty].Text.Trim(); //Quantity txtItemName.Text = gvItemList.Rows[e.NewEditIndex].Cells[(int)Structures.PurchaseOrderGridColumnNames.ItemDescription].Text.Trim(); //Description ddlDiscount.SelectedValue = gvItemList.Rows[e.NewEditIndex].Cells[(int)Structures.PurchaseOrderGridColumnNames.DiscountPerUnit].Text.Trim(); //DiscountPerUnit if (Decimal.Parse(ddlDiscount.SelectedValue.Trim()) > 0) { txtCostBeforeDiscount.Text = (Convert.ToDecimal(txtItemCost.Text.Trim()) / (1 - Convert.ToDecimal(ddlDiscount.SelectedValue.Trim()) / 100)).ToString(); } else { txtCostBeforeDiscount.Text = txtItemCost.Text; } txtSearchItem_Click(txtSearchItem, EventArgs.Empty); this.ShowHideGrid(); } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void gvItemList_RowEditing(object sender, GridViewEditEventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
/// <summary> /// Date range search button click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSearch_Click(object sender, EventArgs e) { try { POSearchParameters searchPO = new POSearchParameters(); searchPO.FromDateRep = dtpFromDate.Date; searchPO.ToDateRep = dtpToDate.Date; if (searchPO.ToDateRep < searchPO.FromDateRep) { return; } Session["PurchaseItemReport"] = null; Session["PurchaseItemReport"] = searchPO.SearchPOItemsForReporting(); dxgvPurchaseByItems.DataSource = (DataSet)Session["PurchaseItemReport"]; dxgvPurchaseByItems.DataBind(); } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void btnSearch_Click(object sender, EventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void gvItemList_RowDeleting(object sender, GridViewDeleteEventArgs e) { try { Int32 temp = e.RowIndex; DataRow[] dr = ObjPurchaseOrder.DsPOItems.Tables[0].Select("ItemId=" + gvItemList.DataKeys[temp].Value.ToString()); dr[0].Delete(); gvItemList.DataSource = ObjPurchaseOrder.DsPOItems; gvItemList.DataBind(); txtLineItemsCount.Value = gvItemList.Rows.Count.ToString(); Session["ObjPurchaseOrder"] = ObjPurchaseOrder; this.CalculatePOAmounts(); this.ShowHideGrid(); } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void gvItemList_RowDeleting(object sender, GridViewDeleteEventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void dxgvInvoiceLineItems_BeforePerformDataSelect(object sender, EventArgs e) { try { if ((sender as ASPxGridView).GetMasterRowKeyValue() == null) { return; } Int32 InvoiceId = Int32.Parse((sender as ASPxGridView).GetMasterRowKeyValue().ToString()); Invoice invoice = new Invoice(); invoice.InvoiceId = InvoiceId; DataSet ds = new InvoiceDAO().GetInvoiceDetailsByInvoiceIDForReporting(invoice); (sender as ASPxGridView).DataSource = ds; } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void dxgvInvoiceLineItems_BeforePerformDataSelect(object sender, EventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void ddlDiscount_SelectedIndexChanged(object sender, EventArgs e) { try { if (txtCostBeforeDiscount.Text.Trim() == string.Empty) { return; } Decimal discount = Convert.ToDecimal(ddlDiscount.SelectedValue.Trim()); Decimal price = Decimal.Round(Convert.ToDecimal(txtCostBeforeDiscount.Text.Trim()), 2); if (discount > 0) { txtItemCost.Text = Decimal.Round((price * (1 - discount / 100)), 2).ToString(); } else { txtItemCost.Text = price.ToString(); } } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void ddlDiscount_SelectedIndexChanged(object sender, EventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void gvItemList_RowDeleting(object sender, GridViewDeleteEventArgs e) { try { Int32 temp = e.RowIndex; if (ddlInvoiceNumber.SelectedValue != "-1") { DataRow[] dr = ObjGatePass.DsGatePassDetails.Tables[0].Select("InvDetID=" + gvItemList.DataKeys[temp]["InvDetID"].ToString()); dr[0].Delete(); ddlInvoiceNumber_SelectedIndexChanged(ddlInvoiceNumber, EventArgs.Empty);//Fill all the pending Item codes } gvItemList.DataSource = ObjGatePass.DsGatePassDetails; gvItemList.DataBind(); txtLineItemsCount.Value = gvItemList.Rows.Count.ToString(); Session["ObjGatePass"] = ObjGatePass; this.ClearItemDetails(); this.ShowHideGrid(); } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void gvItemList_RowDeleting(object sender, GridViewDeleteEventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void btnCancel_Click(object sender, EventArgs e) { try { ObjPurchaseOrder.POStatus = Structures.POStatus.Cancel; ObjPurchaseOrder.POComment = txtCancelNote.Value.Trim(); if (new PODAO().UpdatePOStatus(ObjPurchaseOrder)) { btnCancel.Enabled = false; lblError.Visible = true; lblError.Text = Constant.MSG_Save_SavedSeccessfully; this.DisableControls(); } else { lblError.Visible = true; lblError.Text = Constant.MSG_Save_NotSavedSeccessfully; } } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void btnCancel_Click(object sender, EventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { Session["SearchGroups"] = null; this.FillDataToGrid(); this.CheckFromURL(); this.SetUIForURLParameters(); } if (IsCallback) { this.FillDataToGrid(); } } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void Page_Load(object sender, EventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void dxgvCustomers_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { try { DataRow[] dr = ((DataSet)Session["SearchCustomers"]).Tables[0].Select("CustomerID=" + e.Keys[0].ToString()); if (dr.Length > 0) { dr[0]["Cus_CreditTotal"] = e.NewValues["Cus_CreditTotal"]; e.Cancel = true; dxgvCustomers.CancelEdit(); dxgvCustomers.DataBind(); } } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void btnSearch_Click(object sender, EventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void btnAddType_Click(object sender, EventArgs e) { try { ddlType.Visible = false; btnAddType.Visible = false; RequiredFieldValidator10.Enabled = true; txtType.Text = String.Empty; txtType.Visible = true; btnTypeSave.Visible = true; } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void btnAddType_Click(object sender, EventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { Master.ClearSessions();//Clear all sessions this.CheckFromURL(); this.Search(); } this.ShowHideControlsByUser(); if (IsCallback) { dxgvCustomers.DataSource = (DataSet)Session["SearchCustomers"]; dxgvCustomers.DataBind(); } } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void Page_Load(object sender, EventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void gvItemList_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.DataRow) { ListItem li = new ListItem(); li = ddlItemCode.Items.FindByValue(gvItemList.DataKeys[e.Row.RowIndex]["GRNDetailsId"].ToString()); if (li != null) { ddlItemCode.Items.Remove(li); } } } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void gvItemList_RowDataBound(object sender, GridViewRowEventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void btnUpdate_Click(object sender, EventArgs e) { try { DataSet ds = new DataSet(); if (Session["SearchCustomers"] != null) { ds = (DataSet)Session["SearchCustomers"]; } if (new CustomerDAO().UpdateAllCustomers(ds)) { lblError.Text = Constant.MSG_Save_SavedSeccessfully; } else { lblError.Text = Constant.MSG_Save_NotSavedSeccessfully; } } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void btnUpdate_Click(object sender, EventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { Master.ClearSessions();//Clear all sessions this.CheckFromURL(); this.LoadInitialData(); this.CheckIfEditUser(); this.SetData(); } } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void Page_Load(object sender, EventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); } else { Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } } }
protected void gvUserList_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.DataRow) { Int32 userid = Convert.ToInt32(gvUserList.DataKeys[e.Row.RowIndex].Values["UserId"].ToString()); Boolean isActive = Convert.ToBoolean(e.Row.Cells[5].Text.Trim()); //if (!isActive) //{ // btnDel.Enabled = false; //} //if (userid == loggedUser.UserId) //{ // btnDel.Visible = false; //} } } catch (Exception ex) { ex.Data.Add("UILayerException", this.GetType().ToString() + Constant.Error_Seperator + "protected void gvUserList_RowDataBound(object sender, GridViewRowEventArgs e)"); if (Master.LoggedUser != null && Master.LoggedUser.UserName != null && Master.LoggedUser.UserName != string.Empty) Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, Master.LoggedUser.UserName), false); else Response.Redirect("Error.aspx?LogId=" + LankaTilesExceptions.WriteEventLogs(ex, Constant.Database_Connection_Name, "Annonimous"), false); } }