public static EmployerBO getEmployerByUserId(string Id) { MongoCollection<Employer> objCollection = db.GetCollection<Employer>("c_Employer"); EmployerBO objClass = new EmployerBO(); foreach (Employer item in objCollection.Find(Query.EQ("UserId", ObjectId.Parse(Id)))) { objClass.Id = item._id.ToString(); objClass.UserId = item.UserId.ToString(); objClass.Organization = item.Organization; objClass.Position = item.Position; objClass.Town = item.Town; objClass.Description = item.Description; objClass.EndYear = Convert.ToInt32(item.EndYear); objClass.EndMonth = Convert.ToInt32(item.EndMonth); objClass.EndDay = Convert.ToInt32(item.EndDay); objClass.StartDay = Convert.ToInt32(item.StartDay); objClass.StartMonth = Convert.ToInt32(item.StartMonth); objClass.StartYear = Convert.ToInt32(item.StartYear); objClass.IsCurrentlyWork = Convert.ToBoolean(item.IsCurrentlyWork); objClass.Image = item.Image; break; } return objClass; }
protected void SaveEmployer() { TemplateBO objEmployer = new EmployerBO(); objEmployer.UserId = Userid; objEmployer.Organization = txtEmployer.Text; objEmployer.Position = txtEmployerPosition.Text; objEmployer.Town = txtEmployerTown.Text; objEmployer.Description = txtEmployerDescription.Text; objEmployer.EndYear = Convert.ToInt32(lstEndYear.SelectedValue); objEmployer.EndMonth = Convert.ToInt32(lstEndMonth.SelectedValue); objEmployer.EndDay = Convert.ToInt32(lstEndDay.SelectedValue); objEmployer.StartDay = Convert.ToInt32(lstStartDay.SelectedValue); objEmployer.StartMonth = Convert.ToInt32(lstStartMonth.SelectedValue); objEmployer.StartYear = Convert.ToInt32(lstStartYear.SelectedValue); objEmployer.IsCurrentlyWork = chkEmployerCurrentlyWork.Checked; if (System.IO.File.Exists(Server.MapPath("../../Resources/images/ProfileIcons/" + txtEmployer.Text + ".jpg"))) { objEmployer.Image = txtEmployer.Text + ".jpg"; } else if (System.IO.File.Exists(Server.MapPath("../../Resources/images/ProfileIcons/" + txtEmployer.Text + ".png"))) { objEmployer.Image = txtEmployer.Text + ".png"; } else { objEmployer.Image = "DefaultEmployer.png"; } TemplateInfoBLL.insert(objEmployer, new EmployerDAL()); LoadDataListEmployer(); }
public static void insertEmployer(EmployerBO objEmployer) { if (!objEmployer.Organization.Equals("")) { EmployerDAL.insertEmployer(objEmployer); } }
protected void btnGenerateInvoice_Click(object sender, EventArgs e) { string visit = ""; string employerId = ""; EmployerBO objEmployerBO = new EmployerBO(); for (int i = 0; i < grdVisits.Items.Count; i++) { CheckBox chk = (CheckBox)grdVisits.Items[i].Cells[0].FindControl("chkSelect"); if (chk.Checked) { if (visit == "") { visit = grdVisits.Items[i].Cells[3].Text.ToString(); } else { visit = visit + "," + grdVisits.Items[i].Cells[3].Text.ToString(); } employerId = grdVisits.Items[i].Cells[2].Text.ToString(); } } string invoiceId = objEmployerBO.GenerateInvoice(visit, employerId, txtCompanyID.Text, ((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_ID.ToString()); if (invoiceId != "") { GeneratePdf(invoiceId); } BindGrid(); }
protected void btnDelete_Click(object sender, EventArgs e) { ArrayList arrObj = new ArrayList(); for (int i = 0; i < grdDocs.Items.Count; i++) { CheckBox chk = (CheckBox)grdDocs.Items[i].FindControl("ChkDelete"); if (chk.Checked) { EmployerVisitDO objEmployerVisitDO = new EmployerVisitDO(); objEmployerVisitDO.CompanyID = txtCompanyID.Text; objEmployerVisitDO.ImageId = grdDocs.Items[i].Cells[0].Text.ToString(); objEmployerVisitDO.VisitId = grdDocs.Items[i].Cells[3].Text.ToString(); arrObj.Add(objEmployerVisitDO); } } EmployerBO objEmployerBO = new EmployerBO(); string sReturn = objEmployerBO.DeleteDocs(arrObj); if (sReturn == "deleted") { lblMsg.Text = "Document deleted successfully"; } else { lblMsg.Text = sReturn; } lblMsg.Visible = true; BindData(); }
protected void btnDelete_Click(object sender, EventArgs e) { EmployerBO objDelete = new EmployerBO(); string szOutPut = ""; ArrayList arrlst = new ArrayList(); for (int i = 0; i < grdViewDoc.Rows.Count; i++) { CheckBox grdChk = (CheckBox)grdViewDoc.Rows[i].FindControl("ChkDelete"); if (grdChk.Checked) { string szImageId = grdViewDoc.DataKeys[i]["I_IMAGE_ID"].ToString(); arrlst.Add(szImageId); } } string rRetrun = objDelete.DeletePaymetDocs(arrlst, txtpaymetID.Text, txtCompnyID.Text, txtinvoiceid.Text); if (rRetrun == "deleted") { this.usrMessage1.PutMessage("Payment Image(s) successfully ..."); this.usrMessage1.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage); this.usrMessage1.Show(); } else { this.usrMessage1.PutMessage("Error " + rRetrun); this.usrMessage1.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_ErrorMessage); this.usrMessage1.Show(); } }
public void GetData() {//Logging Start string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url); using (Utils utility = new Utils()) { utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod()); } try { EmployerBO objEmployerBO = new EmployerBO(); DataSet ds = objEmployerBO.GetAllInvoice(txtCaseNo.Text, txtCompanyID.Text, "", "", "", "", extddlEmployer.Text, "2"); grdVisits.DataSource = ds; grdVisits.DataBind(); } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } string str2 = "Error Request=" + id + ".Please share with Technical support."; base.Response.Redirect("../Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2); } //Method End using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } }
public void BindProcedureCodes() {//Logging Start string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url); using (Utils utility = new Utils()) { utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod()); } try { EmployerBO employerBO = new EmployerBO(); this.lstProcedureCode.Items.Clear(); DataSet employeProcedure = employerBO.GetEmployeProcedure(this.extddlEmployer.Text, this.txtCompanyID.Text); this.lstProcedureCode.DataSource = employeProcedure; this.lstProcedureCode.DataTextField = "DESCRIPTION"; this.lstProcedureCode.DataValueField = "CODE"; this.lstProcedureCode.DataBind(); } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } string str2 = "Error Request=" + id + ".Please share with Technical support."; base.Response.Redirect("../Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2); } //Method End using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } }
public EmployerBO SelectEmployerByUserId(string Id) { MongoCollection <Employer> objCollection = db.GetCollection <Employer>("c_Employer"); EmployerBO objClass = new EmployerBO(); foreach (Employer item in objCollection.Find(Query.EQ("UserId", ObjectId.Parse(Id)))) { objClass.Id = item._id.ToString(); objClass.UserId = item.UserId.ToString(); objClass.Organization = item.Organization; objClass.Position = item.Position; objClass.Town = item.Town; objClass.Description = item.Description; objClass.EndYear = Convert.ToInt32(item.EndYear); objClass.EndMonth = Convert.ToInt32(item.EndMonth); objClass.EndDay = Convert.ToInt32(item.EndDay); objClass.StartDay = Convert.ToInt32(item.StartDay); objClass.StartMonth = Convert.ToInt32(item.StartMonth); objClass.StartYear = Convert.ToInt32(item.StartYear); objClass.IsCurrentlyWork = Convert.ToBoolean(item.IsCurrentlyWork); objClass.Image = item.Image; break; } return(objClass); }
protected void btnSearch_Click(object sender, EventArgs e) { EmployerBO obj = new EmployerBO(); DataSet ds = obj.SearchInvoice(txtInvoiceNo.Text, txtCompanyID.Text, txtInvoceFromDate.Text, txtInvoceToDate.Text, extddlEmployer.Text); grdVisits.DataSource = ds; grdVisits.DataBind(); }
protected void UploadButton_Click(object sender, EventArgs e) { string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url); using (Utils utility = new Utils()) { utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod()); } try { EmployerVisitDO objEmployerVisitDO = new EmployerVisitDO(); objEmployerVisitDO.CaseID = txtCaseID.Text; objEmployerVisitDO.CompanyID = txtCompanyID.Text; objEmployerVisitDO.CompanyName = txtCompanyName.Text; objEmployerVisitDO.UserID = txtUserID.Text; objEmployerVisitDO.UserName = txtUserName.Text; objEmployerVisitDO.VisitId = txtVisitId.Text; objEmployerVisitDO.FileName = ReportUpload.FileName; EmployerBO objEmployerBO = new EmployerBO(); string sPath = objEmployerBO.SaveVisitDocument(objEmployerVisitDO); string sBasePath = ConfigurationManager.AppSettings["BASEPATH"].ToString(); if (!Directory.Exists(sBasePath + sPath)) { Directory.CreateDirectory(sBasePath + sPath); } if (sPath != "") { ReportUpload.SaveAs(sBasePath + sPath + ReportUpload.FileName); lblmsg.Text = "File saved successfully"; lblmsg.Visible = true; } else { lblmsg.Text = "unable to save file"; lblmsg.Visible = true; } } catch (Exception ex) { lblmsg.Text = ex.ToString(); lblmsg.Visible = true; Elmah.ErrorSignal.FromCurrentContext().Raise(ex); using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } string str2 = "Error Request=" + id + ".Please share with Technical support."; base.Response.Redirect("../Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2); } //Method End using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } }
protected void BindGrid() {//Logging Start string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url); using (Utils utility = new Utils()) { utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod()); } try { EmployerVisitDO objEmployerdo = new EmployerVisitDO(); objEmployerdo.EmploerID = extddlEmployer.Text; objEmployerdo.CompanyID = txtCompanyID.Text; string cases = ""; if (txtCaseNo.Text != "") { string[] spiltcases = txtCaseNo.Text.Trim().Split(','); for (int i = 0; i < spiltcases.Length; i++) { if (cases == "") { cases = "'" + spiltcases[i].ToString() + "'"; } else { cases += ",'" + spiltcases[i].ToString() + "'"; } } } objEmployerdo.CaseNO = cases; objEmployerdo.From_Visit_Date = txtFromDate.Text; objEmployerdo.To_Visit_Date = txtToDate.Text; EmployerBO objBillSysPatientBO = new EmployerBO(); DataSet ds = objBillSysPatientBO.GetVisit(objEmployerdo); grdVisits.DataSource = ds; grdVisits.DataBind(); } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } string str2 = "Error Request=" + id + ".Please share with Technical support."; base.Response.Redirect("../Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2); } //Method End using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } }
public void BindData() { EmployerVisitDO objEmployerVisitDO = new EmployerVisitDO(); objEmployerVisitDO.CompanyID = txtCompanyID.Text; objEmployerVisitDO.VisitId = txtvisitId.Text; EmployerBO objEmployerBO = new EmployerBO(); DataSet ds = objEmployerBO.GetDocumnets(objEmployerVisitDO); grdDocs.DataSource = ds; grdDocs.DataBind(); }
public static ArrayList getEmployersByUserId(string Id) { ArrayList Employers = new ArrayList(); MongoCollection<Employer> objCollection = db.GetCollection<Employer>("c_Employer"); EmployerBO objClass = new EmployerBO(); foreach (Employer item in objCollection.Find(Query.EQ("UserId", ObjectId.Parse(Id)))) { Employers.Add(item.Organization); } return Employers; }
public static ArrayList getEmployersByUserId(string Id) { ArrayList Employers = new ArrayList(); MongoCollection <Employer> objCollection = db.GetCollection <Employer>("c_Employer"); EmployerBO objClass = new EmployerBO(); foreach (Employer item in objCollection.Find(Query.EQ("UserId", ObjectId.Parse(Id)))) { Employers.Add(item.Organization); } return(Employers); }
public async Task <EmployerBO> InsEmployerDetails(EmployerBO EmpObj) { try { con = await DBConnection.ApexConnection(); cmd = new DBConnection().BuildProcedureCommand("P_InsEmployerDetails", con); cmd.Parameters.AddWithValue("@UserID", EmpObj.Userid); cmd.Parameters.AddWithValue("@CompName", EmpObj.CompName); cmd.Parameters.AddWithValue("@DUNSNumber", EmpObj.DUNSNumber); cmd.Parameters.AddWithValue("@SysDate", DateTime.Now); //EmpObj.SysDate); cmd.Parameters.AddWithValue("@Description", EmpObj.Description); cmd.Parameters.AddWithValue("@Street", EmpObj.EmployerAddress.street); cmd.Parameters.AddWithValue("@City", EmpObj.EmployerAddress.city); cmd.Parameters.AddWithValue("@State", EmpObj.EmployerAddress.state); cmd.Parameters.AddWithValue("@Country", EmpObj.EmployerAddress.country); cmd.Parameters.AddWithValue("@ZipCode", EmpObj.EmployerAddress.Zipcode); cmd.Parameters.AddWithValue("@FromDt", DateTime.Now); //EmpObj.EmployerAddress.fromdate); cmd.Parameters.AddWithValue("@Todate", DateTime.Now); // EmpObj.EmployerAddress.Todate); cmd.Parameters.AddWithValue("@RevenueAmount", EmpObj.RevenueAmount); cmd.Parameters.AddWithValue("@Currency", EmpObj.Currency); using (var reader = await cmd.ExecuteReaderAsync()) { if (reader.Read()) { EmpObj = new EmployerBO(); EmpObj.Userid = Convert.ToInt32(reader["ID"]); EmpObj.CompName = reader["Name"].ToString(); EmpObj.CompId = Convert.ToInt32(reader["CompId"]); //EmpObj.AddressID = reader["AddressID"].ToString();//Convert.ToInt32(reader["AddressID"]); //EmpObj.DUNSNumber = reader["DUNSNumber"].ToString(); //EmpObj.AboutId = Convert.ToInt32(reader["AboutId"]); //EmpObj.Revenue = Convert.ToInt32(reader["Revenue"]); return(EmpObj); } else { EmpObj = new EmployerBO(); return(EmpObj); } } } catch (Exception es) { throw es; } }
public IRestResponse InsertEmployerDetails(EmployerBO EmpBO) { var client = new RestClient(Url + ApexConfig.InsertEmployerDetails); var request = new RestRequest(Method.POST); string jsonRequest = JsonConvert.SerializeObject(EmpBO); request.AddParameter( "application/json; charset=utf-8", jsonRequest, ParameterType.RequestBody); request.AddBody(jsonRequest); var response = client.Execute(request); return(response); }
public static List <UserFriendsBO> getAllSuggestions(string UserId) { List <UserFriendsBO> list = FriendsDAL.getAllSuggestions(UserId); foreach (UserFriendsBO Useritem in list) { BasicInfoBO info = BasicInfoDAL.getBasicInfoByUserId(Useritem.FriendUserId); Useritem.Hometown = info.HomeTown; Useritem.Location = info.CurrentCity; EmployerBO emp = EmployerDAL.getEmployerByUserId(Useritem.FriendUserId); Useritem.Employer = emp.Organization; UniversityBO uni = UniversityDAL.getUniversityByUniversityId(Useritem.FriendUserId); Useritem.Education = uni.UniversityName; } return(list); }
public async Task <HttpResponseMessage> InsertEmployerDetails(EmployerBO EMPBOObj) { try { EMPObj = await db.InsEmployerDetails(EMPBOObj); if (EMPObj.Userid != 0) { return(Request.CreateResponse(HttpStatusCode.Created, EMPObj)); } else { return(Request.CreateErrorResponse(HttpStatusCode.Conflict, "something bad happened, please raise this to our notice")); } } catch (Exception es) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, es.Message)); } }
public void BindEmloyer() {//Logging Start string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url); using (Utils utility = new Utils()) { utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod()); } try { EmployerBO objEmployerBO = new EmployerBO(); DataSet ds = objEmployerBO.GetCaseEmployer(txtCaseId.Text, txtCompanyID.Text); if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { extddlEmployer.Text = ds.Tables[0].Rows[0]["SZ_EMPLOYER_ID"].ToString(); extddlEmployer.Enabled = false; } } } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } string str2 = "Error Request=" + id + ".Please share with Technical support."; base.Response.Redirect("../Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2); } //Method End using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } }
public async Task <List <EmployerBO> > GetEmployerHistory(int Eid) { try { con = await DBConnection.ApexConnection(); cmd = new DBConnection().BuildProcedureCommand("P_GetEmployerDetails", con); //cmd.Parameters.AddWithValue("@userid", Eid); using (var reader = await cmd.ExecuteReaderAsync()) { List <EmployerBO> ListEmpObj = new List <EmployerBO>(); EmployerBO EmpObj = new EmployerBO(); while (reader.Read()) { //EmpObj = new EmployerBO(); ////EmpObj.id = Convert.ToInt32(reader["CompId"]); //EmpObj.Name = reader["Name"].ToString(); //EmpObj.AddressID = reader["AddressID"].ToString(); //EmpObj.DUNSNumber = reader["DUNSNumber"].ToString(); //EmpObj.AboutId = Convert.ToInt32(reader["AboutId"]); //EmpObj.Revenue = Convert.ToInt32(reader["Revenue"]); //EmpObj.EmployerAddress.street = reader["Street"].ToString(); //EmpObj.EmployerAddress.city = reader["City"].ToString(); //EmpObj.EmployerAddress.state = reader["State"].ToString(); //EmpObj.EmployerAddress.country = reader["Country"].ToString(); //EmpObj.EmployerAddress.Zipcode = reader["ZipCode"].ToString(); //EmpObj.EmployerAddress.fromdate = reader["fromDate"].ToString(); //EmpObj.EmployerAddress.Todate = reader["ToDate"].ToString(); ListEmpObj.Add(EmpObj); } con.Close(); return(ListEmpObj); } } catch (Exception es) { throw es; } }
public static void insertEmployer(EmployerBO objClass) { MongoCollection <BsonDocument> objCollection = db.GetCollection <BsonDocument>("c_Employer"); BsonDocument doc = new BsonDocument { { "UserId", ObjectId.Parse(objClass.UserId) }, { "Organization", objClass.Organization }, { "Position", objClass.Position }, { "Town", objClass.Town }, { "Description", objClass.Description }, { "IsCurrentlyWork", objClass.IsCurrentlyWork }, { "StartDay", objClass.StartDay }, { "StartMonth", objClass.StartMonth }, { "StartYear", objClass.StartYear }, { "EndDay", objClass.EndDay }, { "EndMonth", objClass.EndMonth }, { "EndYear", objClass.EndYear }, { "Image", objClass.Image } }; objCollection.Insert(doc); }
public static void updateEmployer(EmployerBO objClass) { MongoCollection <Employer> objCollection = db.GetCollection <Employer>("c_Employer"); var query = Query.EQ("_id", ObjectId.Parse(objClass.Id)); var sortBy = SortBy.Descending("_id"); var update = Update.Set("UserId", ObjectId.Parse(objClass.UserId)) .Set("Organization", objClass.Organization) .Set("Position", objClass.Position) .Set("Town", objClass.Town) .Set("Description", objClass.Description) .Set("IsCurrentlyWork", objClass.IsCurrentlyWork) .Set("StartDay", objClass.StartDay) .Set("StartMonth", objClass.StartMonth) .Set("StartYear", objClass.StartYear) .Set("EndDay", objClass.EndDay) .Set("EndMonth", objClass.EndMonth) .Set("EndYear", objClass.EndYear) .Set("Image", objClass.Image) ; var result = objCollection.FindAndModify(query, sortBy, update, true); }
public static void updateEmployer(EmployerBO objClass) { MongoCollection<Employer> objCollection = db.GetCollection<Employer>("c_Employer"); var query = Query.EQ("_id", ObjectId.Parse(objClass.Id)); var sortBy = SortBy.Descending("_id"); var update = Update.Set("UserId", ObjectId.Parse(objClass.UserId)) .Set( "Organization" , objClass.Organization ) .Set("Position", objClass.Position ) .Set( "Town" , objClass.Town ) .Set( "Description", objClass.Description ) .Set( "IsCurrentlyWork" , objClass.IsCurrentlyWork ) .Set( "StartDay", objClass.StartDay) .Set( "StartMonth" , objClass.StartMonth ) .Set( "StartYear", objClass.StartYear ) .Set( "EndDay", objClass.EndDay ) .Set( "EndMonth" , objClass.EndMonth) .Set( "EndYear", objClass.EndYear ) .Set( "Image",objClass.Image ) ; var result = objCollection.FindAndModify(query, sortBy, update, true); }
protected void SaveEmployer() { TemplateBO objEmployer = new EmployerBO(); objEmployer.UserId = Userid; objEmployer.Organization =txtEmployer.Text; objEmployer.Position = txtEmployerPosition.Text; objEmployer.Town = txtEmployerTown.Text; objEmployer.Description = txtEmployerDescription.Text; objEmployer.EndYear = Convert.ToInt32(lstEndYear.SelectedValue); objEmployer.EndMonth = Convert.ToInt32(lstEndMonth.SelectedValue); objEmployer.EndDay = Convert.ToInt32(lstEndDay.SelectedValue); objEmployer.StartDay = Convert.ToInt32(lstStartDay.SelectedValue); objEmployer.StartMonth = Convert.ToInt32(lstStartMonth.SelectedValue); objEmployer.StartYear = Convert.ToInt32(lstStartYear.SelectedValue); objEmployer.IsCurrentlyWork = chkEmployerCurrentlyWork.Checked; if (System.IO.File.Exists(Server.MapPath("../../Resources/images/ProfileIcons/" + txtEmployer.Text + ".jpg"))) objEmployer.Image = txtEmployer.Text + ".jpg"; else if (System.IO.File.Exists(Server.MapPath("../../Resources/images/ProfileIcons/" + txtEmployer.Text + ".png"))) objEmployer.Image = txtEmployer.Text + ".png"; else objEmployer.Image = "DefaultEmployer.png"; TemplateInfoBLL.insert(objEmployer, new EmployerDAL()); LoadDataListEmployer(); }
public static void updateEmployer(EmployerBO objEmployer) { EmployerDAL.updateEmployer(objEmployer); }
protected void btnDeleteVisit_Click(object sender, EventArgs e) {//Logging Start string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url); using (Utils utility = new Utils()) { utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod()); } try { for (int i = 0; i < grdVisits.Items.Count; i++) { CheckBox chk = (CheckBox)grdVisits.Items[i].FindControl("chkSelect"); if (chk.Checked) { if (grdVisits.Items[i].Cells[17].Text.ToLower() == "true") { ScriptManager.RegisterClientScriptBlock(this, GetType(), "Done", "alert('Please select visit(s) for which invoice is not generated.');", true); return; } } } ArrayList arrList = new ArrayList(); for (int i = 0; i < grdVisits.Items.Count; i++) { CheckBox chk = (CheckBox)grdVisits.Items[i].FindControl("chkSelect"); if (chk.Checked) { EmployerVisitDO objEmployerVisitDO = new EmployerVisitDO(); objEmployerVisitDO.VisitId = grdVisits.Items[i].Cells[3].Text; objEmployerVisitDO.CompanyID = txtCompanyID.Text; arrList.Add(objEmployerVisitDO); } } EmployerBO objEmployerBO = new EmployerBO(); string returnVal = objEmployerBO.DeleteVisit(arrList); if (returnVal != "") { this.usrMessage.PutMessage("Visit Deleted successfully."); this.usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage); this.usrMessage.Show(); } else { this.usrMessage.PutMessage("Error to delete visit."); this.usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_ErrorMessage); this.usrMessage.Show(); } GetData(); } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } string str2 = "Error Request=" + id + ".Please share with Technical support."; base.Response.Redirect("../Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2); } //Method End using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } }
public static void insertEmployer(EmployerBO objClass) { MongoCollection<BsonDocument> objCollection = db.GetCollection<BsonDocument>("c_Employer"); BsonDocument doc = new BsonDocument { { "UserId" , ObjectId.Parse(objClass.UserId) }, { "Organization" , objClass.Organization }, { "Position", objClass.Position }, { "Town" , objClass.Town }, { "Description", objClass.Description }, { "IsCurrentlyWork" , objClass.IsCurrentlyWork }, { "StartDay", objClass.StartDay }, { "StartMonth" , objClass.StartMonth }, { "StartYear", objClass.StartYear }, { "EndDay", objClass.EndDay }, { "EndMonth" , objClass.EndMonth }, { "EndYear", objClass.EndYear }, { "Image",objClass.Image } }; objCollection.Insert(doc); }
public void GeneratePdf(string invoiceID) {//Logging Start string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url); using (Utils utility = new Utils()) { utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod()); } try { EmployerBO objEmployerBO = new EmployerBO(); DataSet ds = objEmployerBO.GetInvoiceInfo(invoiceID, txtCompanyID.Text); string strHtml = "<table width='100%'><tr><td style='width:32%'>"; // strHtml = strHtml + "<img src='https://gogreenbills.com/images/cal.gif' alt='logo' height='150' width='140' /></td>"; strHtml = strHtml + "</td>"; strHtml = strHtml + "<td style='width:35%'><div style='float:center;'><table width='100%'><tr><td align='center' ><b>" + ds.Tables[0].Rows[0]["SZ_COMPANY_NAME"].ToString() + "</b></td></tr>"; strHtml = strHtml + " <tr><td align='center' >" + ds.Tables[0].Rows[0]["SZ_ADDRESS_STREET"].ToString() + "</td></tr>"; strHtml = strHtml + "<tr><td align='center' >" + ds.Tables[0].Rows[0]["SZ_ADDRESS_CITY"].ToString() + "," + ds.Tables[0].Rows[0]["SZ_ADDRESS_STATE"].ToString() + " " + ds.Tables[0].Rows[0]["SZ_ADDRESS_ZIP"].ToString() + "</td></tr>"; strHtml = strHtml + "<tr><td align='center' >PH." + ds.Tables[0].Rows[0]["SZ_OFFICE_PHONE"].ToString() + " FAX:" + ds.Tables[0].Rows[0]["SZ_FAX_NO"].ToString() + "</td></tr></table></div></td>"; strHtml = strHtml + "<td style='width:30%'><div style='float:right;'><table><tr><td><b>INVOICE</b></td></tr> <tr><td> </td></tr><tr><td>DATE:" + ds.Tables[1].Rows[0]["DATE"].ToString() + "</td></tr><tr><td><b>INVOICE #: " + ds.Tables[1].Rows[0]["ID"].ToString() + "</b></td></tr></table></div></td>"; //strHtml = strHtml + "<div style='float:right;width:20%'><table><tr><td><b>INVOICE</b></td></tr><tr><td>DATE:7/14/2014</td></tr><tr><td><b>INVOICE #: ABM0614 </b></td></tr></table></div>"; //strHtml = strHtml + "</div>"; strHtml = strHtml + "<br /><br /><br />"; //strHtml = strHtml + "<div style='width:100%;height: 210px;'>"; // strHtml = strHtml + "<div style='float:left;width:80%; height: 190px;'>"; //strHtml = strHtml + "<div style='float:right;width:20%; height: 190px;'>"; //strHtml = strHtml + "<table><tr><td>DT</td><td>Drug Test</td><td>21</td></tr>"; //strHtml = strHtml + "<tr><td>DTC</td><td>Drug Test Collection</td><td>0</td></tr>"; //strHtml = strHtml + "<tr><td>BAT </td><td>Breath Alcohol Test</td><td>0</td></tr>"; //strHtml = strHtml + "<tr><td>PHY </td><td>Physical Exam</td><td>0</td></tr>"; //strHtml = strHtml + "<tr><td>XRAY</td><td>Chest Xray</td><td>0</td></tr>"; //strHtml = strHtml + "<tr><td>PPD </td><td>Skin Test</td><td>0</td></tr>"; //strHtml = strHtml + "<tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>"; //strHtml = strHtml + "<tr><td align='center' colspan='3'><b>Invoice June 2014 </b></td></tr>"; //strHtml = strHtml + "</table>"; //strHtml = strHtml + "</div>"; strHtml = strHtml + "</tr></table>"; strHtml = strHtml + "<table width='100%'><tr><td style='width:50%'><div style='float:left;'><table><tr><td><b>BILL TO:</b></td></tr><tr><td><b>" + ds.Tables[2].Rows[0]["SZ_EMPLOYER_NAME"].ToString() + "</b></td></tr></table></div></td>"; strHtml = strHtml + "<td style='width:50%'><div style='float:right;'> <table width='50%' align='right' >"; for (int i = 0; i < ds.Tables[3].Rows.Count; i++) { strHtml = strHtml + "<tr> <td align='right' >" + ds.Tables[3].Rows[i]["SZ_PROCEDURE_CODE"].ToString() + "</td> <td align='right' >" + ds.Tables[3].Rows[i]["SZ_CODE_DESCRIPTION"].ToString() + "</td> <td align='right' >" + ds.Tables[3].Rows[i]["COUNT"].ToString() + " </td>"; } strHtml = strHtml + "<tr><td align='Center' colspan='3'>Invoice " + CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(DateTime.Now.Month) + " " + DateTime.Now.Year + " </td></tr>"; strHtml = strHtml + "</table></div></td></tr></table>"; strHtml = strHtml + "<div style='width:100%'>"; strHtml = strHtml + "<table border='1' width='100%'>"; strHtml = strHtml + "<thead><tr><th><b>QTY</b></th><th><b>Items</b></th><th><b>First name</b></th><th><b>Last name</b></th><th><b>SSN</b></th><th><b>Date of service</b> </th><th style='width:10%'><b>Unit price</b></th><th style='width:10%'><b>Total</b></th></tr></thead>"; strHtml = strHtml + "<tbody> "; int ifirst = 0; int icount = 0; for (int i = 0; i < ds.Tables[4].Rows.Count; i++) { if (icount > 16 && ifirst != 0) { icount = 0; ifirst = 1; strHtml = strHtml + "</tbody>"; strHtml = strHtml + "</table>"; strHtml = strHtml + "<span style='page-break-before: always;'/>"; strHtml = strHtml + "<table border='1' width='100%'>"; strHtml = strHtml + "<thead><tr><th><b>QTY</b></th><th><b>Items</b></th><th><b>First name</b></th><th><b>Last name</b></th><th><b>SSN</b></th><th><b>Date of service</b> </th><th style='width:10%'><b>Unit price</b></th><th style='width:10%'><b>Total</b></th></tr></thead>"; strHtml = strHtml + "<tbody> "; } if (icount > 9 && ifirst == 0) { icount = 0; ifirst = 1; strHtml = strHtml + "</tbody>"; strHtml = strHtml + "</table>"; strHtml = strHtml + "<span style='page-break-before: always;'/>"; strHtml = strHtml + "<table border='1' width='100%'>"; strHtml = strHtml + "<thead><tr><th><b>QTY</b></th><th><b>Items</b></th><th><b>First name</b></th><th><b>Last name</b></th><th><b>SSN</b></th><th><b>Date of service</b> </th><th style='width:10%'><b>Unit price</b></th><th style='width:10%'><b>Total</b></th></tr></thead>"; strHtml = strHtml + "<tbody> "; } strHtml = strHtml + "<tr><td> " + ds.Tables[4].Rows[i]["QTY"].ToString(); strHtml = strHtml + "<td> " + ds.Tables[4].Rows[i]["ITEMS"].ToString() + " </td><td> " + ds.Tables[4].Rows[i]["FIRST NAME"].ToString() + " </td>"; strHtml = strHtml + "<td> " + ds.Tables[4].Rows[i]["LAST NAME"].ToString() + " </td>"; strHtml = strHtml + "<td> " + ds.Tables[4].Rows[i]["SSN"].ToString() + " </td>"; strHtml = strHtml + "<td> " + ds.Tables[4].Rows[i]["DOS"].ToString() + " </td>"; strHtml = strHtml + "<td> " + ds.Tables[4].Rows[i]["UNIT PRICE"].ToString() + "</td>"; strHtml = strHtml + "<td> " + ds.Tables[4].Rows[i]["TOTAL"].ToString() + " </td>"; icount++; } strHtml = strHtml + "<tr><td colspan='6' style='border:none'> </td><td><b>Subtotal</b> </td><td> " + ds.Tables[5].Rows[0]["sum"].ToString() + "</td></tr>"; strHtml = strHtml + "<tr><td colspan='6' style='border:none'> </td><td><b>Total Amt </b></td><td>" + ds.Tables[5].Rows[0]["sum"].ToString() + "</td></tr>"; strHtml = strHtml + "<tr><td colspan='6' style='border:none'> </td><td><b>Balance Due</b> </td><td> " + ds.Tables[5].Rows[0]["sum"].ToString() + "</td></tr>"; strHtml = strHtml + "</tbody>"; strHtml = strHtml + "</table>"; strHtml = strHtml + "</div>"; strHtml = strHtml + "<br /> <br /><table width='100%'><tr><td align='center'><b>Please make checks payable to "; strHtml = strHtml + ds.Tables[0].Rows[0]["SZ_COMPANY_NAME"].ToString() + " "; strHtml = strHtml + ds.Tables[0].Rows[0]["SZ_ADDRESS_STREET"].ToString() + " ,"; strHtml = strHtml + ds.Tables[0].Rows[0]["SZ_ADDRESS_CITY"].ToString() + " ,"; strHtml = strHtml + ds.Tables[0].Rows[0]["SZ_ADDRESS_STATE"].ToString() + " "; strHtml = strHtml + ds.Tables[0].Rows[0]["SZ_ADDRESS_ZIP"].ToString() + " </b></td></tr></table>"; SautinSoft.PdfMetamorphosis objHTMToPDF = new SautinSoft.PdfMetamorphosis(); objHTMToPDF.Serial = "10007706603"; objHTMToPDF.PageStyle.PageOrientation.Landscape(); string basePath = ApplicationSettings.GetParameterValue("PhysicalBasePath"); string SavePath = ((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/Invoice" + "/" + invoiceID + "/"; string htmfilename = getFileName("Invoice_" + invoiceID) + ".htm"; string pdffilename = getFileName("Invoice_" + invoiceID) + ".pdf"; if (!Directory.Exists(basePath + SavePath)) { Directory.CreateDirectory(basePath + SavePath); } StreamWriter sw = new StreamWriter(basePath + SavePath + htmfilename); sw.Write(strHtml); sw.Close(); Int32 iTemp; iTemp = objHTMToPDF.HtmlToPdfConvertFile(basePath + SavePath + htmfilename, basePath + SavePath + pdffilename); EmployerBO obj = new EmployerBO(); int retuenVal = obj.SaveInvoiceLink(txtCompanyID.Text, invoiceID, ApplicationSettings.GetParameterValue("DocumentManagerURL") + SavePath, pdffilename); if (retuenVal != 0) { ScriptManager.RegisterClientScriptBlock((Page)this, base.GetType(), "Msg", "window.open('" + ApplicationSettings.GetParameterValue("DocumentManagerURL") + SavePath + pdffilename + "'); ", true); } else { this.usrMessage.PutMessage("error to generate invoice pdf"); this.usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_ErrorMessage); this.usrMessage.Show(); } } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } string str2 = "Error Request=" + id + ".Please share with Technical support."; base.Response.Redirect("../Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2); } // Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "sandeep", "<script type='text/javascript'>window.location.href='" + @"D:\temp\" + pdffilename + "'</script>"); //Method End using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } }
protected void btnSave_Click(object sender, EventArgs e) { string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url); using (Utils utility = new Utils()) { utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod()); } try { ArrayList arrCases = new ArrayList(); for (int i = 0; i < grdCaseMaster.Items.Count; i++) { CheckBox chk = (CheckBox)grdCaseMaster.Items[i].Cells[0].FindControl("chkSelect"); if (chk.Checked) { EmployerVisitDO objCases = new EmployerVisitDO(); objCases.CaseID = grdCaseMaster.Items[i].Cells[2].Text.ToString(); objCases.CompanyID = txtCompanyID.Text; objCases.UserID = ((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_ID.ToString(); objCases.EmploerID = extddlEmployer.Text; objCases.VisitDate = txtAppointdate.Text; objCases.EmployerVisitProcedure = new List <EmployerVisitProcedure>(); foreach (ListItem lstitem in this.lstProcedureCode.Items) { if (lstitem.Selected) { string lstVal = lstitem.Value; string[] spiltVal = lstVal.Split('~'); EmployerVisitProcedure objEmployerVisitProcedure = new EmployerVisitProcedure(); objEmployerVisitProcedure.ProcedureCode = spiltVal[0].ToString(); objEmployerVisitProcedure.ProcedureGroupId = spiltVal[1].ToString(); objCases.EmployerVisitProcedure.Add(objEmployerVisitProcedure); } } arrCases.Add(objCases); } } EmployerBO objEmployerBO = new EmployerBO(); string returnSave = objEmployerBO.SaveVisit(arrCases); if (returnSave != "") { this.usrMessage.PutMessage("Visit save Sucessfully."); this.usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage); this.usrMessage.Show(); } else { this.usrMessage.PutMessage("can not save the visit"); this.usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_ErrorMessage); this.usrMessage.Show(); } } catch (Exception ex) { Elmah.ErrorSignal.FromCurrentContext().Raise(ex); using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } string str2 = "Error Request=" + id + ".Please share with Technical support."; base.Response.Redirect("Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2); } //Method End using (Utils utility = new Utils()) { utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod()); } }