//For saving the Product protected void btnSave_Click(object sender, EventArgs e) { //if (txt_Name.Text != string.Empty && txt_Mum_stock.Text != string.Empty && ddl_Category.SelectedValue != "-1" && txt_Procode.Text != string.Empty && txt_Dhl_stock.Text != string.Empty && txt_Chn_stock.Text != string.Empty && txt_Blr_stock.Text != string.Empty && txt_Ahm_stock.Text != string.Empty) //{ DataTable DTProduct = BusinessServices.Imaging_Product_Exists(Convert.ToInt32(ddlSupplier.SelectedValue), Convert.ToInt32(ddlType.SelectedValue), Convert.ToInt32(ddl_Category.SelectedValue), txt_Procode.Text.Trim()); if (DTProduct.Rows.Count > 0) { lbl_msg.Visible = true; lbl_msg.Text = "Product Already Exist"; } else { lbl_msg.Text = ""; bool result = BusinessServices.Imaging_Admin_Product_Insert(Convert.ToInt32(ddlSupplier.SelectedValue), Convert.ToInt32(ddlType.SelectedValue), Convert.ToInt32(ddl_Category.SelectedValue), txt_Procode.Text.Trim(), txt_Name.Text.Trim(), Convert.ToInt32(Txt_Record_level.Text.Trim()), Convert.ToInt32(Txt_Min_Qty.Text.Trim()), Convert.ToInt32(Txt_Man_Qty.Text.Trim())); if (result) { Clear(); ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Created Successfully..');</script>", false); } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Creation Failed..');</script>", false); } } }
protected void btnUpdate_Click(object sender, EventArgs e) { try { // DataTable DTTaxExists = BusinessServices.Imaging_TaxStrusture_Existsupdate(Convert.ToInt32(Session["ID"]),txtTaxStructure.Text.Trim(), ddl_Type.SelectedValue.ToString(), Convert.ToInt32(ddlState.SelectedValue), Convert.ToInt32(ddlLocation.SelectedValue), Convert.ToInt32(ddlcategory.SelectedValue), Convert.ToInt32(ddlSalesType.SelectedValue), Convert.ToInt32(ddlPurchaseType.SelectedValue)); DataTable DTTaxExists = BusinessServices.Imaging_TaxStrusture_Existsupdate(Convert.ToInt32(Session["TSID"]), txtTaxStructure.Text.Trim()); if (DTTaxExists.Rows.Count > 0) { lbl_msg.Text = "TaxStructure Already Exists"; return; } //bool result = BusinessServices.Imaging_Update_TAxStructure(Convert.ToInt32(Session["ID"]), ddl_Type.SelectedValue.ToString(), Convert.ToInt32(ddlState.SelectedValue), Convert.ToInt32(ddlLocation.SelectedValue), Convert.ToInt32(ddlcategory.SelectedValue), txtTaxStructure.Text.Trim(), Convert.ToInt32(ddlSalesType.SelectedValue), Convert.ToInt32(ddlPurchaseType.SelectedValue), Convert.ToInt32(Session["Id"]), Convert.ToInt32(ddlActive.SelectedValue)); bool result = BusinessServices.Imaging_Update_TAxStructure(Convert.ToInt32(Session["TSID"]), txtTaxStructure.Text.Trim(), Convert.ToInt32(Session["Id"]), Convert.ToInt32(ddlActive.SelectedValue)); if (result) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Updated Successfully..');</script>", false); Clear(); GetGrd(); } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Updation Failed..');</script>", false); } } catch (Exception ex) { throw ex; } }
protected void GvwCustomer_RowUpdating(object sender, GridViewUpdateEventArgs e) { // Retrieve updated data string ID = ((Label)GvwCustomer.Rows[e.RowIndex].FindControl("lbl_Categoryid")).Text; string Category = ((TextBox)GvwCustomer.Rows[e.RowIndex].FindControl("txtbox_Category")).Text; DataTable DTCategory = BusinessServices.Imaging_Category_ExistsforUpdate(Convert.ToInt32(ID), Category); if (DTCategory.Rows.Count > 0) { lbl_msg.Text = "Category Already Exist"; } else { bool result = BusinessServices.Imaging_Admin_category_update(Convert.ToInt32(ID), Category); Clear(); GvwCustomer.EditIndex = -1; // Display status message lbl_msg.Text = result ? "Updated successful" : "Updated failed"; // Reload the grid GetGrd(); GvwCustomer.Columns[1].Visible = true; } }
protected void btnSave_Click(object sender, EventArgs e) { if (txtCategory.Text != string.Empty) { DataTable Dt = new DataTable(); Dt = BusinessServices.PreventDublicate(txtCategory.Text.ToString()); if (Dt.Rows.Count > 0) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Vertical is alredy existed..');</script>", false); } else { bool result = BusinessServices.Imaging_Admin_Vertical_Insert(txtCategory.Text.Trim()); if (result) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Created Successfully..');</script>", false); txtCategory.Text = ""; GetGrd1(); lbl_msg.Text = ""; } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Creation Failed..');</script>", false); } } } else { AlertPageHelper.ShowAlert(this.Page, "Please Fill the Required Fields"); } }
protected void btnSave_Click(object sender, EventArgs e) { //if (txtCategory.Text != string.Empty) //{ DataTable DTDup = BusinessServices.CheckDupDispatch(txtCategory.Text.Trim()); if (DTDup.Rows.Count > 0) { lbl_msg.Text = "Dispatch Details Already Exists"; } else { bool result = BusinessServices.Imaging_Admin_Dispatch_Insert(txtCategory.Text.Trim()); if (result) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Created Successfully..');</script>", false); txtCategory.Text = ""; lbl_msg.Text = ""; GetGrd(); } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Creation Failed..');</script>", false); } } //} //else //{ // AlertPageHelper.ShowAlert(this.Page, "Please Fill the Required Fields"); //} }
public void btnCreate_Click(object sender, EventArgs e) { try { DataTable Dt = BusinessServices.ExistingRepresentativeName(Convert.ToInt32(ddlLocation.SelectedValue), Txtname.Text.Trim()); if (Dt.Rows.Count > 0) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Representative Name already Exist');</script>", false); BindRepresentative(); } else { bool result = BusinessServices.InsertRepresentativeName(Convert.ToInt32(ddlLocation.SelectedValue), Txtname.Text.Trim(), TxtDesignation.Text.Trim(), TxtEmail.Text.Trim(), Convert.ToInt32(ddlStatus.SelectedValue)); if (result) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Representative Name Created Successfully..');</script>", false); Clear(); BindRepresentative(); } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Creation Failed..');</script>", false); BindRepresentative(); } } } catch (Exception ex) { } }
protected void btnSave_Click(object sender, EventArgs e) { //if (txtCategory.Text != string.Empty) //{ DataTable DTCategory = BusinessServices.Imaging_Category_Exists(txtCategory.Text.Trim(), Convert.ToInt32(ddlCategory.SelectedValue)); if (DTCategory.Rows.Count > 0) { lbl_msg.Text = "Sub Category Already Exists"; } else { bool result = BusinessServices.Imaging_Admin_category_Insert(txtCategory.Text.Trim(), Convert.ToInt32(ddlCategory.SelectedValue)); if (result) { lbl_msg.Text = ""; Clear(); ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Created Successfully..');</script>", false); } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Creation Failed..');</script>", false); } } //} //else //{ // AlertPageHelper.ShowAlert(this.Page, "Please Fill the Required Fields"); //} }
protected void btnUpdate_Click(object sender, EventArgs e) { try { DataTable DTTaxExists = BusinessServices.VendorName_Existsupdate(Convert.ToInt32(Session["VID"]), txtVendor.Text.Trim()); if (DTTaxExists.Rows.Count > 0) { lbl_msg.Text = "Vendor Name Already Exists"; return; } bool result = BusinessServices.Update_VedorName(Convert.ToInt32(Session["VID"]), txtVendor.Text.Trim(), Convert.ToInt32(ddlActive.SelectedValue)); if (result) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Updated Successfully..');</script>", false); Clear(); GetGrd(); } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Updation Failed..');</script>", false); } } catch (Exception ex) { throw ex; } }
protected void btnUpdate_click(object Sender, EventArgs e) { try { DataTable Dt = BusinessServices.ExistingTaxNameForUpdate(Convert.ToInt32(Session["Tid"]), txtTaxname.Text.Trim()); // if(Convert.ToInt32(Session["id"])==Convert.ToInt32(Dt.Rows[0]["TaxNameID"].ToString())) if (Dt.Rows.Count > 0) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Tax Name already Exist');</script>", false); } else { bool result = BusinessServices.UpdateTaxName(Convert.ToInt32(Session["Tid"]), txtTaxname.Text.Trim(), Convert.ToInt32(ddlStatus.SelectedValue), Convert.ToInt32(TxtRank.Text)); if (result) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Tax Name Updated Successfully..');</script>", false); txtTaxname.Text = ""; ddlStatus.SelectedValue = "1"; BindTaxName(); btnUpdate.Enabled = false; btnCreate.Enabled = true; TxtRank.Text = ""; } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Update Failed..');</script>", false); BindTaxName(); } } } catch (Exception ex) { } }
protected void btnUpdate_Click(object sender, EventArgs e) { try { //DataTable DTTaxExists = BusinessServices.TaxRate_ExistsForUpdate(Convert.ToInt32(Session["TRID"]),ddl_Type.SelectedValue, Convert.ToInt32(ddlState.SelectedValue), Convert.ToInt32(ddlLocation.SelectedValue), Convert.ToInt32(ddlcategory.SelectedValue), Convert.ToInt32(ddlTaxName.SelectedValue), //Convert.ToInt32(ddlSalesType.SelectedValue), Convert.ToInt32(ddlPurchaseType.SelectedValue), Convert.ToDecimal(txtTaxRate.Text), Convert.ToDecimal(TxtBaseValue.Text), Convert.ToInt32(ddlActive.SelectedValue)); DataTable DTTaxExists = BusinessServices.TaxRate_ExistsForUpdate(Convert.ToInt32(Session["TRID"]), Convert.ToInt32(ddlTaxName.SelectedValue), Convert.ToInt32(ddlActive.SelectedValue)); if (DTTaxExists.Rows.Count > 0) { lbl_msg.Text = "TaxRate Already Exists"; return; } //bool result = BusinessServices.Update_TaxRate(Convert.ToInt32(Session["TRID"]), ddl_Type.SelectedValue, Convert.ToInt32(ddlState.SelectedValue), Convert.ToInt32(ddlLocation.SelectedValue), Convert.ToInt32(ddlcategory.SelectedValue), Convert.ToInt32(ddlTaxName.SelectedValue), //Convert.ToInt32(ddlSalesType.SelectedValue), Convert.ToInt32(ddlPurchaseType.SelectedValue), Convert.ToDecimal(txtTaxRate.Text), Convert.ToDecimal(TxtBaseValue.Text), Convert.ToInt32(ddlActive.SelectedValue)); bool result = BusinessServices.Update_TaxRate(Convert.ToInt32(Session["TRID"]), Convert.ToInt32(ddlTaxName.SelectedValue), Convert.ToDecimal(txtTaxRate.Text), Convert.ToDecimal(TxtBaseValue.Text), Convert.ToInt32(ddlActive.SelectedValue)); if (result) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Updated Successfully..');</script>", false); Clear(); BindTaxRateGrid(); } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Updation Failed..');</script>", false); } } catch (Exception EX) { throw EX; } }
protected void btnUpdate_Click(object sender, EventArgs e) { DataTable DTDup = BusinessServices.Imaging_CheckDuplicateTaxMappingUpdate(Convert.ToInt32(Session["TxtMapId"]), ddl_Type.SelectedValue, Convert.ToInt32(ddlState.SelectedValue), Convert.ToInt32(ddlLocation.SelectedValue), Convert.ToInt32(ddlcategory.SelectedValue), Convert.ToInt32(ddlTaxStructure.SelectedValue), Convert.ToInt32(ddlSalesType.SelectedValue), Convert.ToInt32(ddlPurchaseType.SelectedValue)); if (DTDup.Rows.Count > 0) { lbl_msg.Text = "Mapping already exists for the selected tax structure"; return; } bool Result = BusinessServices.TaxRateMappingMain_Update(Convert.ToInt32(Session["TxtMapId"]), ddl_Type.SelectedValue, Convert.ToInt32(ddlState.SelectedValue), Convert.ToInt32(ddlLocation.SelectedValue), Convert.ToInt32(ddlcategory.SelectedValue), Convert.ToInt32(ddlTaxStructure.SelectedValue), Convert.ToInt32(ddlActive.SelectedValue), Convert.ToInt32(ddlPurchaseType.SelectedValue), Convert.ToInt32(ddlSalesType.SelectedValue)); if (Result == true) { bool Result1 = BusinessServices.TaxRateMappingChield_delete(Convert.ToInt32(Session["TxtMapId"])); for (int i = 0; i < chkTaxnames.Items.Count; i++) { if (chkTaxnames.Items[i].Selected == true) { bool Result2 = BusinessServices.TaxRateMappingChield_Update(Convert.ToInt32(chkTaxnames.Items[i].Value), Convert.ToInt32(Session["TxtMapId"])); } } ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Update Successfully..');</script>", false); Clear(); GetGrd(); } }
public ProductServicesTest() { productService = new ProductServices(this.TContext); projectService = new ProjectServices(this.TContext); businessService = new BusinessServices(this.TContext); quoteService = new QuoteServices(this.TContext); user = GetUserSessionModel("*****@*****.**"); _projectId = this.db.Context.Projects .Where(p => p.OwnerId == user.UserId) .OrderByDescending(p => p.ProjectId) .Select(p => p.ProjectId) .FirstOrDefault(); projectModel = projectService.GetProjectModel(user, _projectId).Model as ProjectModel; _quoteId = this.db.Context.Quotes.Where(q => q.ProjectId == _projectId) .OrderByDescending(q => q.QuoteId) .Select(q => q.QuoteId) .FirstOrDefault(); _productNumber = this.db.Context.Products .Select(pr => pr.ProductNumber) .Where(pr => pr != null) .FirstOrDefault(); _quoteItemId = this.db.Context.QuoteItems .Where(qi => qi.Quantity > 0) .Select(qi => qi.QuoteItemId) .FirstOrDefault(); }
protected void btnContinue_Click(object sender, EventArgs e) { try { bool result = BusinessServices.Imaging_Admin_CusSupTrans_delete(Convert.ToInt32(Session["ID"])); string msg = Session["Type"].ToString() + " is deleted."; string script = "<script type='text/javascript' language='javascript'>"; script += "alert('" + msg.ToString() + "' );"; script += "</script>"; if (script != "<script type='text/javascript' language='javascript'></script>") { if (!Page.IsStartupScriptRegistered("clientScript2".ToString())) { Page.RegisterStartupScript("clientScript2", script); } } // Cancel edit mode GvwCustomer.EditIndex = -1; // Display status message // lbl_msg.Text = result ? "Deleted successful" : "Deletion failed"; // Reload the grid GetGrd(); GvwCustomer.Columns[14].Visible = false; btnContinue.Visible = false; btnDisContinue.Visible = false; } catch (Exception ex) { } }
/// <summary> /// This method gets called by the runtime. Use this method to add services to the container. /// </summary> /// <param name="services"></param> public void ConfigureServices(IServiceCollection services) { services.AddDbContext <Context>(options => { options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")); }); services = Repositories.Configure(services); services = BusinessServices.Configure(services); services.AddMvc(); services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new Info { Title = "My API", Version = "v1" }); c.DescribeAllEnumsAsStrings(); // Set the comments path for the Swagger JSON and UI. var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml"; var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile); c.IncludeXmlComments(xmlPath); xmlFile = "Movies.Domain.xml"; xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile); c.IncludeXmlComments(xmlPath); }); }
protected void btnSave_Click(object sender, EventArgs e) { try { DataTable DTWarrantyNameExists = BusinessServices.Check_PaymentTermsName_Exists(txtTermOfPayment.Text.Trim()); if (DTWarrantyNameExists.Rows.Count > 0) { lbl_msg.Text = "Payment Terms Already Exists"; return; } bool result = BusinessServices.Insert_PaymentTermsName(txtTermOfPayment.Text.Trim(), Convert.ToInt32(ddlActive.SelectedValue)); if (result) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Created Successfully..');</script>", false); Clear(); GetGrd(); } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Creation Failed..');</script>", false); } } catch (Exception ex) { throw ex; } }
protected void DdlCatagory_SelectedIndexChanged(object sender, EventArgs e) { try { DropDownList ddlCategory = (DropDownList)sender; GridViewRow row = (GridViewRow)ddlCategory.Parent.Parent; TextBox TxtQuantity = (TextBox)row.FindControl("TxtQuantity"); DropDownList ddlProduct = (DropDownList)row.FindControl("DdlProduct"); Label lblFCurntStock = (Label)row.FindControl("lblFFtCurntStock"); Label lblTCurntStock = (Label)row.FindControl("lblTFtCurntStock"); lblFCurntStock.Text = ""; lblTCurntStock.Text = ""; TxtQuantity.Text = ""; if (ddlCategory.SelectedIndex != 0) { //Product Bidning Based on Main Category and Sub Category DataTable DTProduct = BusinessServices.GetProductOnCategory(Convert.ToInt32(ddlMainCategory.SelectedValue), Convert.ToInt32(ddlCategory.SelectedValue)); ddlProduct.Items.Clear(); ddlProduct.DataSource = DTProduct; ddlProduct.DataTextField = "Product"; ddlProduct.DataValueField = "ID"; ddlProduct.DataBind(); ddlProduct.Items.Insert(0, new ListItem("--Select Product--", "0")); } else { ddlProduct.Items.Clear(); } } catch (Exception ex) { throw ex; } }
protected void btnSave_Click(object sender, EventArgs e) { if (txt_Name.Text != string.Empty && txtAddress.Text != string.Empty && ddl_address_type.SelectedValue != "-1" && ddl_PS.SelectedValue != "-1" && txtAddress1.Text != string.Empty && txtAddress2.Text != string.Empty && txtAddress3.Text != string.Empty && txtCST.Text != string.Empty && txtVAT.Text != string.Empty) { bool result = BusinessServices.Imaging_Admin_address_Insert(txt_Name.Text.Trim(), txtAddress.Text.Trim(), txtAddress1.Text.Trim(), txtAddress2.Text.Trim(), txtAddress3.Text.Trim(), txtVAT.Text.Trim(), txtCST.Text.Trim(), ddl_address_type.SelectedItem.Value.ToString(), ddl_PS.SelectedItem.Value.ToString()); if (result) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Created Successfully..');</script>", false); txt_Name.Text = ""; txtVAT.Text = ""; txtAddress.Text = ""; txtAddress1.Text = ""; txtAddress2.Text = ""; txtAddress3.Text = ""; txtCST.Text = ""; txtVAT.Text = ""; ddl_address_type.SelectedValue = "-1"; ddl_PS.SelectedValue = "-1"; GetGrd(); lbl_msg.Text = ""; } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Creation Failed..');</script>", false); } } else { AlertPageHelper.ShowAlert(this.Page, "Please Fill the Required Fields"); } }
private void Setup() { _repository = Substitute.For <IStudentRepository>(); IBusinessServices business = new BusinessServices(_repository); _controller = GetHomeController(business); }
protected void btnUpdate_click(object Sender, EventArgs e) { try { //DataTable Dt = BusinessServices.ExistingRepresentativeName(Convert.ToInt32(ddlLocation.SelectedValue), Txtname.Text.Trim()); //// if(Convert.ToInt32(Session["id"])==Convert.ToInt32(Dt.Rows[0]["TaxNameID"].ToString())) //if (Dt.Rows.Count > 0) //{ // ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Representative Name already Exist');</script>", false); // BindRepresentative(); //} //else //{ bool result = BusinessServices.UpdateRepresentativeName(Convert.ToInt32(Session["Repid"]), Convert.ToInt32(ddlLocation.SelectedValue), Txtname.Text.Trim(), TxtDesignation.Text.Trim(), TxtEmail.Text.Trim(), Convert.ToInt32(ddlStatus.SelectedValue)); if (result) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Representative Name Updated Successfully..');</script>", false); BindRepresentative(); Clear(); btnUpdate.Enabled = false; btnCreate.Enabled = true; } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Update Failed..');</script>", false); BindRepresentative(); } // } } catch (Exception ex) { } }
protected void btnCreate_Click(object sender, EventArgs e) { try { DataTable Dt = BusinessServices.ExistingTaxName(txtTaxname.Text.Trim()); if (Dt.Rows.Count > 0) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Tax Name already Exist');</script>", false); } else { bool result = BusinessServices.InsertTaxName(txtTaxname.Text.Trim(), Convert.ToInt32(ddlStatus.SelectedValue), Convert.ToInt32(TxtRank.Text)); if (result) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Tax Name Created Successfully..');</script>", false); txtTaxname.Text = ""; TxtRank.Text = ""; ddlStatus.SelectedValue = "1"; BindTaxName(); } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Creation Failed..');</script>", false); BindTaxName(); } } } catch (Exception ex) { } }
protected void btnExport_Click(object sender, EventArgs e) { try { if (ddlGRN.SelectedValue != "0") { Panel1.Visible = true; DataTable Dt = BusinessServices.Get_GRNdataFor_PDF(Convert.ToInt32(ddlGRN.SelectedValue)); //ToString("ddMMMYY"); LblDate.Text = Dt.Rows[0]["InvoiceDate"].ToString(); //System.DateTime.Now.ToString("dd-MMM-yyyy"); lblbtmDate.Text = Dt.Rows[0]["InvoiceDate"].ToString(); //System.DateTime.Now.ToString("dd-MMM-yyyy"); lblLocation.Text = Dt.Rows[0]["Location_Name"].ToString(); lbl_GRNnumber.Text = Dt.Rows[0]["GRN_Number"].ToString(); Lbl_AwbNum.Text = Dt.Rows[0]["AWBNum"].ToString(); lbl_Transport.Text = Dt.Rows[0]["TransportCo"].ToString(); lbl_VehicleNo.Text = Dt.Rows[0]["VehicleNo"].ToString(); lbl_SupplierName.Text = Dt.Rows[0]["Supplier_Name"].ToString(); lblInvoiceNum.Text = Dt.Rows[0]["InvoiceNum"].ToString(); lblInvoiceDate.Text = Dt.Rows[0]["InvoiceDate"].ToString(); lblPoNumber.Text = Dt.Rows[0]["PO_Number"].ToString(); BindGRNDetailsData(); Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment;filename=GRN.pdf"); Response.Cache.SetCacheability(HttpCacheability.NoCache); StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); GridView1.HeaderRow.Style.Add("width", "10%"); GridView1.HeaderRow.Style.Add("font-size", "10px"); GridView1.Style.Add("font-size", "8px"); Panel1.RenderControl(hw); StringReader sr = new StringReader(sw.ToString()); Document pdfDoc = new Document(PageSize.A4, 20f, 20f, 20f, 20f); HTMLWorker htmlparser = new HTMLWorker(pdfDoc); PdfWriter pdfWriter = PdfWriter.GetInstance(pdfDoc, Response.OutputStream); //pdfWriter.PageEvent = new Comman.ITextEvents(); pdfDoc.Open(); htmlparser.Parse(sr); pdfDoc.Close(); Response.Write(pdfDoc); // Response.End(); HttpContext.Current.Response.Flush(); HttpContext.Current.Response.SuppressContent = true; HttpContext.Current.ApplicationInstance.CompleteRequest(); Panel1.Visible = false; GetGRNList(); } else { Panel1.Visible = false; ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Please Select GRN Number.');</script>", false); } } catch (Exception ex) { throw; } }
public BusinessModel GetBusinessModel(UserSessionModel sa, string name) { var business = this.db.Context.Businesses.Where(b => b.BusinessName.Contains(name)).FirstOrDefault(); var businessModel = new BusinessServices(this.TContext).GetBusinessModel(sa, business.BusinessId, false).Model as BusinessModel; return(businessModel); }
protected void btnResetdeact_Click(object sender, EventArgs e) { int userId = Convert.ToInt32(ddl_USernameDeActive.SelectedValue); bool result = BusinessServices.Imaging_Admin_DeActivateUser(userId); ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Selected User has been De-Activated..');</script>", false); loadControlsActive(); loadControlsDeActive(); }
protected void GvSearch_RowCommand(object sender, GridViewCommandEventArgs e) { try { if (e.CommandName == "EDITED") { btnSave.Visible = false; btnUpdate.Visible = true; int TxtMapId = Convert.ToInt32(e.CommandArgument); Session["TxtMapId"] = TxtMapId; DataTable DTMain = BusinessServices.BindTaxRateMappingMain(TxtMapId); if (DTMain.Rows.Count > 0) { ddl_Type.SelectedValue = DTMain.Rows[0]["TypeID"].ToString(); ddlState.SelectedValue = DTMain.Rows[0]["StateID"].ToString(); ddlState_SelectedIndexChanged(sender, e); ddlLocation.SelectedValue = DTMain.Rows[0]["LocationID"].ToString(); ddlcategory.SelectedValue = DTMain.Rows[0]["CategoryID"].ToString(); if (ddl_Type.SelectedValue == "P") { TrPurchaseType.Visible = true; TrSalesType.Visible = false; ddlSalesType.SelectedIndex = 0; ddlPurchaseType.SelectedValue = DTMain.Rows[0]["PurchaseType"].ToString(); } else if (ddl_Type.SelectedValue == "S") { TrSalesType.Visible = true; TrPurchaseType.Visible = false; ddlPurchaseType.SelectedIndex = 0; ddlSalesType.SelectedValue = DTMain.Rows[0]["SalesType"].ToString(); } ddlTaxStructure.SelectedValue = DTMain.Rows[0]["TaxStructureID"].ToString(); ddlActive.SelectedValue = DTMain.Rows[0]["ActiveStatus"].ToString(); } DataTable DtChield = BusinessServices.BindTaxRateMappingChield(TxtMapId); if (DtChield.Rows.Count > 0) { BindTaxnamesformapping(); for (int i = 0; i < chkTaxnames.Items.Count; i++) { for (int j = 0; j < DtChield.Rows.Count; j++) { if (chkTaxnames.Items[i].Value == DtChield.Rows[j]["TaxRateID"].ToString()) { chkTaxnames.Items[i].Selected = true; } } } } } } catch (Exception ex) { throw ex; } }
private void LoadCreditPeriod() { DataTable DTCreditPeriod = BusinessServices.Imaging_GetCreditperiod(); ddlPaymentTerms.DataSource = DTCreditPeriod; ddlPaymentTerms.DataValueField = "Id"; ddlPaymentTerms.DataTextField = "CreditPeriod"; ddlPaymentTerms.DataBind(); ddlPaymentTerms.Items.Insert(0, new ListItem("--Select--", "0")); }
protected void btnReset_Click(object sender, EventArgs e) { int userId = Convert.ToInt32(ddl_USername.SelectedValue); bool result = BusinessServices.Imaging_Admin_passwordReset(userId, ddlUserType.SelectedItem.Text.Trim()); bool result1 = BusinessServices.Imaging_Admin_passwordResetmailAlert(userId, ddlUserType.SelectedItem.Text.Trim()); ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Selected User Password has been Reset..');</script>", false); GetUserType(); loadControls(); }
private void loadControlsDeActive() { DataTable dt = BusinessServices.Imaging_Admin_GetUserNameList_DEActive(); ddl_USernameDeActive.DataSource = dt; ddl_USernameDeActive.DataTextField = "LoginName"; ddl_USernameDeActive.DataValueField = "Id"; ddl_USernameDeActive.DataBind(); ddl_USernameDeActive.Items.Insert(0, new ListItem("-----Select-----", "0")); ddl_USernameDeActive.SelectedIndex = 0; }
protected void btnCreate_Click(object sender, EventArgs e) { string Demo = txtEmailID.Text.Trim(); string[] tokens = Demo.Split('@'); string last = tokens[tokens.Length - 1].ToUpper(); string last1 = tokens[tokens.Length - 1]; string Direct = "CENTILLIONSS.COM"; if (last != Direct) { lblMsg.Text = "Please provide a Centillion email addres"; return; } lblMsg.Text = ""; //string newemail = txtEmailID.Text.ToString(); //DataTable dt = BusinessServices.Imaging_forgotPassword_GetData(txtEmailID.Text.Trim()); //if (dt.Rows.Count > 0) //{ // string email = dt.Rows[0][1].ToString(); // if (newemail == email) // { // this.ClientScript.RegisterStartupScript(this.GetType(), "PopupScript", "<script type=text/javascript>alert('Email Id Aldeary Registered in IMG Inventory Application')</script>"); // return; // } //} //else //{ DataTable Dt = BusinessServices.CheckExistUserLoginNameForInsert(txtFullname.Text.Trim(), txtEmailID.Text.Trim(), ddlUserType.SelectedItem.Text.Trim()); if (Dt.Rows.Count > 0) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('UserName Exists..');</script>", false); BindUserNameDetails(); } else { bool result = BusinessServices.Imaging_UserID_CREATION_Insert(txtUSername.Text.Trim(), txtFullname.Text.Trim(), txtEmailID.Text.Trim(), ddlUserType.SelectedItem.Text.Trim()); if (result) { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('User Name Details Created Successfully..');</script>", false); clear(); BindUserNameDetails(); } else { ScriptManager.RegisterStartupScript(this, typeof(Page), "Alert", "<script>alert('Creation Failed..');</script>", false); BindUserNameDetails(); } } //} }
public void bindtype() { DataTable dt = BusinessServices.Imaging_Admin_Type(); ddl_Type.DataSource = dt; ddl_Type.DataTextField = "Supplier_Type_Desc"; ddl_Type.DataValueField = "SupplierType_ID"; ddl_Type.DataBind(); ddl_Type.Items.Insert(0, new ListItem("--Select Type--", "-1")); ddl_Type.SelectedIndex = 0; }
//public void bindLocation() //{ // DataTable dt = BusinessServices.Imaging_Admin_Tax_Location(); // ddl_Location.DataSource = dt; // ddl_Location.DataTextField = "Location_Name"; // ddl_Location.DataValueField = "Location_ID"; // ddl_Location.DataBind(); // ddl_Location.Items.Insert(0, new ListItem("------Select------", "-1")); // ddl_Location.SelectedIndex = 0; //} public void bindcategory() { DataTable dt = BusinessServices.Imaging_Admin_CAtegory(); ddl_Category.DataSource = dt; ddl_Category.DataTextField = "Category_Name"; ddl_Category.DataValueField = "Category_ID"; ddl_Category.DataBind(); ddl_Category.Items.Insert(0, new ListItem("------Select------", "-1")); ddl_Category.SelectedIndex = 0; }