private void SetInitialRow() { DataTable dt = new DataTable(); DataRow dr; dt.Columns.Add("#", typeof(Int32)); dt.Columns.Add("FlatTypeId", typeof(Int32)); dt.Columns.Add("FlatType", typeof(string)); dt.Columns.Add("UnitNo", typeof(string)); dt.Columns.Add("UnitArea", typeof(decimal)); dt.Columns.Add("PropTaxAmt", typeof(decimal)); dt.Columns.Add("SMAmt", typeof(decimal)); dr = dt.NewRow(); dr["#"] = 0; dr["FlatTypeId"] = 0; dr["FlatType"] = ""; dr["UnitNo"] = ""; dr["UnitArea"] = 0; dr["PropTaxAmt"] = 0; dr["SMAmt"] = 0; dt.Rows.Add(dr); ViewState["CurrentTable"] = dt; GridDetails.DataSource = dt; GridDetails.DataBind(); }
protected void GridDetails_RowDeleting(object sender, GridViewDeleteEventArgs e) { try { if (ViewState["CurrentTable"] != null) { int id = e.RowIndex; DataTable dt = (DataTable)ViewState["CurrentTable"]; dt.Rows.RemoveAt(id); if (dt.Rows.Count > 0) { GridDetails.DataSource = dt; GridDetails.DataBind(); ViewState["CurrentTable"] = dt; } else { SetInitialRow(); } } } catch (Exception ex) { throw new Exception(ex.Message); } }
private void SetInitialRow() { DataTable Dt = new DataTable(); DataRow dr; Dt.Columns.Add("TransferNo", typeof(string)); Dt.Columns.Add("Date", typeof(string)); Dt.Columns.Add("Employee", typeof(string)); Dt.Columns.Add("FromLocation", typeof(string)); Dt.Columns.Add("ToLocation", typeof(string)); Dt.Columns.Add("Notes", typeof(string)); Dt.Columns.Add("Amount", typeof(string)); dr = Dt.NewRow(); dr["TransferNo"] = ""; dr["Date"] = ""; dr["Employee"] = ""; dr["FromLocation"] = ""; dr["ToLocation"] = ""; dr["Notes"] = ""; dr["Amount"] = ""; Dt.Rows.Add(dr); ViewState["CurrentTable"] = Dt; GridDetails.DataSource = Dt; GridDetails.DataBind(); }
public void GetDamageDtls() { try { int TransId = Convert.ToInt32(Request.QueryString["ID"]); DS = Obj_Trans.BindForPrint(TransId, out StrError); if (DS.Tables.Count > 0) { if (DS.Tables[0].Rows.Count > 0) { lblTransferNo.Text = obj_Comm.ToTitleCase(DS.Tables[0].Rows[0]["TransNo"].ToString()); lblTransferBy.Text = obj_Comm.ToTitleCase(Session["UserName"].ToString()); lblTransferDate.Text = obj_Comm.ToTitleCase(DS.Tables[0].Rows[0]["Date"].ToString()); } if (DS.Tables[1].Rows.Count > 0) { GridDetails.DataSource = DS.Tables[1]; GridDetails.DataBind(); } } } catch (Exception ex) { throw new Exception(ex.Message); } }
private void SetInitialRow() { DataTable Dt = new DataTable(); DataRow dr; Dt.Columns.Add("DamageNo", typeof(string)); Dt.Columns.Add("Date", typeof(string)); Dt.Columns.Add("type", typeof(string)); Dt.Columns.Add("Employee", typeof(string)); Dt.Columns.Add("InwardNo", typeof(string)); Dt.Columns.Add("InwardDate", typeof(string)); Dt.Columns.Add("PONO", typeof(string)); Dt.Columns.Add("Suplier", typeof(string)); Dt.Columns.Add("Amount", typeof(string)); dr = Dt.NewRow(); dr["DamageNo"] = ""; dr["Date"] = ""; dr["type"] = ""; dr["Employee"] = ""; dr["InwardNo"] = ""; dr["InwardDate"] = ""; dr["PONO"] = ""; dr["Suplier"] = ""; dr["Amount"] = "0.00"; Dt.Rows.Add(dr); ViewState["CurrentTable"] = Dt; GridDetails.DataSource = Dt; GridDetails.DataBind(); }
protected void ReportGrid_RowCommand(object sender, GridViewCommandEventArgs e) { try { switch (e.CommandName) { case ("Select"): { ViewState["EditID"] = Convert.ToInt32(e.CommandArgument); DS = Obj_Recipe.GetRecordForEdit(Convert.ToInt32(e.CommandArgument), out StrError); if (DS.Tables.Count > 0) { if (DS.Tables[0].Rows.Count > 0) { txtDate.Text = DS.Tables[0].Rows[0]["OrderDate"].ToString(); txtTotalOrderCost.Text = DS.Tables[0].Rows[0]["TotalOrderCost"].ToString(); } if (DS.Tables[1].Rows.Count > 0) { GridDetails.DataSource = DS.Tables[1]; ViewState["CurrentTable"] = DS.Tables[1]; GridDetails.DataBind(); } if (DS.Tables[2].Rows.Count > 0) { GridItemDtls.DataSource = DS.Tables[2]; ViewState["ItemDetails"] = DS.Tables[2]; GridItemDtls.DataBind(); } else { SetInitialRow(); } BtnUpdate.Visible = true; BtnSave.Visible = false; } } break; case ("Delete"): { ViewState["DeleteID"] = Convert.ToInt32(e.CommandArgument); Entity_Recipe.OrderId = Convert.ToInt32(e.CommandArgument); Entity_Recipe.UserId = Convert.ToInt32(Session["UserId"]); Entity_Recipe.LoginDate = Convert.ToDateTime(DateTime.Now.ToShortDateString()); int DeletedRow = Obj_Recipe.DeleteRecord(ref Entity_Recipe, out StrError); if (DeletedRow != 0) { obj_Comm.ShowPopUpMsg("Record Deleted Successfully!", this.Page); MakeEmptyForm(); } } break; } } catch (Exception ex) { throw new Exception(ex.Message); } }
public void SetInitialRow() { try { DataTable dt = new DataTable(); DataRow dr = null; dt.Columns.Add(new DataColumn("#", typeof(int))); dt.Columns.Add(new DataColumn("RecipeId", typeof(Int32))); dt.Columns.Add(new DataColumn("RecipeName", typeof(string))); dt.Columns.Add(new DataColumn("Quantity", typeof(string))); dt.Columns.Add(new DataColumn("AmtPerPlate", typeof(string))); dt.Columns.Add(new DataColumn("TotalAmt", typeof(decimal))); dr = dt.NewRow(); dr["#"] = 0; dr["RecipeId"] = 0; dr["RecipeName"] = string.Empty; dr["Quantity"] = string.Empty; dr["AmtPerPlate"] = string.Empty; dr["TotalAmt"] = 0; dt.Rows.Add(dr); ViewState["CurrentTable"] = dt; GridDetails.DataSource = dt; GridDetails.DataBind(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public string GetGridDetails(GridDetails param) { var accountDetails = new GridParam { DisplayLength = param.length, DisplayStart = param.start, SortDir = param.order[0].dir, SortCol = param.order[0].column, Flag = "A", Search = param.search.value, UserName = StaticData.GetUser() }; var gridList = buss.GetGridList(accountDetails); foreach (var item in gridList) { item.Action = StaticData.GetActions(ControllerName, item.UniqueId, "", AddEditId); //item.CreatedDate = StaticData.DBToFrontDate(item.CreatedDate); } HtmlGrid <GadgetCommon> companyGrid = new HtmlGrid <GadgetCommon>(); var firstDefault = gridList.FirstOrDefault(); companyGrid.aaData = gridList; if (firstDefault != null) { companyGrid.iTotalDisplayRecords = Convert.ToInt32(firstDefault.FilterCount); companyGrid.iTotalRecords = Convert.ToInt32(firstDefault.FilterCount); } var result = JsonConvert.SerializeObject(companyGrid).ToString(); return(result); }
private void SetInitialRow() { DataTable dt = new DataTable(); DataRow dr; dt.Columns.Add("#", typeof(Int32)); dt.Columns.Add("BankId", typeof(Int32)); dt.Columns.Add("BankName", typeof(string)); dt.Columns.Add("AccountNo", typeof(string)); dt.Columns.Add("NoteB", typeof(string)); dr = dt.NewRow(); dr["#"] = 0; dr["BankId"] = 0; dr["BankName"] = ""; dr["AccountNo"] = ""; dr["NoteB"] = ""; dt.Rows.Add(dr); ViewState["CurrentTable"] = dt; GridDetails.DataSource = dt; GridDetails.DataBind(); }
private void SetInitialRow() { DataTable dt = new DataTable(); DataRow dr; dt.Columns.Add("#", typeof(Int32)); dt.Columns.Add("EmployeeId", typeof(Int32)); dt.Columns.Add("PersonName", typeof(string)); dt.Columns.Add("ContactNo", typeof(string)); dt.Columns.Add("EmailId", typeof(string)); dt.Columns.Add("Address", typeof(string)); dr = dt.NewRow(); dr["#"] = 0; dr["EmployeeId"] = 0; dr["PersonName"] = ""; dr["ContactNo"] = ""; dr["EmailId"] = ""; dr["Address"] = ""; dt.Rows.Add(dr); ViewState["CurrentTable"] = dt; GridDetails.DataSource = dt; GridDetails.DataBind(); }
protected void ImgBtnExcel_Click(object sender, ImageClickEventArgs e) { try { if (!TxtForMonth.Text.Equals("")) { StrCondition += " and RC.RequisitionDate Between '" + Convert.ToDateTime(TxtForMonth.Text).ToString("MM-dd-yyyy") + "' and '" + Convert.ToDateTime(TxtForMonth.Text).ToString("MM-dd-yyyy") + "'"; } if (TxtForMonth.Text.Equals("")) { StrCondition += " and RC.RequisitionDate Between '" + Convert.ToDateTime("01-Jan-1990").ToString("MM-dd-yyyy") + "' and '" + Convert.ToDateTime(DateTime.Now.ToShortDateString()).ToString("MM-dd-yyyy") + "'"; } if (Convert.ToInt32(ddlRequisitionNo.SelectedValue) > 0) { StrCondition += " and RC.RequisitionCafeId = " + Convert.ToInt32(ddlRequisitionNo.SelectedValue); } if (Convert.ToInt32(ddlInwardNo.SelectedValue) > 0) { StrCondition += " and OUR.OutwardId = " + Convert.ToInt32(ddlInwardNo.SelectedValue); } if (!Convert.ToBoolean(Session["IsCentral"].ToString())) { StrCondition = StrCondition + " AND RC.CafeteriaId=" + Convert.ToInt32(Session["CafeteriaId"].ToString()); } DS = Obj_Reports.MonthReportReport(StrCondition, out StrError); DS.Tables[0].Columns[1].ColumnName = "Requisition Date"; DS.Tables[0].Columns[4].ColumnName = "Assign Date"; DS.Tables[0].Columns[5].ColumnName = "Particular"; DS.Tables[0].Columns[6].ColumnName = "Category"; DS.Tables[0].Columns[7].ColumnName = "Requisition_Qty"; DS.Tables[0].Columns[8].ColumnName = "Assign_Qty"; DS.Tables[0].Columns[9].ColumnName = "Pending_Qty"; if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0) { GridView GridExp = new GridView(); GridExp.DataSource = DS.Tables[0]; GridExp.DataBind(); Obj_Comm.Export("MonthlyReport" + "_" + DateTime.Now.ToString("dd-MMM-yyyy") + ".xls", GridExp); } else { Obj_Comm.ShowPopUpMsg("No Data Found To Export...!", this.Page); DS.Dispose(); GridDetails.DataSource = null; GridDetails.DataBind(); } DS = null; } catch (ThreadAbortException tex) { } catch (Exception ex) { Obj_Comm.ShowPopUpMsg(ex.Message, this.Page); } }
protected void ddlRequisitionNo_SelectedIndexChanged(object sender, EventArgs e) { bool DupFlag = false; int ID = 0; try { if (GrdReport.Rows.Count != null) { for (int i = 0; i < GrdReport.Rows.Count; i++) { if (Convert.ToInt32(GrdReport.Rows[i].Cells[6].Text) == Convert.ToInt32(ddlRequisitionNo.SelectedValue)) { DupFlag = true; ViewState["DupFlag1"] = true; ID = Convert.ToInt32(GrdReport.Rows[i].Cells[7].Text); } } } if (DupFlag == false) { ID = Convert.ToInt32(ddlRequisitionNo.SelectedValue); } DS = Obj_IssueRegister.FillItemGrid(ID, out StrError, DupFlag); if (DS.Tables.Count > 0) { if (DupFlag == false) { TxtReqstnDate.Text = Convert.ToDateTime(DS.Tables[0].Rows[0]["RequisitionDate"]).ToString("dd-MMM-yyyy"); TxtReqBy.Text = Session["UserName"].ToString(); //DS.Tables[0].Rows[0]["CreatedBy"].ToString(); // lblCafeteria.Text = DS.Tables[0].Rows[0]["Cafeteria"].ToString(); } else { TxtReqstnDate.Text = Convert.ToDateTime(DS.Tables[1].Rows[0]["RequisitionDate"]).ToString("dd-MMM-yyyy"); TxtReqBy.Text = DS.Tables[1].Rows[0]["CreatedBy"].ToString(); // lblCafeteria.Text = DS.Tables[1].Rows[0]["Cafeteria"].ToString(); } GridDetails.DataSource = null; GridDetails.DataBind(); GridDetails.DataSource = DS.Tables[0]; GridDetails.DataBind(); ViewState["CurrentTable"] = DS.Tables[0]; //for (int i = 0; i < GridDetails.Rows.Count; i++) //{ // if (Convert.ToDecimal(GridDetails.Rows[i].Cells[5].Text) == 0) // { // GridDetails.Rows[i].Enabled = false; // } //} } } catch (Exception ex) { Obj_Comm.ShowPopUpMsg(ex.Message, this.Page); } }
public void ReportGrid() { StrCondition = string.Empty; try { if (ChkFromDate.Checked) { StrCondition += " and IR.IssueDate Between '" + Convert.ToDateTime(TxtFromDate.Text).ToString("MM-dd-yyyy") + "'and'" + Convert.ToDateTime(TxtToDate.Text).ToString("MM-dd-yyyy") + "'"; } if (!ChkFromDate.Checked) { StrCondition += " and IR.IssueDate Between '" + Convert.ToDateTime("01-Jan-1990").ToString("MM-dd-yyyy") + "' and '" + Convert.ToDateTime(DateTime.Now.ToShortDateString()).ToString("MM-dd-yyyy") + "'"; } if (Convert.ToInt32(ddlIssueNo.SelectedValue) > 0) { StrCondition += " and IR.IssueRegisterId=" + Convert.ToInt32(ddlIssueNo.SelectedValue); } if (Convert.ToInt32(ddlItem.SelectedValue) > 0) { StrCondition += " and IM.ItemId=" + Convert.ToInt32(ddlItem.SelectedValue); } if (Convert.ToInt32(ddlLocation.SelectedValue) > 0) { StrCondition += " and SL.StockLocationID=" + Convert.ToInt32(ddlLocation.SelectedValue); } DS = Obj_IssueRegister.ShowIssueRegisterDetailsReport(StrCondition, out StrError); if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0) { if (!FlagPrint) { ImgBtnPrint.Visible = true; } GridDetails.DataSource = DS.Tables[0]; GridDetails.DataBind(); lblCount.Text = DS.Tables[0].Rows.Count.ToString() + "Record Found"; DS = null; //ScriptManager.RegisterStartupScript(this,this.GetType(),"starScript","") } else { GridDetails.DataSource = DS.Tables[0]; GridDetails.DataBind(); lblCount.Text = ""; DS = null; SetInitialRow(); ImgBtnPrint.Visible = false; } } catch (Exception ex) { throw new Exception(ex.Message); } }
protected void GrdReport_ItemCommand(object source, RepeaterCommandEventArgs e) { try { switch (e.CommandName) { case ("Select"): { if (Convert.ToInt32(e.CommandArgument) != 0) { ViewState["EditID"] = Convert.ToInt32(e.CommandArgument); Ds = Obj_Call.GetRecordForEdit(Convert.ToInt32(e.CommandArgument), out StrError); if (Ds.Tables.Count > 0 && Ds.Tables[0].Rows.Count > 0) { ddlProject.SelectedValue = Ds.Tables[0].Rows[0]["PCId"].ToString(); } else { MakeEmptyForm(); } if (Ds.Tables.Count > 0 && Ds.Tables[1].Rows.Count > 0) { GridDetails.DataSource = Ds.Tables[1]; GridDetails.DataBind(); ViewState["CurrentTable"] = Ds.Tables[1]; } else { //MakeEmptyForm(); SetInitialRow(); } Ds = null; Obj_Call = null; BtnSave.Visible = false; if (!FlagEdit) { BtnUpdate.Visible = true; } if (!FlagDel) { BtnDelete.Visible = true; } //TxtCountry.Focus(); } break; } } } catch (Exception ex) { throw new Exception(ex.Message); } }
protected void GrdReport_ItemCommand(object source, RepeaterCommandEventArgs e) { try { switch (e.CommandName) { case ("Select"): { if (Convert.ToInt32(e.CommandArgument) != 0) { ViewState["EditID"] = Convert.ToInt32(e.CommandArgument); Ds = Obj_TaxMaster.GetTaxMasterForEdit(Convert.ToInt32(e.CommandArgument), out StrError); if (Ds.Tables.Count > 0 && Ds.Tables[0].Rows.Count > 0) { TxtTaxName.Text = Ds.Tables[0].Rows[0]["TaxName"].ToString(); //TxtTaxPer.Text = Ds.Tables[0].Rows[0]["TaxPer"].ToString(); //TXTEFFECTIVEDATE.Text =!string.IsNullOrEmpty(Ds.Tables[0].Rows[0]["EffectiveFrom"].ToString())?Ds.Tables[0].Rows[0]["EffectiveFrom"].ToString():DateTime.Now.ToString("dd-MMM-yyyy"); ////TxtTaxName.Enabled = false; //RdoTaxType.SelectedValue = !string.IsNullOrEmpty(Ds.Tables[0].Rows[0]["TaxTypeID"].ToString()) ? Convert.ToString((Ds.Tables[0].Rows[0]["TaxTypeID"].ToString())) : "1"; } else { MakeEmptyForm(); } if (Ds.Tables.Count > 0 && Ds.Tables[1].Rows.Count > 0) { GridDetails.DataSource = Ds.Tables[1]; GridDetails.DataBind(); ViewState["CurrentTable"] = Ds.Tables[1]; } else { GridDetails.DataSource = null; GridDetails.DataBind(); ViewState["CurrentTable"] = null; } Ds = null; Obj_TaxMaster = null; if (!FlagEdit) { BtnUpdate.Visible = true; } BtnSave.Visible = false; if (!FlagDel) { BtnDelete.Visible = true; } TxtTaxName.Focus(); } break; } } } catch (Exception ex) { throw new Exception(ex.Message); } }
protected void ImgBtnExcel_Click(object sender, ImageClickEventArgs e) { try { if (ChkFromDate.Checked) { StrCondition += " and OWR.StockAsOn>= '" + Convert.ToDateTime(TxtFromDate.Text).ToString("MM-dd-yyyy") + "' and OWR.StockAsOn<='" + Convert.ToDateTime(TxtToDate.Text).ToString("MM-dd-yyyy") + "'"; } if (!ChkFromDate.Checked) { StrCondition += " and OWR.StockAsOn>= '" + Convert.ToDateTime("01-Jan-1990").ToString("MM-dd-yyyy") + "' and OWR.StockAsOn<='" + Convert.ToDateTime(DateTime.Now.ToShortDateString()).ToString("MM-dd-yyyy") + "'"; } //if (Convert.ToInt32(ddlStockNo.SelectedValue) > 0) //{ // StrCondition += " and OWRD.LocationId = " + Convert.ToInt32(ddlStockNo.SelectedValue); //} if (!Convert.ToBoolean(Session["IsCentral"].ToString())) { StrCondition = StrCondition + " AND OWR.Location =" + Convert.ToInt32(Session["CafeteriaId"].ToString()); } if (Convert.ToBoolean(Session["IsCentral"].ToString())) { if (Convert.ToInt32(ddlStockNo.SelectedValue) > 0) { StrCondition = StrCondition + " and OWR.Location =" + Convert.ToInt32(ddlStockNo.SelectedValue); } } DS = Obj_Reports.MonthReportReport(StrCondition, out StrError); if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0) { GridView GridExp = new GridView(); GridExp.DataSource = DS.Tables[0]; GridExp.DataBind(); Obj_Comm.Export("Cost_Centre_Wise_Report" + "_" + DateTime.Now.ToString("dd-MMM-yyyy") + ".xls", GridExp); } else { Obj_Comm.ShowPopUpMsg("No Data Found To Export...!", this.Page); DS.Dispose(); GridDetails.DataSource = null; GridDetails.DataBind(); } DS = null; } catch (ThreadAbortException tex) { } catch (Exception ex) { Obj_Comm.ShowPopUpMsg(ex.Message, this.Page); } }
protected void GrdReport_ItemCommand(object source, RepeaterCommandEventArgs e) { try { switch (e.CommandName) { case ("Select"): { if (Convert.ToInt32(e.CommandArgument) != 0) { ViewState["EditID"] = Convert.ToInt32(e.CommandArgument); Ds = Obj_UnitConversion.GetRecordToEdit(Convert.ToInt32(e.CommandArgument), out StrError); if (Ds.Tables.Count > 0) { if (Ds.Tables.Count > 0 && Ds.Tables[0].Rows.Count > 0) { ddlUnit.SelectedValue = Ds.Tables[0].Rows[0]["UnitId"].ToString(); } if (Ds.Tables[1].Rows.Count > 0) { GridDetails.DataSource = Ds.Tables[1]; GridDetails.DataBind(); ViewState["CurrentTable"] = Ds.Tables[1]; } else { MakeEmptyForm(); } } Ds = null; Obj_UnitConversion = null; if (!FlagEdit) { BtnUpdate.Visible = true; } BtnSave.Visible = false; if (!FlagDel) { BtnDelete.Visible = true; } ddlUnit.Focus(); MakeControlEmpty(); } break; } } } catch (Exception ex) { obj_Comman.ShowPopUpMsg(ex.Message, this.Page); return; } }
protected void ImgAddGrid_Click(object sender, ImageClickEventArgs e) { try { if (ViewState["CurrentTable"] != null) { DataTable dtCurrentTable = (DataTable)ViewState["CurrentTable"]; DataRow dtTableRow = null; if (dtCurrentTable.Rows.Count > 0) { if (string.IsNullOrEmpty(dtCurrentTable.Rows[0]["UnitFactor"].ToString())) { dtCurrentTable.Rows.RemoveAt(0); } } if (ViewState["GridIndex"] != null) { int rowindex = Convert.ToInt32(ViewState["GridIndex"]); dtCurrentTable.Rows[rowindex]["UnitId"] = Convert.ToInt32(ddlUnitConversion.SelectedValue); dtCurrentTable.Rows[rowindex]["UnitFactor"] = ddlUnitConversion.SelectedItem.Text; dtCurrentTable.Rows[rowindex]["Qty"] = Convert.ToDecimal(txtQty.Text); ViewState["CurrentTable"] = dtCurrentTable; GridDetails.DataSource = dtCurrentTable; GridDetails.DataBind(); MakeControlEmpty(); } else { dtTableRow = dtCurrentTable.NewRow(); dtTableRow["#"] = 0; dtTableRow["UnitId"] = Convert.ToInt32(ddlUnitConversion.SelectedValue); dtTableRow["UnitFactor"] = ddlUnitConversion.SelectedItem.Text; dtTableRow["Qty"] = Convert.ToDecimal(txtQty.Text); dtCurrentTable.Rows.Add(dtTableRow); ViewState["CurrentTable"] = dtCurrentTable; GridDetails.DataSource = dtCurrentTable; GridDetails.DataBind(); MakeControlEmpty(); } } } catch (Exception ex) { obj_Comman.ShowPopUpMsg(ex.Message, this.Page); } }
private void SetInitialRow() { DataTable Dt = new DataTable(); DataRow dr; Dt.Columns.Add("RequisitionNo", typeof(string)); Dt.Columns.Add("ReqDate", typeof(string)); Dt.Columns.Add("IssuseNo", typeof(string)); Dt.Columns.Add("IssuseDate", typeof(string)); Dt.Columns.Add("ReqLocation", typeof(string)); Dt.Columns.Add("IssuseLocation", typeof(string)); Dt.Columns.Add("ReqBy", typeof(string)); Dt.Columns.Add("IssuBy", typeof(string)); Dt.Columns.Add("CategoryName", typeof(string)); Dt.Columns.Add("ItemName", typeof(string)); Dt.Columns.Add("ItemDesc", typeof(string)); Dt.Columns.Add("RemarkForPO", typeof(string)); Dt.Columns.Add("Unit", typeof(string)); Dt.Columns.Add("Qty", typeof(decimal)); Dt.Columns.Add("OutwardQty", typeof(decimal)); Dt.Columns.Add("PendingQty", typeof(decimal)); Dt.Columns.Add("Rate", typeof(decimal)); Dt.Columns.Add("Amount", typeof(decimal)); dr = Dt.NewRow(); dr["RequisitionNo"] = ""; dr["ReqDate"] = ""; dr["IssuseNo"] = ""; dr["IssuseDate"] = ""; dr["ReqLocation"] = ""; dr["IssuseLocation"] = ""; dr["ReqBy"] = ""; dr["IssuBy"] = ""; dr["CategoryName"] = ""; dr["ItemName"] = ""; dr["ItemDesc"] = ""; dr["RemarkForPO"] = ""; dr["Unit"] = ""; dr["Qty"] = 0; dr["OutwardQty"] = 0; dr["PendingQty"] = 0; dr["Rate"] = 0; dr["Amount"] = 0; Dt.Rows.Add(dr); ViewState["CurrentTable"] = Dt; GridDetails.DataSource = Dt; GridDetails.DataBind(); }
private void SetInitialRow() { DataTable Dt = new DataTable(); DataRow dr; Dt.Columns.Add("#", typeof(int)); Dt.Columns.Add("RequisitionNo", typeof(string)); Dt.Columns.Add("Date", typeof(string)); Dt.Columns.Add("Cafeteria", typeof(string)); Dt.Columns.Add("Employee", typeof(string)); Dt.Columns.Add("Amount", typeof(string)); Dt.Columns.Add("Category", typeof(string)); Dt.Columns.Add("SubCategory", typeof(string)); Dt.Columns.Add("Items", typeof(string)); Dt.Columns.Add("ItemDesc", typeof(string)); Dt.Columns.Add("RemarkForPO", typeof(string)); Dt.Columns.Add("MinStockLevel", typeof(string)); Dt.Columns.Add("Qty", typeof(string)); Dt.Columns.Add("Suplier", typeof(string)); Dt.Columns.Add("Rate", typeof(string)); Dt.Columns.Add("Unit", typeof(string)); Dt.Columns.Add("PONo", typeof(string)); Dt.Columns.Add("POQty", typeof(string)); Dt.Columns.Add("SuplierName", typeof(string)); Dt.Columns.Add("SuplierInfo", typeof(string)); dr = Dt.NewRow(); dr["#"] = 0; dr["RequisitionNo"] = ""; dr["Date"] = ""; dr["Cafeteria"] = ""; dr["Employee"] = ""; dr["Amount"] = "0.00"; dr["Items"] = ""; dr["ItemDesc"] = ""; dr["RemarkForPO"] = ""; dr["MinStockLevel"] = ""; dr["Qty"] = ""; dr["Suplier"] = ""; dr["Rate"] = ""; dr["Category"] = ""; dr["SubCategory"] = ""; dr["Unit"] = ""; Dt.Rows.Add(dr); ViewState["CurrentTable"] = Dt; GridDetails.DataSource = Dt; GridDetails.DataBind(); }
protected void ImgBtnExcel_Click(object sender, ImageClickEventArgs e) { try { if (ChkFromDate.Checked == true) { StrCondition += " and IR.IssueDate Between '" + Convert.ToDateTime("01-Jan-1990").ToString("MM-dd-yyyy") + " 'and'" + Convert.ToDateTime(DateTime.Now.ToShortDateString()).ToString("MM-dd-yyyy") + "'"; } if (Convert.ToInt32(ddlIssueNo.SelectedValue) > 0) { StrCondition += " and IR.IssueRegisterId=" + Convert.ToInt32(ddlIssueNo.SelectedValue); } if (Convert.ToInt32(ddlItem.SelectedValue) > 0) { StrCondition += " and IM.ItemId=" + Convert.ToInt32(ddlItem.SelectedValue); } if (Convert.ToInt32(ddlLocation.SelectedValue) > 0) { StrCondition += " and IRD.StockLocationID=" + Convert.ToInt32(ddlLocation.SelectedValue); } if (Convert.ToInt32(ddlEmp.SelectedValue) > 0) { StrCondition += " and EM.EmployeeId=" + Convert.ToInt32(ddlEmp.SelectedValue); } DS = Obj_IssueRegister.ShowIssueRegisterDetailsReport(StrCondition, out StrError); if (DS.Tables.Count > 0 && DS.Tables[0].Rows.Count > 0) { GridView GridExp = new GridView(); GridExp.DataSource = DS.Tables[0]; GridExp.DataBind(); Obj_Comm.Export("Material Issued Report.xls", GridExp); } else { Obj_Comm.ShowPopUpMsg("No Data Found To Export...!", this.Page); DS.Dispose(); GridDetails.DataSource = null; GridDetails.DataBind(); } DS = null; } catch (ThreadAbortException tex) { } catch (Exception ex) { Obj_Comm.ShowPopUpMsg(ex.Message, this.Page); } }
private void SetInitialRow() { DataTable Dt = new DataTable(); DataRow dr; Dt.Columns.Add("Type", typeof(string)); Dt.Columns.Add("StockNo", typeof(string)); Dt.Columns.Add("Date", typeof(string)); Dt.Columns.Add("Employee", typeof(string)); Dt.Columns.Add("INDATE", typeof(string)); Dt.Columns.Add("Unit", typeof(string)); Dt.Columns.Add("Category", typeof(string)); Dt.Columns.Add("Items", typeof(string)); Dt.Columns.Add("ItemDesc", typeof(string)); Dt.Columns.Add("InwardQty", typeof(string)); Dt.Columns.Add("OutwardQty", typeof(string)); Dt.Columns.Add("PendingQty", typeof(string)); Dt.Columns.Add("OutwardRate", typeof(string)); Dt.Columns.Add("Location", typeof(string)); Dt.Columns.Add("InwardNo", typeof(string)); Dt.Columns.Add("Pending_Qty", typeof(string)); Dt.Columns.Add("Status", typeof(string)); Dt.Columns.Add("Amount", typeof(string)); dr = Dt.NewRow(); dr["Type"] = ""; dr["StockNo"] = ""; dr["Date"] = ""; dr["Employee"] = ""; dr["INDATE"] = ""; dr["Unit"] = ""; dr["Items"] = ""; dr["ItemDesc"] = ""; dr["InwardQty"] = ""; dr["OutwardQty"] = ""; dr["PendingQty"] = ""; dr["OutwardRate"] = ""; dr["Location"] = ""; dr["Category"] = ""; dr["InwardNo"] = ""; dr["Pending_Qty"] = ""; dr["Status"] = ""; dr["Amount"] = ""; Dt.Rows.Add(dr); ViewState["CurrentTable"] = Dt; GridDetails.DataSource = Dt; GridDetails.DataBind(); }
private void SetInitialRow() { DataTable Dt = new DataTable(); DataRow dr; Dt.Columns.Add("DamageNo", typeof(string)); Dt.Columns.Add("Date", typeof(string)); Dt.Columns.Add("Employee", typeof(string)); Dt.Columns.Add("InwardNo", typeof(string)); Dt.Columns.Add("Unit", typeof(string)); Dt.Columns.Add("type", typeof(string)); Dt.Columns.Add("InwardDate", typeof(string)); Dt.Columns.Add("PONO", typeof(string)); Dt.Columns.Add("Suplier", typeof(string)); Dt.Columns.Add("Category", typeof(string)); Dt.Columns.Add("ItemName", typeof(string)); Dt.Columns.Add("ItemDesc", typeof(string)); Dt.Columns.Add("DamageQty", typeof(string)); Dt.Columns.Add("Reason", typeof(string)); Dt.Columns.Add("Rate", typeof(decimal)); Dt.Columns.Add("Amount", typeof(decimal)); dr = Dt.NewRow(); dr["DamageNo"] = ""; dr["Date"] = ""; dr["Employee"] = ""; dr["Unit"] = ""; dr["type"] = ""; dr["InwardNo"] = ""; dr["InwardDate"] = ""; dr["PONO"] = ""; dr["Suplier"] = ""; dr["Category"] = ""; dr["ItemName"] = ""; dr["ItemDesc"] = ""; dr["DamageQty"] = ""; dr["Reason"] = ""; dr["Rate"] = 0.00; dr["Amount"] = 0.00; Dt.Rows.Add(dr); ViewState["CurrentTable"] = Dt; GridDetails.DataSource = Dt; GridDetails.DataBind(); }
public async Task <string> GetGridDetails(GridDetails param) { _log.Information("Get User Lists For Grid"); var gridParam = _mapper.Map <GridParam>(param); gridParam.Flag = "UserLists"; gridParam.UserName = User.Identity.Name; _log.Information("User Lists With Parameters {0}", JsonConvert.SerializeObject(gridParam)); var userLists = await _userManagementBusiness.GetUserLists(gridParam); _log.Information("User Lists Response with details {0}", JsonConvert.SerializeObject(userLists)); var result = JsonConvert.SerializeObject(userLists); return(result); }
public string GetGridDetails(GridDetails param) { _log.Information("Get Role Lists For Grid"); var gridParam = _mapper.Map <GridParam>(param); gridParam.Flag = "RoleLists"; gridParam.UserName = User.Identity.Name; _log.Information("Role Lists With Parameters {0}", JsonConvert.SerializeObject(gridParam)); var roleList = _roleManagementBusiness.GetRoleLists(gridParam); _log.Information("Role Lists Response with details {0}", JsonConvert.SerializeObject(roleList)); var result = JsonConvert.SerializeObject(roleList); return(result); }
private void ButtonExport_Click(object sender, RoutedEventArgs e) { this.textProgressInformation.Text = "Document exportation started..."; this.progressScrollViewer.ScrollToBottom(); Microsoft.Win32.SaveFileDialog saveFileDialog = new Microsoft.Win32.SaveFileDialog(); saveFileDialog.Filter = "XPS files (*.xps)|*.xps|All files (*.*)|*.*"; bool jobCompleted = false; if (saveFileDialog.ShowDialog().GetValueOrDefault()) { Size size = new Size(8.5d * 96.0d, 11.0d * 96.0d); m_printButton.IsEnabled = false; m_exportButton.IsEnabled = false; try { jobCompleted = GridDetails.ExportToXps(saveFileDialog.FileName, size, new Rect(size), new PageRange(1, 0), CompressionOption.Normal, new EventHandler <ProgressEventArgs>(this.ProgressionCallBack), true); } catch (System.IO.IOException) { jobCompleted = false; } finally { m_printButton.IsEnabled = true; m_exportButton.IsEnabled = true; } } if (jobCompleted) { this.textProgressInformation.Text += "\n...Completed."; } else { this.textProgressInformation.Text += "\n...Canceled."; } this.progressScrollViewer.ScrollToBottom(); }
protected void ImgBtnAdd_Click(object sender, ImageClickEventArgs e) { try { if (ViewState["CurrentTable"] != null) { DataTable dtCurrentTable = (DataTable)ViewState["CurrentTable"]; DataRow dtTableRow = null; bool DupFlag = false; int k = 0; if (dtCurrentTable.Rows.Count == 1 && string.IsNullOrEmpty(dtCurrentTable.Rows[0]["NewGSTApplicableDate"].ToString())) { dtCurrentTable.Rows.RemoveAt(0); } if (ViewState["GridIndex"] != null) { k = Convert.ToInt32(ViewState["GridIndex"]); dtCurrentTable.Rows[k]["GSTPer"] = TxtTaxPer.Text; dtCurrentTable.Rows[k]["NewGSTApplicableDate"] = TXTEFFECTIVEDATE.Text; ViewState["CurrentTable"] = dtCurrentTable; GridDetails.DataSource = dtCurrentTable; GridDetails.DataBind(); MakeControlEmpty(); } else { dtTableRow = dtCurrentTable.NewRow(); int rowindex = Convert.ToInt32(ViewState["GridIndex"]); dtTableRow["GSTPer"] = TxtTaxPer.Text; dtTableRow["NewGSTApplicableDate"] = TXTEFFECTIVEDATE.Text; dtCurrentTable.Rows.Add(dtTableRow); ViewState["CurrentTable"] = dtCurrentTable; GridDetails.DataSource = dtCurrentTable; GridDetails.DataBind(); MakeControlEmpty(); } } } catch (Exception ex) { throw new Exception(ex.Message); } }
private void SetInitialRow() { DataTable dt = new DataTable(); DataRow dr; dt.Columns.Add("#", typeof(Int32)); dt.Columns.Add("Location", typeof(string)); dt.Columns.Add("SuplierName", typeof(string)); dt.Columns.Add("SupplierId", typeof(Int32)); dt.Columns.Add("PurchaseRate", typeof(decimal)); dt.Columns.Add("OpeningStock", typeof(decimal)); dt.Columns.Add("LocationId", typeof(decimal)); dt.Columns.Add("ItemDesc", typeof(string)); dt.Columns.Add("MainUnitFactor", typeof(decimal)); dt.Columns.Add("UnitID", typeof(Int32)); dt.Columns.Add("MainUnit", typeof(string)); dt.Columns.Add("SubUnitFactor", typeof(decimal)); dt.Columns.Add("SubUnitID", typeof(Int32)); dt.Columns.Add("SubUnit", typeof(string)); dr = dt.NewRow(); dr["#"] = 0; dr["Location"] = ""; dr["SuplierName"] = ""; dr["SupplierId"] = 0; dr["PurchaseRate"] = 0.00; dr["OpeningStock"] = 0.00; dr["LocationId"] = 0.00; dr["ItemDesc"] = ""; dr["MainUnitFactor"] = 0; dr["UnitID"] = 0; dr["MainUnit"] = ""; dr["SubUnitFactor"] = 0; dr["SubUnitID"] = 0; dr["SubUnit"] = ""; dt.Rows.Add(dr); ViewState["CurrentTable"] = dt; GridDetails.DataSource = dt; GridDetails.DataBind(); }
private void SetInitialRow() { DataTable Dt = new DataTable(); DataRow dr; Dt.Columns.Add("RequisitionNo", typeof(string)); Dt.Columns.Add("RequisitionDate", typeof(string)); Dt.Columns.Add("Cafeteria", typeof(string)); Dt.Columns.Add("AssignNo", typeof(string)); Dt.Columns.Add("AssignDate", typeof(decimal)); Dt.Columns.Add("ReqQty", typeof(string)); Dt.Columns.Add("AssignQty", typeof(string)); Dt.Columns.Add("PendingQty", typeof(string)); Dt.Columns.Add("Status", typeof(string)); Dt.Columns.Add("ItemName", typeof(string)); Dt.Columns.Add("Description", typeof(string)); Dt.Columns.Add("Remark", typeof(string)); Dt.Columns.Add("CategoryName", typeof(string)); Dt.Columns.Add("Unit", typeof(string)); dr = Dt.NewRow(); dr["RequisitionNo"] = ""; dr["RequisitionDate"] = ""; dr["Cafeteria"] = ""; dr["AssignNo"] = ""; dr["AssignDate"] = 0; dr["ReqQty"] = ""; dr["AssignQty"] = ""; dr["PendingQty"] = ""; dr["Status"] = ""; dr["ItemName"] = ""; dr["Description"] = ""; dr["Remark"] = ""; dr["CategoryName"] = ""; dr["Unit"] = ""; Dt.Rows.Add(dr); ViewState["CurrentTable"] = Dt; GridDetails.DataSource = Dt; GridDetails.DataBind(); }
private void ExportToExcel() { //if (System.Windows.Interop.BrowserInteropHelper.IsBrowserHosted) //{ //MessageBox.Show("Due to restricted user-access permissions, this feature cannot be demonstrated when the Live Explorer is running as an XBAP browser application. Please download the full Xceed DataGrid for WPF package and run the Live Explorer as a desktop application to try out this feature.", "Feature unavailable"); //return; //} // The simplest way to export in Excel format is to call the // DataGridControl.ExportToExcel() method. However, if you want to specify export // settings, you have to take the longer, more descriptive and flexible route: // the ExcelExporter class. // excelExporter.FixedColumnCount will automatically be set to the specified // grid's FixedColumnCount value. //ExcelExporter excelExporter = new ExcelExporter(this.GridDetails); //excelExporter.ExportStatFunctionsAsFormulas = this.exportStatFunctionsAsFormulasCheckBox.IsChecked.GetValueOrDefault(); //excelExporter.IncludeColumnHeaders = this.includeColumnHeadersCheckBox.IsChecked.GetValueOrDefault(); //excelExporter.IsHeaderFixed = this.isHeaderFixedCheckBox.IsChecked.GetValueOrDefault(); //excelExporter.RepeatParentData = this.repeatParentDataCheckBox.IsChecked.GetValueOrDefault(); //excelExporter.DetailDepth = Convert.ToInt32(this.detailDepthTextBox.Value); //excelExporter.StatFunctionDepth = Convert.ToInt32(this.statFunctionDepthTextBox.Value); //excelExporter.UseFieldNamesInHeader = this.UseFieldNamesInHeaderCheckBox.IsChecked.GetValueOrDefault(); Microsoft.Win32.SaveFileDialog saveFileDialog = new Microsoft.Win32.SaveFileDialog(); saveFileDialog.Filter = "XML Spreadsheet (*.xml)|*.xml|All files (*.*)|*.*"; try { if (saveFileDialog.ShowDialog().GetValueOrDefault()) { using (Stream stream = saveFileDialog.OpenFile()) { //excelExporter.Export(stream); GridDetails.ExportToExcel(stream); } } } catch { } }