protected void btnSearchItems_Click(object sender, EventArgs e) { try { if (rditem.Checked == true && rditemid.SelectedValue == "1") { txtSearchItem.Enabled = true; textsearchdesc.Text = ""; textsearchdesc.Enabled = false; } else if (rditem.Checked == true && rditemid.SelectedValue == "2") { textsearchdesc.Enabled = true; txtSearchItem.Text = ""; txtSearchItem.Enabled = false; } search(); } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.MedicalSuppliesErrorMessage.Replace("<<Itemname>>", ex.Message), true); } }
protected void btnAdd_Click(object sender, EventArgs e) { try { btnSearch.Visible = false; txtCorporateSearch.Visible = false; txtCorporatedescription.Visible = false; lblseroutHeader.Visible = false; //chkrestore.Visible = false; //lblstatus.Visible = false; deletebtn.Style.Add("display", "none"); savebtn.Style.Add("display", "block"); DivSearch.Style.Add("display", "none"); div_ADDContent.Style.Add("display", "block"); divCorporate.Style.Add("display", "none"); ClearDetails(); chkstatus.Visible = false; SetRequiredFields(); HdnStatus.Value = "Add"; } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.CorporateErrorMessage.Replace("<<Corporate>>", ex.Message.ToString()), true); } }
public void HideAndShowControls(string Mode) { try { if (Mode == "Edit") { drdFacilityName.Enabled = true; drdVendorName.Enabled = true; txtShipAccount.Enabled = true; txtBillAccount.Enabled = true; btnsave.Visible = true; } else { btnsave.Visible = false; drdFacilityName.Enabled = false; drdVendorName.Enabled = false; txtShipAccount.Enabled = false; txtBillAccount.Enabled = false; } } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.FacilityVendorAccountErrorMessage.Replace("<<FacilityDescription>>", ex.Message), true); } }
protected void grditem_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.DataRow) { ImageButton lbldelete = (ImageButton)e.Row.FindControl("lbldelete"); Label lblActive = (Label)e.Row.FindControl("lblActive"); if (lblActive.Text == "Yes") { lbldelete.Enabled = true; chkactive.Visible = false; } else { lbldelete.Enabled = false; chkactive.Visible = true; } } } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.ItemCategoryErrorMessage.Replace("<<ItemCategory>>", ex.Message), true); } }
public void BindUom(string mode) { try { List <GetUom> lstpatin = new List <GetUom>(); if (mode == "Add") { lstpatin = lclsservice.GetUom().Where(a => a.IsActivestr == "1").ToList(); } else { lstpatin = lclsservice.GetUom().ToList(); } ddlUOM.DataSource = lstpatin; ddlUOM.DataValueField = "UomID"; ddlUOM.DataTextField = "UomName"; ddlUOM.DataBind(); ListItem lst = new ListItem(); lst.Value = "0"; lst.Text = "Select"; ddlUOM.Items.Insert(0, lst); ddlUOM.SelectedIndex = 0; } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.MedicalSuppliesErrorMessage.Replace("<<Itemname>>", ex.Message), true); } }
private void ShowPDFFile(string path) { try { if (Request.Browser.Type.ToUpper().Contains("IE")) { if (File.Exists(path)) { System.Net.WebClient client = new System.Net.WebClient(); Byte[] buffer = client.DownloadData(path); if (buffer != null) { Response.ContentType = "application/pdf"; Response.AddHeader("content-length", buffer.Length.ToString()); Response.BinaryWrite(buffer); } System.IO.File.Delete(path); Response.End(); } } else { Response.Write(string.Format("<script>window.open('{0}','_blank');</script>", "PrintPdf.aspx?file=" + Server.UrlEncode(path))); } } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.FacilityVendorAccountErrorMessage.Replace("<<FacilityDescription>>", ex.Message.ToString()), true); } }
protected void chkactive_CheckedChanged(object sender, EventArgs e) { try { GridViewRow row = (sender as CheckBox).Parent.Parent as GridViewRow; CheckBox chkactive = (CheckBox)row.FindControl("chkactive"); InventoryServiceClient lclsService = new InventoryServiceClient(); if (chkactive.Checked == true) { lclsService.DeleteVendor(Convert.ToInt64(row.Cells[2].Text), true, defaultPage.UserId); } else { lclsService.DeleteVendor(Convert.ToInt64(row.Cells[2].Text), false, defaultPage.UserId); EventLogger log = new EventLogger(config); log.LogInformation(msgdelte.Replace("<<Vendor>>", row.Cells[4].Text.ToString())); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.VendorDeleteMessage.Replace("<<Vendor>>", row.Cells[4].Text.ToString()), true); } BindvendorGrid(); } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.VendorErrorMessage.Replace("<<Vendor>>", ex.Message), true); } }
public void BindItem(string mode) { try { InventoryServiceClient service = new InventoryServiceClient(); List <GetDrpItemsByCategory> listItem = null; if (mode == "Add") { listItem = service.GetDrpItemsByCategory(Convert.ToInt64(drdItemCategory.SelectedValue)).Where(a => a.IsActive == true).ToList(); } else { listItem = service.GetDrpItemsByCategory(Convert.ToInt64(drdItemCategory.SelectedValue)).ToList(); } drdItemID.DataSource = listItem; drdItemID.DataTextField = "ItemShortName"; drdItemID.DataValueField = "ItemID"; drdItemID.DataBind(); ListItem lst = new ListItem(); lst.Value = "0"; lst.Text = "Select"; drdItemID.Items.Insert(0, lst); } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.VendorItemMapErrorMessage.Replace("<<VendorItemMap>>", ex.Message), true); } }
public void HideAndShowControls(string Mode) { try { if (Mode == "Edit") { drdItemCategory.Enabled = true; drdItemID.Enabled = true; drdVendorID.Enabled = true; txtVendorItemID.Enabled = true; btnsave.Visible = true; } else { btnsave.Visible = false; drdItemCategory.Enabled = false; drdItemID.Enabled = false; drdVendorID.Enabled = false; txtVendorItemID.Enabled = false; } } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.VendorItemMapErrorMessage.Replace("<<VendorItemMap>>", ex.Message), true); } }
public void BindCategory() { try { InventoryServiceClient lclsservice = new InventoryServiceClient(); List <GetItemCategory> lstcategory = null; lstcategory = lclsservice.GetItemCategory().ToList(); drpItemCategorySearch.DataSource = lstcategory; drpItemCategorySearch.DataValueField = "CategoryID"; drpItemCategorySearch.DataTextField = "CategoryName"; drpItemCategorySearch.DataBind(); foreach (ListItem lst1 in drpItemCategorySearch.Items) { lst1.Attributes.Add("class", "selected"); lst1.Selected = true; } } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.VendorItemMapErrorMessage.Replace("<<VendorItemMap>>", ex.Message), true); } }
public void BindCategoryadd(string mode) { try { InventoryServiceClient lclsservice = new InventoryServiceClient(); List <GetItemCategory> lstcategory = null; if (mode == "Add") { lstcategory = lclsservice.GetItemCategory().Where(a => a.IsActive == true).ToList(); } else { lstcategory = lclsservice.GetItemCategory().ToList(); } drdItemCategory.DataSource = lstcategory; drdItemCategory.DataValueField = "CategoryID"; drdItemCategory.DataTextField = "CategoryName"; drdItemCategory.DataBind(); ListItem lst = new ListItem(); lst.Value = "0"; lst.Text = "Select"; drdItemCategory.Items.Insert(0, lst); // Search Item Category Dropdown } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.VendorItemMapErrorMessage.Replace("<<VendorItemMap>>", ex.Message), true); } }
protected void gridFacilityVendorAcc_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.DataRow) { ImageButton lbldelete = (ImageButton)e.Row.FindControl("btndeleteimg"); Label lblActive = (Label)e.Row.FindControl("lblActive"); if (lblActive.Text == "Yes") { lbldelete.Enabled = true; chkactive.Visible = false; DivCheckBox.Style.Add("display", "none"); } else { lbldelete.Enabled = false; //divactive.Style.Add("display", "block"); chkactive.Visible = true; DivCheckBox.Style.Add("display", "block"); } } } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.FacilityVendorAccountErrorMessage.Replace("<<FacilityDescription>>", ex.Message), true); } }
//protected void chkActive_CheckedChanged(object sender, EventArgs e) //{ // try // { // GridViewRow row = (sender as CheckBox).Parent.Parent as GridViewRow; // CheckBox chkactive = (CheckBox)row.FindControl("chkActive"); // if (chkactive.Checked == true) // { // lclsservice.DeleteItem(Convert.ToInt64(row.Cells[2].Text), true, Convert.ToInt64(defaultPage.UserId)); // } // else // { // lclsservice.DeleteItem(Convert.ToInt64(row.Cells[2].Text), false, Convert.ToInt64(defaultPage.UserId)); // ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.MedicalSuppliesDeleteMessage.Replace("<<Itemname>>", row.Cells[4].Text.ToString()), true); // } // BindItem(); // } // catch (Exception ex) // { // ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.MedicalSuppliesErrorMessage.Replace("<<Itemname>>", ex.Message), true); // } //} protected void Save_Click(object sender, EventArgs e) { try { BALItem lcls = new BALItem(); if (txtCurrency.Text == "") { txtCurrency.Style.Add("border", "Solid 1px red"); mpebudget.Show(); } else { lcls.CurrencyName = txtCurrency.Text; string lstrMessage = lclsservice.InsertCurrency(lcls); if (lstrMessage == "Saved Successfully") { EventLogger log = new EventLogger(config); string msg = Constant.MedicalSuppliesSaveCurrencyMessage.Replace("ShowPopup('", "").Replace("<<Itemname>>", txtCurrency.Text).Replace("');", ""); log.LogInformation(msg); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.MedicalSuppliesSaveCurrencyMessage.Replace("<<Itemname>>", txtCurrency.Text), true); } } txtCurrency.Text = ""; BindUnitPriceCurrency(); } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.MedicalSuppliesErrorMessage.Replace("<<Itemname>>", ex.Message), true); } }
public void BindFacilityAdd(string mode) { try { List <GetFacility> lstcategory = new List <GetFacility>(); if (mode == "Add") { lstcategory = lclsservice.GetFacility().Where(a => a.IsActive == true).ToList(); } else { lstcategory = lclsservice.GetFacility().ToList(); } drdFacilityName.DataSource = lstcategory; drdFacilityName.DataValueField = "FacilityID"; drdFacilityName.DataTextField = "FacilityDescription"; drdFacilityName.DataBind(); ListItem lst = new ListItem(); lst.Value = "0"; lst.Text = "Select"; drdFacilityName.Items.Insert(0, lst); } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.FacilityVendorAccountErrorMessage.Replace("<<FacilityDescription>>", ex.Message), true); } }
protected void btnAdd_Click(object sender, EventArgs e) { try { searchdiv.Style.Add("display", "none"); div_ADDContent.Style.Add("display", "block"); itemmap.Style.Add("display", "none"); LoadLookups("Add"); BindUnitPriceCurrency(); btnsave.Visible = true; btncancelsave.Visible = true; btnprintdetail.Visible = false; lnkPrice.Enabled = true; btnsave.Enabled = true; lnkPrice.Enabled = true; txtItemDesc.Enabled = true; drdItemCategory.Enabled = true; txtQty.Enabled = true; ddlUOM.Enabled = true; txtunitvalue.Enabled = true; drdUnitpriceType.Enabled = true; txtEachprice.Enabled = true; txtNDC.Enabled = true; txtgpbill.Enabled = true; chkactive.Visible = false; ItemID.Value = ""; hdnitemid.Value = ""; } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.MedicalSuppliesErrorMessage.Replace("<<Itemname>>", ex.Message), true); } }
public void BindVendorAdd(string mode) { try { string SearchItem = string.Empty; InventoryServiceClient service = new InventoryServiceClient(); List <GetVendor> listVendor = new List <GetVendor>(); if (mode == "Add") { listVendor = service.GetVendor().Where(a => a.IsActive == true).ToList(); } else { listVendor = service.GetVendor().ToList(); } drdVendorName.DataSource = listVendor; drdVendorName.DataTextField = "VendorDescription"; drdVendorName.DataValueField = "VendorID"; drdVendorName.DataBind(); ListItem lst = new ListItem(); lst.Value = "0"; lst.Text = "Select"; drdVendorName.Items.Insert(0, lst); } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.FacilityVendorAccountErrorMessage.Replace("<<FacilityDescription>>", ex.Message), true); } }
public void BindFacility() { try { List <GetFacility> lstcategory = new List <GetFacility>(); lstcategory = lclsservice.GetFacility().ToList(); drpFacilitySearch.DataSource = lstcategory; drpFacilitySearch.DataValueField = "FacilityID"; drpFacilitySearch.DataTextField = "FacilityDescription"; drpFacilitySearch.DataBind(); //drpFacilitySearch.Items.Insert(0, lst); foreach (ListItem lst1 in drpFacilitySearch.Items) { lst1.Attributes.Add("class", "selected"); lst1.Selected = true; } } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.FacilityVendorAccountErrorMessage.Replace("<<FacilityDescription>>", ex.Message), true); } }
protected void lbedit_Click(object sender, EventArgs e) { try { ImageButton btndetails = sender as ImageButton; GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer; hdnfield.Value = gvrow.Cells[1].Text.Trim().Replace(" ", ""); ViewState["UomID"] = gvrow.Cells[1].Text.Trim().Replace(" ", ""); txtUomName.Text = gvrow.Cells[2].Text.Trim().Replace(" ", ""); Label lblActive = (Label)gvrow.FindControl("lblActive"); if (lblActive.Text == "Yes") { chkactive.Visible = false; } else { chkactive.Visible = true; } div_ADDContent.Style.Add("display", "none"); divsearchgrid.Style.Add("display", "none"); divItemadd.Style.Add("display", "block"); //Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "editfacility();", true); } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.UOMErrorMessage.Replace("<<UOM>>", ex.Message), true); } }
public void BindVendor() { try { string SearchItem = string.Empty; InventoryServiceClient service = new InventoryServiceClient(); List <GetVendor> listVendor = new List <GetVendor>(); listVendor = service.GetVendor().ToList(); drpVendorSearch.DataSource = listVendor; drpVendorSearch.DataTextField = "VendorDescription"; drpVendorSearch.DataValueField = "VendorID"; drpVendorSearch.DataBind(); //drpVendorSearch.Items.Insert(0, lst); foreach (ListItem lst1 in drpVendorSearch.Items) { lst1.Attributes.Add("class", "selected"); lst1.Selected = true; } } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.FacilityVendorAccountErrorMessage.Replace("<<FacilityDescription>>", ex.Message), true); } }
public void bindUom() { try { //InventoryServiceClient lcls = new InventoryServiceClient(); //List<GetUom> lstcol = lcls.GetUom().ToList(); //grdUom.DataSource = lstcol; //grdUom.DataBind(); lcls.UomName = txtUomNamesearch.Text; lcls.IsActivestr = reactive.SelectedValue; lcls.LoggedinBy = defaultPage.UserId; lcls.Filter = ""; List <GetUomReport> llstreview = lclsservice.GetUomReport(lcls).ToList(); //lblrowcount.Text = "No of records : " + llstreview.Count.ToString(); grdUom.DataSource = llstreview; grdUom.DataBind(); } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.UOMErrorMessage.Replace("<<UOM>>", ex.Message), true); } }
protected void btnCancel_Click(object sender, EventArgs e) { try { drpitemcategory.ClearSelection(); BindsearchCategory(); //drpitemcategory.SelectedIndex = -1; drpitemcategory.Attributes.Remove("disabled"); txtSearchItem.Text = ""; textsearchdesc.Text = ""; textsearchdesc.Enabled = false; txtSearchItem.Enabled = false; drpitemcategory.Enabled = true; rdsearcate.Checked = true; rditem.Checked = false; rditemid.Enabled = false; rditemid.ClearSelection(); reactive.SelectedValue = "1"; BindItem(); } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.MedicalSuppliesErrorMessage.Replace("<<Itemname>>", ex.Message), true); } }
protected void btncancelsave_Click(object sender, EventArgs e) { try { searchdiv.Style.Add("display", "block"); div_ADDContent.Style.Add("display", "none"); itemmap.Style.Add("display", "none"); Clear(); drdItemCategory.ClearSelection(); drdItemCategory.SelectedIndex = 0; txtQty.Text = ""; ddlUOM.ClearSelection(); ddlUOM.SelectedIndex = 0; txtunitvalue.Text = ""; drdUnitpriceType.ClearSelection(); drdUnitpriceType.SelectedIndex = 0; txtEachprice.Text = ""; txtNDC.Text = ""; txtgpbill.Text = ""; } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.MedicalSuppliesErrorMessage.Replace("<<Itemname>>", ex.Message), true); } }
protected void buttonPrint_Click(object sender, EventArgs e) { try { List <object> llstresult = PrintFacility(); byte[] bytes = (byte[])llstresult[0]; Guid guid = Guid.NewGuid(); string path = ConfigurationManager.AppSettings["TempFileLocation"].ToString(); _sessionPDFFileName = "Facility Vendor Account " + guid + ".pdf"; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } path = Path.Combine(path, _sessionPDFFileName); using (StreamWriter sw = new StreamWriter(File.Create(path))) { sw.Write(""); } FileStream fs = new FileStream(path, FileMode.Open); fs.Write(bytes, 0, bytes.Length); fs.Close(); ShowPDFFile(path); } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.FacilityVendorAccountErrorMessage.Replace("<<FacilityDescription>>", ex.Message), true); } }
public void SaveCorporate() { try { EventLogger log = new EventLogger(config); bool isvalidcorp = false; bool isvalidcorpdesc = false; ObjCorporate.CorporateName = txtCorporateFullName.Text; ObjCorporate.CorporateDescription = txtCorporateDesc.Text; ObjCorporate.POEmail = txtPOEmail.Text; ObjCorporate.CreatedBy = defaultPage.UserId; List <BindCorporateMaster> lstCor = lclsservice.BindCorporateMaster().Where(a => a.CorporateName == ObjCorporate.CorporateName).ToList(); if (lstCor.Count > 0) { isvalidcorp = true; } else { List <BindCorporateMaster> lstCorpdesc = lclsservice.BindCorporateMaster().Where(a => a.CorporateDescription == ObjCorporate.CorporateDescription).ToList(); if (lstCorpdesc.Count > 0) { isvalidcorpdesc = true; } } if (isvalidcorp == false && isvalidcorpdesc == false) { save = lclsservice.InsertCorporateMaster(ObjCorporate); if (save == "Saved Successfully") { string msg = Constant.CorporateSaveMessage.Replace("ShowPopup('", "").Replace("<<Corporate>>", "").Replace("');", ""); log.LogInformation(msg); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.CorporateSaveMessage.Replace("<<Corporate>>", ""), true); BindGrid(); clear(); } } else { if (isvalidcorp == true) { log.LogWarning(msgwrn.Replace("<<Corporate>>", txtCorporateFullName.Text)); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.WarningValidCorporateMessage.Replace("<<Corporate>>", txtCorporateFullName.Text), true); } else { log.LogWarning(logmsg.Replace("<<Corporate>>", txtCorporateDesc.Text)); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.WarningValidCorporatecdescMessage.Replace("<<Corporate>>", txtCorporateDesc.Text), true); } } } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.CorporateErrorMessage.Replace("<<Corporate>>", ex.Message.ToString()), true); } }
protected void Page_Load(object sender, EventArgs e) { try { defaultPage = (Page_Controls)Session["Permission"]; ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page); scriptManager.RegisterPostBackControl(this.btnprintsummary); scriptManager.RegisterPostBackControl(this.btnprintdetail); if (!IsPostBack) { RequiredFieldValidatorMessage(); if (defaultPage != null) { BindItem(); LoadLookups("Add"); BindUnitPriceCurrency(); BindsearchCategory(); txtQty.Attributes.Add("onchange", "GetEachPrice();"); txtunitvalue.Attributes.Add("onchange", "GetEachPrice();"); rdsearcate.Checked = true; reactive.SelectedValue = "1"; if (defaultPage.MedicalSuppliesPage_Edit == false && defaultPage.MedicalSuppliesPage_View == true) { btnsave.Visible = false; btnAdd.Visible = false; btnprintsummary.Visible = true; //btnSearchItems.Visible = true; } if (defaultPage.MedicalSuppliesPage_Edit == false && defaultPage.MedicalSuppliesPage_View == false) { div_ADDContent.Visible = false; UpdatePanel2.Visible = false; grditem.Visible = false; btnsave.Visible = false; User_Permission_Message.Visible = true; } } else { Response.Redirect("Login.aspx"); } } } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.MedicalSuppliesErrorMessage.Replace("<<Itemname>>", ex.Message), true); } }
protected void imgbtnEdit_Click(object sender, ImageClickEventArgs e) { try { ImageButton btndetails = sender as ImageButton; GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer; //CheckBox chkactive = (gvrow.Cells[5].FindControl("chkactive") as CheckBox); HdnStatus.Value = "Edit"; btnSearch.Visible = false; txtCorporateSearch.Visible = false; txtCorporatedescription.Visible = false; deletebtn.Style.Add("display", "none"); savebtn.Style.Add("display", "block"); DivSearch.Style.Add("display", "none"); div_ADDContent.Style.Add("display", "block"); divCorporate.Style.Add("display", "none"); List <BindCorporateMaster> lclcor = lclsservice.BindCorporateMaster().Where(a => a.CorporateID == Convert.ToInt64(gvrow.Cells[1].Text)).ToList(); HiddenCorporateMasterID.Value = Convert.ToString(lclcor[0].CorporateID); ViewState["CorporateID"] = gvrow.Cells[1].Text.Trim().Replace(" ", ""); txtCorporateFullName.Text = gvrow.Cells[2].Text.Trim().Replace(" ", ""); txtCorporateDesc.Text = gvrow.Cells[3].Text.Trim().Replace(" ", ""); txtPOEmail.Text = gvrow.Cells[4].Text.Trim().Replace(" ", ""); HiddenCorporateName.Value = gvrow.Cells[2].Text.Trim().Replace(" ", ""); Label lblActive = (Label)gvrow.FindControl("lblActive"); if (lblActive.Text == "Yes") { chkstatus.Visible = false; } else { chkstatus.Visible = true; } //if (chkactive.Checked == false) //{ // chkrestore.Visible = true; // lblstatus.Visible = true; // chkrestore.Checked = true; // HdnStatus.Value = "Restore"; //} //else //{ // chkrestore.Visible = false; // lblstatus.Visible = false; //} } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.CorporateErrorMessage.Replace("<<Corporate>>", ex.Message.ToString()), true); } }
protected void btnclose_Click(object sender, EventArgs e) { try { ToggleAdd("Clear"); } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.FacilityVendorAccountErrorMessage.Replace("<<FacilityDescription>>", ex.Message), true); } }
protected void btnsearch_Click(object sender, EventArgs e) { try { Search(); } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.ItemCategoryErrorMessage.Replace("<<ItemCategory>>", ex.Message), true); } }
protected void grdFacility_PageIndexChanging(object sender, GridViewPageEventArgs e) { try { grdpgroup.PageIndex = e.NewPageIndex; bindgrid(); } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); lblmsg.Text = ex.Message; } }
//private void LoadLookups(string mode) //{ // try // { // BindCategory(mode); // BindItem(mode); // BindVendor(mode); // } // catch (Exception ex) // { // ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.VendorItemMapErrorMessage.Replace("<<VendorItemMap>>", ex.Message), true); // } //} private bool ValidateLoookups(InventoryServiceClient service) { try { bool result = true; string errmessage = ""; //Item Category Lookup List <GetItemCategory> lstCat = service.GetItemCategory().Where(a => a.IsActive == true && a.CategoryID == Convert.ToInt64(drdItemCategory.SelectedValue)).ToList(); if (lstCat.Count == 0) { errmessage += "ItemCategory (" + drdItemCategory.SelectedItem.Text + ") , "; result = false; } //Item based on Category Lookup List <GetDrpItemsByCategory> lstitemCat = service.GetDrpItemsByCategory(Convert.ToInt64(drdItemCategory.SelectedValue)).Where(a => a.IsActive == true && a.ItemID == Convert.ToInt64(drdItemID.SelectedValue)).ToList(); if (lstitemCat.Count == 0) { errmessage += "Item (" + drdItemID.SelectedItem.Text + ") , "; result = false; } //Vendor Lookup List <GetvendorDetails> lstvendor = service.GetvendorDetails("").Where(a => a.IsActive == true && a.VendorID == Convert.ToInt64(drdVendorID.SelectedValue)).ToList(); if (lstvendor.Count == 0) { errmessage += "Vendor (" + drdVendorID.SelectedItem.Text + ") "; result = false; } if (!result) { EventLogger log = new EventLogger(config); string msg = Constant.WarningLookupMessage.Replace("ShowwarningLookupPopup('", "").Replace("<<values>>", errmessage).Replace("');", ""); log.LogWarning(msg); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.WarningLookupMessage.Replace("<<values>>", errmessage), true); } return(result); } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.VendorItemMapErrorMessage.Replace("<<VendorItemMap>>", ex.Message), true); return(false); } }