public void ModifyScheduleStatus(string EmpID, string AppLoginKey, string CompanyID, string nid, string newStatus) { ClsTimeSheet objts = new ClsTimeSheet(); DataSet ds = new DataSet(); GeneralMethod objgen = new GeneralMethod(); if (checkAppKey(EmpID, AppLoginKey)) { objts.projectid = ""; objts.groupid = ""; objts.empid = EmpID; objts.date = ""; objts.remark = ""; objts.Status = newStatus; objts.companyId = CompanyID; objts.nid = nid; objts.action = "setgroupstatus"; ds = objts.schedule(); if (ds.Tables[0].Rows.Count > 0) { ResponseData(objGen.serilizeinJson(ds.Tables[0])); } else { ResponseData("[]"); } } else { ResponseError(); } }
protected void bindheader() { string str = ""; string Companyname = Session["companyname"].ToString(); string companyaddress = Session["companyaddress"].ToString(); string headerstr = "<table width='100%'><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>"; str = headerstr + @" <tr><td colspan='7' width='70%'></td><td style='width:30%;border:solid 2px #1caf9a;text-align:right;'> <h3> Time & Expense Client Report </h3></td></tr><tr><td height='10'> </td></tr> <tr><td colspan='5' style='width:70%;'> <h2> " + Companyname + @" </h2> </td><td colspan='2' align='right' style='font-size:11px;'>Printed on: " + GeneralMethod.getLocalDateTime() + @"</td></tr> <tr><td colspan='7'> <h5> " + companyaddress + @" </h5> </td></tr> <tr><td colspan='7' height='10'> </td></tr></table>"; Session["header"] = str; Session["css"] = "timeexp"; }
/// <summary> /// Desc: Method validate Obligation Filters /// </summary> /// <param name="testData"></param> public void SearchPage_ObligationFilters(Dictionary <string, string> testData) { try { WaitforElement_ExpectedConditions(30, 250, "//kendo-panelbar-item[@id='k-panelbar-1-item-default-3']"); WaitforElement_Exists(30, 250, "//kendo-panelbar-item[@id='k-panelbar-1-item-default-3']"); AssertIsTrue("xpath", "//kendo-panelbar-item[@id='k-panelbar-1-item-default-3']", "Obligation Filters"); WaitforElement_ExpectedConditions(30, 250, "//div[contains(text(),'Functional Group')]"); TodaysDate = DateTime.Now; string TodaysDate_effectiveDate = Convert.ToString(TodaysDate); string TodaysDate_effectiveDateMain = Convert.ToDateTime(TodaysDate_effectiveDate).ToString("MM/dd/yyyy"); string effectivedate = TodaysDate_effectiveDateMain.Replace("/", ""); ClearValueOnElementWhenElementFound("xpath", "//kendo-datepicker[contains(@name,'dueDateUpto')]//input[contains(@class,'k-input')]", "Effective Date value cleared"); SendKeysForElement("xpath", "//kendo-datepicker[contains(@name,'dueDateUpto')]//input[contains(@class,'k-input')]", effectivedate, "Effective Date"); WaitforElement_ExpectedConditions(30, 250, "//button[@class='btn btn-dark']"); threadWait(900); ClickOnElementWhenElementFound("xpath", "//button[@class='btn btn-dark']", "Search Button"); WaitforElement_ExpectedConditions(30, 250, "//div[@class='ulx-panel-header ng-star-inserted']"); WaitforElementbool(20, 250, "//*[contains(@class,'k-grid-header-wrap')]//descendant::tr/th[2]//a[contains(@class,'k-link ng-star-inserted')]"); PageSort(testData, "xpath", "//*[contains(@class,'k-grid-content k-virtual-content')]//descendant::tr/td[2]//span", "xpath", "//*[contains(@class,'k-grid-header-wrap')]//descendant::tr/th[2]//a[contains(@class,'k-link ng-star-inserted')]"); Pagination(testData, "xpath", "//*[contains(@class,'k-widget k-grid')]//descendant::ul/li"); } catch (Exception ex) { GeneralMethod.ScreenShotCapture(); ExtentTestManager._parentTest.Log(Status.Fail, "Expected not matched " + ex.Message); Assert.Fail(ex.Message); } }
protected void dgnews_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.ToLower() == "remove") { objts.action = "delete"; objts.nid = e.CommandArgument.ToString(); ds = objts.ManageTax(); fillgrid(); GeneralMethod.alert(this.Page, "Deleted Successfully!"); } if (e.CommandName.ToLower() == "detail") { blank(); objts.action = "select"; objts.nid = e.CommandArgument.ToString(); ds = objts.ManageTax(); if (ds.Tables[0].Rows.Count > 0) { hidid.Value = ds.Tables[0].Rows[0]["nid"].ToString(); txtname.Text = ds.Tables[0].Rows[0]["name"].ToString(); txttaxpercent.Text = ds.Tables[0].Rows[0]["taxpercentage"].ToString(); btnsubmit.Text = "Update"; btndelete.Visible = true; } upadatepanel1.Update(); ScriptManager.RegisterStartupScript(this, GetType(), "key", "<script type='text/javascript'>opendiv();fixheader();</script>", false); } }
protected void insertschedule() { string msg = ""; string grpid = ""; objts.from = txtpopfrdate.Text; objts.to = txtpoptodate.Text; objts.clientid = drppopclient.Text; objts.date = drppophour.Text + (drppopmin.Text); objts.companyId = Session["companyid"].ToString(); objts.CreatedBy = Session["userid"].ToString(); objts.empid = hidexpense.Value; objts.projectid = ddlproject.Text; objts.type = rdbtnscheduleType.Text; if (rdbtnscheduleType.Text.ToLower() == "office") { objts.Status = ""; objts.remark = txtaddremark.Text; } else { objts.Status = drppopstatus.Text; objts.remark = ""; } ds = objts.insertschedule(); if (ds != null) { //if (ds.Tables[0].Rows.Count > 0) //{ // lblerr.Text = ds.Tables[0].Rows[0]["errormessage"].ToString(); // grpid = ds.Tables[0].Rows[0]["groupid"].ToString(); //} if (ds.Tables.Count > 1) { if (ds.Tables[1].Rows.Count > 0) { if (objts.type.ToLower() != "office") { sendnewschedulemail(ds.Tables[1]); } } } txtfrmdate.Text = txtpopfrdate.Text; txttodate.Text = txtpoptodate.Text; drpclient.Text = drppopclient.Text; } blank(); fillgrid(); if (ds != null) { if (ds.Tables.Count > 1) { if (ds.Tables[1].Rows.Count > 0) { GeneralMethod.alert(this, "Saved Successfully"); } } } }
public static string getAllAsset(string prefixText, string companyid, string isapprove, string empid) { Cls_Asset objts = new Cls_Asset(); DataSet ds1 = new DataSet(); GeneralMethod objgen = new GeneralMethod(); objts.name = ""; if (isapprove == "1") { objts.nid = ""; objts.action = "selectforautocompleter"; } else { objts.action = "selectforautocompleterbuemp"; objts.nid = empid; } objts.companyId = companyid; ds1 = objts.ManageAsset(); string result = objgen.serilizeinJson(ds1.Tables[0]); return(result); }
public void sendMail() { MailMessage mail = new MailMessage(); SmtpClient smtp = new SmtpClient(); GeneralMethod.createZipFile(); string fromEmail = ConfigurationManager.AppSettings["FromEmail"]; string fromPassword = ConfigurationManager.AppSettings["FromPassword"]; try { ContentType ctype = new ContentType("application/zip"); string zipFile = GeneralMethod.GetZipFolderPath() + @"\ExtentReport.zip"; mail.From = new MailAddress(fromEmail, "Testingxpters"); mail.To.Add(new MailAddress("*****@*****.**", "Testingxperts")); mail.To.Add(new MailAddress("*****@*****.**", "Testingxperts")); mail.Subject = "Automation Test Reports"; mail.Body = "Hi \n\n Please find the reports attached.\n\n Regards \n Testingxperts"; mail.Attachments.Add(new Attachment(zipFile, ctype)); smtp.Host = "smtp.gmail.com"; smtp.Port = 25; smtp.EnableSsl = true; smtp.UseDefaultCredentials = false; smtp.Credentials = new System.Net.NetworkCredential(fromEmail, fromPassword); smtp.Send(mail); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.ReadLine(); } }
public void GetExpenseLog(string EmpID, string AppLoginKey, string CompanyID, string fromDate, string toDate, string empNid, string projectNid) { ClsTimeSheet objts = new ClsTimeSheet(); DataSet ds = new DataSet(); GeneralMethod objgen = new GeneralMethod(); if (checkAppKey(EmpID, AppLoginKey)) { objts.from = fromDate; objts.to = toDate; objts.empid = empNid; objts.action = "select"; objts.projectid = projectNid; objts.nid = ""; ds = objts.ManageExpenseLog(); if (ds.Tables[0].Rows.Count > 0) { ResponseData(objGen.serilizeinJson(ds.Tables[0])); } else { ResponseData("[]"); } } else { ResponseError(); } }
public void GetExpenseCode(string EmpID, string AppLoginKey, string CompanyID) { ClsTimeSheet objts = new ClsTimeSheet(); DataSet ds = new DataSet(); GeneralMethod objgen = new GeneralMethod(); if (checkAppKey(EmpID, AppLoginKey)) { objts.name = ""; objts.action = "select"; objts.type = "Expense"; objts.companyId = CompanyID; objts.nid = ""; objts.deptID = ""; objts.Status = "active"; ds = objts.ManageTasks(); if (ds.Tables[0].Rows.Count > 0) { ResponseData(objGen.serilizeinJson(ds.Tables[0])); } else { ResponseData("[]"); } } else { ResponseError(); } }
public void DeleteAppointment(string EmpID, string AppLoginKey, string CompanyID, string nid) { GeneralMethod objgen = new GeneralMethod(); DataSet ds = new DataSet(); ClsAppointment obj = new ClsAppointment(); if (checkAppKey(EmpID, AppLoginKey)) { obj.nid = nid; obj.action = "delete"; ds = obj.APP_ManageAppointment_new(); if (ds.Tables[0].Rows.Count > 0) { ResponseData(objGen.serilizeinJson(ds.Tables[0])); } else { ResponseData("[]"); } } else { ResponseError(); } }
public void PostTimeSheet(string EmpID, string AppLoginKey, string CompanyID, string nid, string taskdate, string projectid, string taskid, string hours, string description, string billable, string memo, string billrate, string payrate) { ClsTimeSheet objts = new ClsTimeSheet(); DataSet ds = new DataSet(); GeneralMethod objgen = new GeneralMethod(); if (checkAppKey(EmpID, AppLoginKey)) { objts.companyId = CompanyID; objts.nid = ""; objts.action = "insert"; objts.empid = EmpID; objts.projectid = projectid; objts.startdate = taskdate; objts.description = description; objts.hours = hours; objts.taskid = taskid; objts.Status = "Submitted"; objts.isbillable = billable; objts.keyword = memo; objts.billrate = billrate; objts.costrate = payrate; objts.ManageTimesheet(); ResponseData(@"[{""result"":""1"",""msg"":""Saved successfully""}]"); } else { ResponseError(); } }
public void ModifyAppointmentStatus(string EmpID, string AppLoginKey, string CompanyID, string nid, string newStatus) { ClsAppointment objts = new ClsAppointment(); DataSet ds = new DataSet(); GeneralMethod objgen = new GeneralMethod(); if (checkAppKey(EmpID, AppLoginKey)) { objts.empid = EmpID; objts.status = newStatus; objts.nid = nid; objts.action = "setstatus"; ds = objts.APP_ManageAppointment_new(); if (ds.Tables[0].Rows.Count > 0) { ResponseData(objGen.serilizeinJson(ds.Tables[1])); } else { ResponseData("[]"); } } else { ResponseError(); } }
public void GetAppointment(string EmpID, string UserType, string AppLoginKey, string CompanyID, string fromDate, string toDate, string status, string action) { ClsAppointment objts = new ClsAppointment(); DataSet ds = new DataSet(); GeneralMethod objgen = new GeneralMethod(); if (checkAppKey(EmpID, AppLoginKey)) { objts.nid = ""; objts.action = "selectforApp"; objts.companyid = CompanyID; objts.fromdate = fromDate; objts.todate = toDate; objts.empid = EmpID; objts.desig = action; objts.status = status; ds = objts.APP_ManageAppointment_new(); if (ds.Tables[0].Rows.Count > 0) { ResponseData(objGen.serilizeinJson(ds.Tables[0])); } else { ResponseData("[]"); } } else { ResponseError(); } }
public void DeleteSchedule(string EmpID, string AppLoginKey, string CompanyID, string nid) { ClsTimeSheet objts = new ClsTimeSheet(); DataSet ds = new DataSet(); GeneralMethod objgen = new GeneralMethod(); if (checkAppKey(EmpID, AppLoginKey)) { empTimeSheet.DataClasses.BAL.ClsScheduleBAL objSch = new empTimeSheet.DataClasses.BAL.ClsScheduleBAL(); objts.nid = nid; objts.action = "deleteGRpup"; objts.companyId = CompanyID; ds = objts.schedule(); if (ds.Tables[0].Rows.Count > 0) { ResponseData(objGen.serilizeinJson(ds.Tables[0])); } else { ResponseData("[]"); } } else { ResponseError(); } }
protected void bindheader() { string str = ""; string Companyname = Session["companyname"].ToString(); string companyaddress = Session["companyaddress"].ToString(); string headerstr = "<table width='100%'>"; str = headerstr + @" <tr><td style='width:70%;'></td><td style='width:30%;border:solid 2px #1caf9a;'> <h3> Invoice List </h3></td></tr><tr><td height='10'> </td></tr> <tr><td style='width:70%;'> <h2> " + Companyname + @" </h2> </td><td align='right' style='font-size:11px;'>Printed on: " + GeneralMethod.getLocalDateTime() + @"</td></tr> <tr><td> <h5> " + companyaddress + @" </h5> </td></tr> <tr><td style='width:70%;' height='10'> </td><td style='width:30%;'></td></tr></table>"; Session["header"] = str; Session["css"] = "invlist"; }
public static string saveEmpAvailability(string nid, string empid, string aDate, string afrmDate, string aToDate) { string msg = "failure"; GeneralMethod objgen = new GeneralMethod(); DataSet ds = new DataSet(); ClsAppointment obj = new ClsAppointment(); string[] nid1 = nid.Split('#'); string[] aDate1 = aDate.Split('#'); string[] afrmDate1 = afrmDate.Split('#'); string[] aToDate1 = aToDate.Split('#'); try { for (int i = 0; i < aDate1.Length; i++) { if (aDate1[i] != "") { obj.empid = empid; obj.aDate = aDate1[i]; obj.afrmTime = afrmDate1[i]; obj.aToTime = aToDate1[i]; obj.nid = nid1[i]; obj.action = "insert"; ds = obj.APP_ManageAvailability(); } } msg = "1"; return(msg); } catch { return(msg); } }
/// <summary> /// Desc: Method is used for validate Home Page /// Validation Point : CCS Dashboard Filter Icon /// </summary> /// <param name="testData"></param> public void HomePage_FilterIcon(Dictionary <string, string> testData) { try { PageLoadWait(100); row = getElements("xpath", "//div[contains(@class,'k-grid-aria-root')]//descendant::tr/th"); // Filter Icon List IList <IWebElement> list = getElements("xpath", "//*[@class='k-grid-header-wrap']//descendant::tr/th//span[contains(@class,'k-icon k-i-filter')]"); int size = row.Count; var flag = 0; for (int i = 0; i <= size; i++) { string HaderName = testData["Dashboard_PageFilterIcon"]; if (HaderName.Equals(row.ElementAt(i).Text)) { ExtentTestManager._parentTest.Log(Status.Pass, "Web Element is visible hence Expected condition is met : " + HaderName); flag = flag + 1; list.ElementAt(i).Click(); ExtentTestManager._parentTest.Log(Status.Pass, "Web Element is visible hence Expected condition is met Automation clicked : " + HaderName + " Filter Icon"); SendKeysForElement("xpath", "//kendo-grid-string-filter-menu-input[1]/kendo-grid-filter-menu-input-wrapper/input", testData["Dashboard_filterIteamName"], "Test Data passed"); ClickOnElementWhenElementFound("xpath", "//*[@class='k-button k-primary']", "Click on Filter button"); break; } else if (HaderName.Equals(row.ElementAt(i).Text)) { ExtentTestManager._parentTest.Log(Status.Pass, "Web Element is visible hence Expected condition is met : " + HaderName); flag = flag + 1; list.ElementAt(i).Click(); ExtentTestManager._parentTest.Log(Status.Pass, "Web Element is visible hence Expected condition is met Automation clicked : " + HaderName + " Filter Icon"); SendKeysForElement("xpath", "//kendo-grid-string-filter-menu-input[1]/kendo-grid-filter-menu-input-wrapper/input", testData["Dashboard_filterIteamName"], "Test Data passed"); ClickOnElementWhenElementFound("xpath", "//*[@class='k-button k-primary']", "Click on Filter button"); break; } else if (HaderName.Equals(row.ElementAt(i).Text)) { ExtentTestManager._parentTest.Log(Status.Pass, "Web Element is visible hence Expected condition is met : " + HaderName); flag = flag + 1; list.ElementAt(i).Click(); ExtentTestManager._parentTest.Log(Status.Pass, "Web Element is visible hence Expected condition is met Automation clicked : " + HaderName + " Filter Icon"); SendKeysForElement("xpath", "//kendo-grid-string-filter-menu-input[1]/kendo-grid-filter-menu-input-wrapper/input", testData["Dashboard_filterIteamName"], "Test Data passed"); ClickOnElementWhenElementFound("xpath", "//*[@class='k-button k-primary']", "Click on Filter button"); break; } else if (HaderName.Equals(row.ElementAt(i).Text)) { ExtentTestManager._parentTest.Log(Status.Pass, "Web Element is visible hence Expected condition is met : " + HaderName); flag = flag + 1; list.ElementAt(i).Click(); ExtentTestManager._parentTest.Log(Status.Pass, "Web Element is visible hence Expected condition is met Automation clicked : " + HaderName + " Filter Icon"); SendKeysForElement("xpath", "//kendo-grid-string-filter-menu-input[1]/kendo-grid-filter-menu-input-wrapper/input", testData["Dashboard_filterIteamName"], "Test Data passed"); ClickOnElementWhenElementFound("xpath", "//*[@class='k-button k-primary']", "Click on Filter button"); break; } } } catch (Exception ex) { GeneralMethod.ScreenShotCapture(); Assert.Fail(ex.Message); } }
// <summary> /// Save New Assigned task /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnsubmit_Click(object sender, EventArgs e) { objpayroll.nid = hidid.Value; objpayroll.Date = txtleavedate.Text; objpayroll.NumofDays = txtnoofdays.Text; objpayroll.Description = txtdescription.Text; objpayroll.Leavetypeid = ddlleavetype.Text; if (objpayroll.Leavetypeid == "4" || objpayroll.Leavetypeid == "5" || objpayroll.Leavetypeid == "6") { hidtodate.Value = txtleavedate.Text; objpayroll.NumofDays = "1"; } objpayroll.Empid = Session["userid"].ToString(); objpayroll.Createdby = Session["userid"].ToString(); //Used RequestDate parameter for LeaveToDate here objpayroll.RequestDate = hidtodate.Value; objpayroll.action = "insert"; objpayroll.companyid = Session["companyid"].ToString(); ds = objpayroll.LeaveRequest(); sendemail(ds.Tables[0].Rows[0]["nid"].ToString()); blank(); fillgrid(); if (hidid.Value == "") { GeneralMethod.alert(this.Page, "Leave Request Sent Successfully."); } else { GeneralMethod.alert(this.Page, "Leave Request modified Successfully."); } updatePanelAssign.Update(); }
/// <summary> /// Desc: Method validate Grid of change Request /// </summary> /// <param name="testData"></param> public void HaderforChangeRequest(Dictionary <string, string> testData) { try { PdfandExcelIconforChangeRequest(testData); string HaderName = getElement("xpath", "//div[contains(@class,'titleLeft')]").Text; if (HaderName.Contains("Change Request Log")) { ExtentTestManager._parentTest.Log(Status.Pass, "Expected matched with actual - " + HaderName); row = getElements("xpath", "//*[@class='k-grid-header-wrap']//descendant::tr/th//a[contains(@class,'k-link ng-star-inserted')]"); int size = row.Count; for (int i = 1; i <= size; i++) { string[] HaderNames = { "Contract", "Request ID", "Lead CCM", "Request Category", "Request Type", "Status", "Request Date", "Target Date" }; string HeaderName = HaderNames[i - 1]; AssertAreEqual("xpath", "//*[@class='k-grid-header-wrap']//descendant::tr/th[" + i + "]//a[contains(@class,'k-link ng-star-inserted')]", HeaderName); } } else { ExtentTestManager._parentTest.Log(Status.Fail, "Expected not matched with actual : " + HaderName); GeneralMethod.ScreenShotCapture(); } } catch (Exception ex) { GeneralMethod.ScreenShotCapture(); ExtentTestManager._parentTest.Log(Status.Fail, "Expected not matched " + ex.Message); Assert.Fail(ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { DataAccess objda = new DataAccess(); GeneralMethod objgen = new GeneralMethod(); objgen.validatelogin(); if (!Page.IsPostBack) { System.Data.DataSet ds = new System.Data.DataSet(); objda.id = Session["userid"].ToString(); ds = objda.getUserInRoles(); fillemployee(); fillclients(); if (Session["usertype"].ToString() != "Admin") { if (!objda.validatedRoles("5", ds) && !objda.validatedRoles("6", ds)) { Response.Redirect("UserDashboard.aspx"); } if (objda.validatedRoles("5", ds)) { ViewState["add"] = "1"; } else { ViewState["add"] = null; } } else { ViewState["add"] = "1"; } } }
public static string TimesheetforDashboard(string empid, string companyid, string lastnid, string nid) { ClsTimeSheet objts = new ClsTimeSheet(); GeneralMethod objgen = new GeneralMethod(); DataSet ds = new DataSet(); string msg = "failure"; try { objts.action = "select"; objts.empid = empid; objts.nid = nid; objts.companyId = companyid; objts.id = lastnid; ds = objts.TimesheetforDashboard(); msg = objgen.serilizeinJson(ds.Tables[0]); return(msg); } catch (Exception ex) { //msg = ex.Message.ToString(); return(msg); } }
public static string changeStatus(string companyid, string nid, string action, string empid, string projectid, string groupid, string newdate, string status, string remark, string createdby) { ClsTimeSheet objts = new ClsTimeSheet(); DataSet ds = new DataSet(); GeneralMethod objgen = new GeneralMethod(); ClsScheduleBAL objSch = new ClsScheduleBAL(); objts.projectid = projectid; objts.groupid = groupid; objts.empid = empid; objts.date = newdate; objts.remark = remark; objts.Status = status; objts.companyId = companyid; objts.nid = nid; if (action == "one") { objts.action = "setstatus"; } else { objts.action = "setgroupstatus"; } ds = objts.schedule(); string result = ""; result = objgen.serilizeinJson(ds.Tables[0]); return(result); }
/// <summary> /// Save New Assigned task /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnsubmit_Click(object sender, EventArgs e) { objts.taskid = hidclients.Value; objts.name = txtgroup.Text; objts.companyId = Session["companyid"].ToString(); objts.CreatedBy = Session["userid"].ToString(); objts.nid = hidid.Value; objts.action = "insert"; ds = objts.ManageExpenseGroup(); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0][0].ToString() == "failure") { GeneralMethod.alert(this, "Group title alreay exists, please try again!"); ScriptManager.RegisterStartupScript(this, GetType(), "key", "<script type='text/javascript'>opendiv();</script>", false); txtgroup.Focus(); return; } GeneralMethod.alert(this, "Saved successfully"); blank(); fillpopexpense(); searchdata(); // updatePanelAssign.Update(); } }
protected void btnsubmit_Click(object sender, EventArgs e) { objda.nid = hidid.Value; objda.companyId = Session["companyid"].ToString(); objda.action = "checkexist"; objda.CategoryID = txtcode.Text; objda.CategoryName = txtname.Text; ds = objda.AssetCategory(); if (ds.Tables[0].Rows.Count > 0) { GeneralMethod.alert(this.Page, "Category Code already exists!"); return; } objda.action = "insert"; objda.nid = hidid.Value; objda.CategoryID = txtcode.Text; objda.CategoryName = txtname.Text; objda.CategoryDesc = txtdes.Text; objda.ParentId = ""; ds = objda.AssetCategory(); fillCategory(); fillgrid(); blank(); GeneralMethod.alert(this.Page, "Saved Successfully!"); }
protected void Page_Load(object sender, EventArgs e) { GeneralMethod objgen = new GeneralMethod(); objgen.validatelogin(); if (Session["usertype"].ToString() != "Admin") { Response.Redirect("UserDashboard.aspx"); } objda.id = Session["userid"].ToString(); ds = objda.getUserInRoles(); if (objda.checkUserInroles("99")) { Dashboard_hidAddEvent.Value = "1"; } if (objda.checkUserInroles("100")) { Dashboard_hidAddPEvent.Value = "1"; } if (!IsPostBack) { bindlayer(); } }
/// <summary> /// Desc: Method validate Bulk change Grid /// </summary> /// <param name="testData"></param> public void BulkchangeGrid(Dictionary <string, string> testData) { try { WaitforElementbool(20, 250, "//kendo-dropdownlist[contains(@name,'mt')]//span[contains(@class,'k-input')]"); var kendoElement_Action = getElement("xpath", "//kendo-dropdownlist[@name='a']//span[contains(@class,'k-i-arrow-s k-icon')]"); IWebElement currentItem_Action = kendoElement_Action.FindElement(By.XPath("//*[contains(@name,'a')]//*[contains(@class,'k-dropdown-wrap k-state-default')]")); while (currentItem_Action.Text != testData["Dropdown_Action"]) { currentItem_Action.SendKeys(Keys.ArrowDown); ExtentTestManager._parentTest.Log(Status.Pass, "Expected Contract Type Matched " + testData["Dropdown_ContractType"] + " Automation selected the data "); } var kendoElement_ObligationMT = getElement("xpath", "//kendo-dropdownlist[@name='mt']//span[contains(@class,'k-i-arrow-s k-icon')]"); IWebElement currentItem_ObligationMT = kendoElement_ObligationMT.FindElement(By.XPath("//*[contains(@name,'mt')]//*[contains(@class,'k-dropdown-wrap k-state-default')]")); while (currentItem_ObligationMT.Text != testData["Dropdown_ObligationMT"]) { currentItem_ObligationMT.SendKeys(Keys.ArrowDown); ExtentTestManager._parentTest.Log(Status.Pass, "Expected Contract Type Matched " + testData["Dropdown_ContractType"] + " Automation selected the data "); } //Obligation Management Type WaitforElement_Visibility(20, 250, "//button[contains(@class,'btn btn-dark')]"); WaitforElement_ExpectedConditions(20, 250, "//button[contains(@class,'btn btn-dark')]"); ClickOnElementWhenElementFound("xpath", "//button[contains(@class,'btn btn-dark')]", "Search button"); PDFandExcelIcon_Bulk(testData); PageSort(testData, "xpath", "//*[contains(@class,'k-grid-content k-virtual-content')]//descendant::tr/td[1]", "xpath", "//*[contains(@class,'k-grid-header-wrap')]//descendant::tr/th[2]//a[@class='k-link ng-star-inserted']"); WaitforElementbool(20, 250, "//span[contains(@class,'k-icon k-i-seek-w')]"); Pagination(testData, "xpath", "//*[contains(@class,'ng-star-inserted')]//descendant::ul/li"); } catch (Exception ex) { GeneralMethod.ScreenShotCapture(); ExtentTestManager._parentTest.Log(Status.Fail, "Expected not matched " + ex.Message); Assert.Fail(ex.Message); } }
public static string getinvoicedetailbyinvoicenumber(string invoicenum, string companyid, string recordtype) { ClsTimeSheet objts = new ClsTimeSheet(); GeneralMethod objgen = new GeneralMethod(); DataSet ds = new DataSet(); string msg = "failure"; try { if (recordtype == "nid") { objts.nid = invoicenum; objts.invoiceno = ""; } else { objts.nid = ""; objts.invoiceno = invoicenum; } objts.companyId = companyid; objts.action = "selectinvoicebynumber"; ds = objts.GetInvoice(); msg = objgen.serilizeinJson(ds.Tables[0]); return(msg); } catch (Exception ex) { //msg = ex.Message.ToString(); return(msg); } }
static ExtentManager() { try { //ExtentTestManager._parentTest.Log(Status.Info, "Opening browser- " + bType); string OS = ConfigurationManager.AppSettings["OS"].ToString(); string HostName = ConfigurationManager.AppSettings["HostName"].ToString(); string Environment = ConfigurationManager.AppSettings["Environment"].ToString(); string UserName = ConfigurationManager.AppSettings["UserName"].ToString(); DirectoryInfo dirScreenshotPath = new DirectoryInfo(GeneralMethod.GetScreenshotPath()); foreach (FileInfo fi in dirScreenshotPath.GetFiles()) { fi.Delete(); } var htmlReporter = new ExtentHtmlReporter(GeneralMethod.GetReportPath()); htmlReporter.Configuration().ChartLocation = ChartLocation.Bottom; htmlReporter.Configuration().ChartVisibilityOnOpen = true; htmlReporter.Configuration().DocumentTitle = "Extent/NUnit Samples"; htmlReporter.Configuration().ReportName = "Extent/NUnit Samples"; htmlReporter.Configuration().Theme = Theme.Standard; Instance.AttachReporter(htmlReporter); Instance.AddSystemInfo("os", OS); Instance.AddSystemInfo("Host Name", HostName); Instance.AddSystemInfo("Environment", Environment); Instance.AddSystemInfo("User Name", UserName); } catch (Exception e) { throw; } }
protected void Page_Load(object sender, EventArgs e) { objgen.validatelogin(); if (!IsPostBack) { if (!objda.checkUserInroles("84") && !objda.checkUserInroles("70")) { Response.Redirect("UserDashboard.aspx"); } txtfrmdate.Text = Convert.ToDateTime(GeneralMethod.getLocalDate()).AddDays(-7).ToString("MM/dd/yyyy"); txttodate.Text = GeneralMethod.getLocalDate(); if (Request.QueryString["report"] != null) { reportname.Text = Request.QueryString["report"].ToString(); } if (Request.QueryString["reportname"] != null) { reportname1.Text = Request.QueryString["reportname"].ToString(); } fillemployee(); fillclient(); fillproject(); fillmanager(); } }
public void GetTodaySchedule(string EmpID, string AppLoginKey, string CompanyID, string TodayDate) { ClsTimeSheet objts = new ClsTimeSheet(); DataSet ds = new DataSet(); GeneralMethod objgen = new GeneralMethod(); if (checkAppKey(EmpID, AppLoginKey)) { empTimeSheet.DataClasses.BAL.ClsScheduleBAL objSch = new empTimeSheet.DataClasses.BAL.ClsScheduleBAL(); objts.nid = ""; objts.action = "selectgroup"; objts.companyId = CompanyID; objts.from = TodayDate; objts.to = TodayDate; objts.clientid = ""; objts.projectid = ""; objts.empid = EmpID; objts.Status = ""; objts.remark = ""; ds = objts.schedule(); if (ds.Tables[0].Rows.Count > 0) { ResponseData(objGen.serilizeinJson(ds.Tables[0])); } else { ResponseData("[]"); } } else { ResponseError(); } }