public string[] GetEmployeeHealthList(string prefixText, int count) { Dbutility ObjDbutility = new Dbutility(); int intCheckCount = 1; string strvalue = count.ToString().Replace("000", "~"); string[] intvalue = strvalue.Trim().Split('~'); List <string> items = new List <string>(count); SqlDataReader rdrValue = ObjDbutility.BindReader("SELECT (PEM.FirstName+' '+PEM.MiddleName+' '+PEM.LastName) +' # '+PEM.EmployeeCode FROM PRLEmployeeMaster PEM " + " WHERE EmployeeStatus='N' AND PEM.SchoolID= " + intvalue[0] + " AND (PEM.FirstName+' '+PEM.MiddleName+' '+PEM.LastName) like '" + prefixText + "%' Order By PEM.FirstName+' '+PEM.MiddleName+' '+PEM.LastName"); while (rdrValue.Read()) { if (intCheckCount <= 20) { items.Add(Convert.ToString(rdrValue.GetValue(0))); } else { break; } intCheckCount++; } rdrValue.Close(); return(items.ToArray()); }
public string[] GetMqualfication(string prefixText, int count) { //Archana Dbutility ObjDbutility = new Dbutility(); int intCheckCount = 1; string strvalue = count.ToString().Replace("000", "~"); string[] intvalue = strvalue.Trim().Split('~'); List <string> items = new List <string>(count); SqlDataReader rdrValue = ObjDbutility.BindReader("SELECT PQualificationName1,PQualificationID FROM MTPqualificationmaster WHERE PQualificationName1 LIKE '" + prefixText + "%' ORDER BY PQualificationName1"); while (rdrValue.Read()) { if (intCheckCount <= 20) { items.Add(Convert.ToString(rdrValue.GetValue(0))); } else { break; } //return items.ToArray(); intCheckCount++; } rdrValue.Close(); return(items.ToArray()); }
public string[] GetParentList(string prefixText, int count) { //Archana Dbutility ObjDbutility = new Dbutility(); int intCheckCount = 1; string strvalue = count.ToString().Replace("000", "~"); string[] intvalue = strvalue.Trim().Split('~'); List <string> items = new List <string>(count); SqlDataReader rdrValue = ObjDbutility.BindReader("SELECT DISTINCT FatherName+'#'+MotherName+'#'+CASt(SM.ParentID AS VARCHAR),SM.ParentID FROM SIStudentMaster SM INNER JOIN SISTudentYearWIseDetails YD ON SM.StudentID=YD.StudentID INNER JOIN SIStudentFatherDetails SFD ON YD.StudentID=SFD.StudentID INNER JOIN SIStudentMotherDetails SMD ON YD.StudentID=SMD.StudentID WHERE SM.SchoolId=" + intvalue[0] + " AND YD.AcaStart=" + intvalue[1] + " AND FatherName LIKE '" + prefixText + "%' "); while (rdrValue.Read()) { if (intCheckCount <= 20) { items.Add(Convert.ToString(rdrValue.GetValue(0))); } else { break; } //return items.ToArray(); intCheckCount++; } rdrValue.Close(); return(items.ToArray()); }
public string[] GetStream(string prefixText, int count) { Dbutility ObjDbutility = new Dbutility(); int intCheckCount = 1; List <string> items = new List <string>(count); SqlDataReader rdrValue = ObjDbutility.BindReader("SELECT STCD.Stream,0 FROM SIStudentTCDetails STCD " + " INNER JOIN SIStudentYearWiseDetails SYWD ON SYWD.StudentID=STCD.StudentID AND SYWD.AcaStart=STCD.AcaStart " + " WHERE SYWD.SchoolID=" + count + " AND STCD.Stream like '" + prefixText + "%'" + " GROUP BY STCD.Stream ORDER BY STCD.Stream "); while (rdrValue.Read()) { if (intCheckCount <= 20) { items.Add(Convert.ToString(rdrValue.GetValue(0))); } else { break; } //return items.ToArray(); intCheckCount++; } rdrValue.Close(); return(items.ToArray()); }
public string[] GetEmployeeDetails(string prefixText, int count) { Dbutility ObjDbutility = new Dbutility(); int intCheckCount = 1; string strvalue = count.ToString().Replace("000", "~"); string[] intvalue = strvalue.Trim().Split('~'); List <string> items = new List <string>(count); SqlDataReader rdrValue = ObjDbutility.BindReader("Select (PRL.FirstName+' '+PRL.MiddleName+' '+PRL.LastName)+' # '+PRL.EmployeeCode From PRLEmployeeMaster PRL" + " Where SchoolID=" + intvalue[0] + " AND PRL.EmployeeStatus='N' AND (PRL.FirstName+' '+PRL.MiddleName+' '+PRL.LastName) like '" + prefixText + "%' "); while (rdrValue.Read()) { if (intCheckCount <= 20) { items.Add(Convert.ToString(rdrValue.GetValue(0))); } else { break; } //return items.ToArray(); intCheckCount++; } rdrValue.Close(); return(items.ToArray()); }
public string[] GetCompletionList(string prefixText, int count, string contextKey) { Dbutility ObjDbutility = new Dbutility(); int intCheckCount = 1; string strvalue = count.ToString().Replace("000", "~"); string[] intvalue = strvalue.Trim().Split('~'); List <string> items = new List <string>(count); SqlDataReader rdrValue = ObjDbutility.BindReader("SELECT (SM.FirstName+' '+SM.MiddleName+' '+SM.LastName) +' # '+SYD.AdmissionNo +' # '+ClassName+'-'+SectionName from StudentDetails SM " + " INNER JOIN StudentYearWiseDetails SYD ON SM.StudentID=SYD.StudentID INNER JOIN ClassSetting MCM ON MCM.ClassID=SYD.ClassID INNER JOIN SectionSetting MSM ON MSM.SectionID=SYD.SectionID" + " WHERE SYD.AcaStart=" + HttpContext.Current.Session["AcaStart"] + " AND SYD.SchoolID=" + HttpContext.Current.Session["SchoolID"] + " AND (SM.FirstName+' '+SM.MiddleName+' '+SM.LastName) like '" + prefixText + "%'"); //SqlDataReader rdrValue = ObjDbutility.BindReader("select firstName, StudentId from StudentDetails where firstName like '" + prefixText + "%'"); while (rdrValue.Read()) { if (intCheckCount <= 20) { items.Add(Convert.ToString(rdrValue.GetValue(0))); } else { break; } //return items.ToArray(); intCheckCount++; } rdrValue.Close(); return(items.ToArray()); }
public string[] GetPerCityList(string prefixText, int count) { //Manju Dbutility ObjDbutility = new Dbutility(); int intCheckCount = 1; string strvalue = count.ToString().Replace("000", "~"); string[] intvalue = strvalue.Trim().Split('~'); List <string> items = new List <string>(count); SqlDataReader rdrValue = ObjDbutility.BindReader("SELECT CityName1,CityID FROM MTCityMaster WHERE CityName1 LIKE '" + prefixText + "%'"); while (rdrValue.Read()) { if (intCheckCount <= 20) { items.Add(Convert.ToString(rdrValue.GetValue(0))); } else { break; } //return items.ToArray(); intCheckCount++; } rdrValue.Close(); return(items.ToArray()); }
public string[] GetHLStudentList(string prefixText, int count) { //Senthil Dbutility ObjDbutility = new Dbutility(); int intCheckCount = 1; string strvalue = count.ToString().Replace("000", "~"); string[] intvalue = strvalue.Trim().Split('~'); List <string> items = new List <string>(count); SqlDataReader rdrValue = ObjDbutility.BindReader("SELECT (SM.FirstName+' '+SM.MiddleName+' '+SM.LastName) +' # '+SYD.AdmissionNo FROM SIStudentMaster SM " + " INNER JOIN SIStudentYearWiseDetails SYD ON SM.StudentID=SYD.StudentID " + " WHERE SYD.StudentStatus='S' AND SYD.AcaStart=" + intvalue[1] + " AND SYD.SchoolID=" + intvalue[0] + " AND (SM.FirstName+' '+SM.MiddleName+' '+SM.LastName) like '" + prefixText + "%'"); while (rdrValue.Read()) { if (intCheckCount <= 20) { items.Add(Convert.ToString(rdrValue.GetValue(0))); } else { break; } //return items.ToArray(); intCheckCount++; } rdrValue.Close(); return(items.ToArray()); }
public string[] GetStudentListTC(string prefixText, int count) { Dbutility ObjDbutility = new Dbutility(); int intCheckCount = 1; string SQLQuery; string strvalue = count.ToString().Replace("000", "~"); string[] intvalue = strvalue.Trim().Split('~'); List <string> items = new List <string>(count); SQLQuery = "SELECT DISTINCT Replace((SIM.FirstName+' '+SIM.MiddleName+' '+SIM.LastName),' ',' ')+'#'+CAST(SYD.AdmissionNo AS VARCHAR),SIM.ParentID FROM SIStudentTCDetails TC " + " INNER JOIN SIStudentYearWiseDetails SYD ON SYD.StudentID=TC.StudentID AND TC.AcaStart=SYD.AcaStart INNER JOIN SIStudentMaster SIM ON SIM.StudentID=SYD.StudentID " + " WHERE SYD.StudentStatus='T' AND SYD.SchoolID=" + intvalue[0] + " AND SYD.AcaStart=" + intvalue[1] + " AND SIM.FirstName LIKE '" + prefixText + "%' "; SqlDataReader rdrValue = ObjDbutility.BindReader(SQLQuery); while (rdrValue.Read()) { if (intCheckCount <= 20) { items.Add(Convert.ToString(rdrValue.GetValue(0))); } else { break; } intCheckCount++; } rdrValue.Close(); return(items.ToArray()); }
//Upload image to database protected void btnSubmit_Click(object sender, EventArgs e) { System.Drawing.Image imag = System.Drawing.Image.FromStream(flImage.PostedFile.InputStream); System.Data.SqlClient.SqlConnection conn = null; try { try { Dbutility objDbutility = new Dbutility(); string ConnectionString = objDbutility.ReturnConnectionString();;// ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; conn = new System.Data.SqlClient.SqlConnection(ConnectionString); conn.Open(); System.Data.SqlClient.SqlCommand insertCommand = new System.Data.SqlClient.SqlCommand("Insert into [msg] (msgid, pic1) Values (1, @Pic)", conn); insertCommand.Parameters.Add("Pic", SqlDbType.Image, 0).Value = ConvertImageToByteArray(imag, System.Drawing.Imaging.ImageFormat.Jpeg); int queryResult = insertCommand.ExecuteNonQuery(); if (queryResult == 1) { lblRes.Text = "msg record Created Successfully"; } } catch (Exception ex) { lblRes.Text = "Error: " + ex.Message; } } finally { if (conn != null) { conn.Close(); } } }
public string[] GetdAffNo(string prefixText, int count) { Dbutility ObjDbutility = new Dbutility(); int intCheckCount = 1; string strvalue = count.ToString().Replace("000", "~"); string[] intvalue = strvalue.Trim().Split('~'); List <string> items = new List <string>(count); SqlDataReader rdrValue = ObjDbutility.BindReader("SELECT Affiliation FROM MTInstitutionMaster WHERE Affiliation LIKE '" + prefixText + "%' AND Affiliation<>'' "); while (rdrValue.Read()) { if (intCheckCount <= 20) { items.Add(Convert.ToString(rdrValue.GetValue(0))); } else { break; } intCheckCount++; } rdrValue.Close(); return(items.ToArray()); }
public string[] GetPDName(string prefixText, int count) { Dbutility ObjDbutility = new Dbutility(); int intCheckCount = 1; string strvalue = count.ToString().Replace("000", "~"); string[] intvalue = strvalue.Trim().Split('~'); List <string> items = new List <string>(count); SqlDataReader rdrValue = ObjDbutility.BindReader("SELECT FirstName+' '+MiddleName+' '+LastName+' # '+" + " ISNULL(AdmissionNo,0)AS StudentName,SM.StudentID FROM SIStudentMaster SM " + " INNER JOIN SIStudentYearWiseDetails SYD ON SM.StudentID=SYD.StudentID " + " WHERE FirstName+' '+MiddleName+' '+LastName+' # '+ ISNULL(AdmissionNo,0) " + " LIKE '" + prefixText + "%' AND " + " SM.StudentID IN (SELECT StudentID FROM SIStudentYearWIseDetails WHERE AcaStart=" + intvalue[1] + " AND SchoolID=" + intvalue[0] + " AND StudentID NOT " + " IN (SELECT StudentID FROM SIStudentYearWiseDetails WHERE AcaStart IN " + " (SELECT AcaStart FROM MTAcademicSessionMaster WHERE AcaStart> " + " (SELECT AcaStart FROM MTAcademicSessionMaster WHERE AcaStart=" + intvalue[1] + ")))) GROUP BY SM.StudentID,SM.FirstName,SM.MiddleName,SM.LastName,SYD.AdmissionNo ORDER BY FirstName+' '+MiddleName+' '+LastName+' '+ ISNULL(AdmissionNo,0) "); while (rdrValue.Read()) { if (intCheckCount <= 20) { items.Add(Convert.ToString(rdrValue.GetValue(0))); } else { break; } intCheckCount++; } rdrValue.Close(); return(items.ToArray()); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { MembershipUser user = Membership.GetUser(); if (user != null) { this.objClientMasterDT = this.objClientMasterBll.GetDataByUsername(user.ToString()); if (this.objClientMasterDT.Rows.Count > 0) { query = this.objClientMasterDT.Rows[0]["CompanyID"].ToString(); } else { this.objCompanyClientContactDetailDT = this.objCompanyClientContactDetailBll.GetDataByUsername(user.ToString()); if (this.objCompanyClientContactDetailDT.Rows.Count > 0) { query = this.objCompanyClientContactDetailDT.Rows[0]["CompanyID"].ToString(); } } SetCompanyLogo(query); } if (Request.UrlReferrer != null) { query = HttpUtility.ParseQueryString(Request.UrlReferrer.Query)["Status"]; if (query.ToLower() == "success") { query = HttpUtility.ParseQueryString(Request.UrlReferrer.Query)["OrderNo"]; Dbutility dbutility = new Dbutility(); query = dbutility.ExecuteQuery("Update InvoiceMaster Set InvoiceStatus='paid' Where OrderNo='" + query + "'"); } } } }
protected void Page_Load(object sender, EventArgs e) { objDbutility = new Dbutility(); if (this.Master == null) { return; } ((HtmlControl)this.Master.FindControl("setting")).Attributes.Add("style", "background-color: lightgray;"); ((HtmlControl)this.Master.FindControl("ioSetting")).Attributes.Add("class", "active open"); MembershipUser user = Membership.GetUser(); if (user != null) { string str = user.ToString(); if (Roles.IsUserInRole(str, "Admin")) { this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(str); if (this.objCompanyLoginMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString(); } } } if (this.IsPostBack) { return; } this.SetCompanyRecords(this.hfCompanyID.Value); }
public string[] GetFSubLedger(string prefixText, int count) { //Atul Dbutility ObjDbutility = new Dbutility(); int intCheckCount = 1; string strvalue = count.ToString().Replace("000", "~"); string[] intvalue = strvalue.Trim().Split('~'); List <string> items = new List <string>(count); SqlDataReader rdrValue = ObjDbutility.BindReader("SELECT SubLedgerName,FASLCode from FASubLedgerMaster WHERE SubLedgerName LIKE '" + prefixText + "%'"); while (rdrValue.Read()) { if (intCheckCount <= 20) { items.Add(Convert.ToString(rdrValue.GetValue(0))); } else { break; } //return items.ToArray(); intCheckCount++; } rdrValue.Close(); return(items.ToArray()); }
public string[] GetRegistrationStudent(string prefixText, int count) { Dbutility ObjDbutility = new Dbutility(); int intCheckCount = 1; string strvalue = count.ToString().Replace("000", "~"); string[] intvalue = strvalue.Trim().Split('~'); List <string> items = new List <string>(count); SqlDataReader rdrValue = ObjDbutility.BindReader("SELECT ISNULL(FirstName,'') +' '+ ISNULL(MiddleName,'') +' '+ ISNULL(LastName,'') +' # '+ ISNULL(CAST(ReferenceNo AS NVARCHAR),'') AS StudentName,SM.ARStudentID FROM SRStudentMaster SM " + " WHERE SM.SchoolId=" + intvalue[0] + " AND SM.AcaStart=" + intvalue[1] + " " + " AND ISNULL(FirstName,'') +' '+ ISNULL(MiddleName,'') +' '+ ISNULL(LastName,'') +' # '+ ISNULL(CAST(ReferenceNo AS NVARCHAR),'') Like '" + prefixText + "%' ORDER BY FirstName"); while (rdrValue.Read()) { if (intCheckCount <= 20) { items.Add(Convert.ToString(rdrValue.GetValue(0))); } else { break; } intCheckCount++; } rdrValue.Close(); return(items.ToArray()); }
public string[] GetInformMediaList(string prefixText, int count) { //Archana Dbutility ObjDbutility = new Dbutility(); int intCheckCount = 1; string strvalue = count.ToString().Replace("000", "~"); string[] intvalue = strvalue.Trim().Split('~'); List <string> items = new List <string>(count); SqlDataReader rdrValue = ObjDbutility.BindReader("select distinct informmedia from HLNursingDetails where informmedia like '" + prefixText + "%'"); while (rdrValue.Read()) { if (intCheckCount <= 20) { items.Add(Convert.ToString(rdrValue.GetValue(0))); } else { break; } //return items.ToArray(); intCheckCount++; } rdrValue.Close(); return(items.ToArray()); }
public string[] GetModeOfFollowUp(string prefixText, int count) { Dbutility ObjDbutility = new Dbutility(); int intCheckCount = 1; string strvalue = count.ToString().Replace("000", "~"); string[] intvalue = strvalue.Trim().Split('~'); List <string> items = new List <string>(count); SqlDataReader rdrValue = ObjDbutility.BindReader("SELECT ModeofFollowup,ModeofFollowup AS ModeofFollowup1 FROM SRStudEnquiryFollowups " + " WHERE AcaStart=" + intvalue[1] + " AND SchoolId=" + intvalue[0] + " AND ModeofFollowup " + " LIKE '" + prefixText + "%' GROUP BY ModeofFollowup ORDER BY ModeofFollowup "); while (rdrValue.Read()) { if (intCheckCount <= 20) { items.Add(Convert.ToString(rdrValue.GetValue(0))); } else { break; } intCheckCount++; } rdrValue.Close(); return(items.ToArray()); }
public string[] GetEnquiryStudent(string prefixText, int count) { Dbutility ObjDbutility = new Dbutility(); int intCheckCount = 1; string strvalue = count.ToString().Replace("000", "~"); string[] intvalue = strvalue.Trim().Split('~'); List <string> items = new List <string>(count); SqlDataReader rdrValue = ObjDbutility.BindReader("SELECT ISNULL(FirstName,'') +' '+ ISNULL(MidName,'') +' '+ ISNULL(LastName,'') +' # '+ ISNULL(CAST(ApplicationNO As Varchar),'') AS StudentName,ApplicationNO " + " FROM srstudentenquiry WHERE SchoolID=" + intvalue[0] + " AND Acastart=" + intvalue[1] + " AND ISNULL(FirstName,'') +' '+ ISNULL(MidName,'') +' '+ ISNULL(LastName,'') +' # '+ ISNULL(CAST(ApplicationNO As Varchar),'') " + " Like '" + prefixText + "%' ORDER BY FirstName "); while (rdrValue.Read()) { if (intCheckCount <= 20) { items.Add(Convert.ToString(rdrValue.GetValue(0))); } else { break; } intCheckCount++; } rdrValue.Close(); return(items.ToArray()); }
public string[] GetUserParent(string prefixText, int count) { Dbutility ObjDbutility = new Dbutility(); int intCheckCount = 1; string strvalue = count.ToString().Replace("000", "~"); string[] intvalue = strvalue.Trim().Split('~'); List <string> items = new List <string>(count); SqlDataReader rdrValue = ObjDbutility.BindReader("SELECT UserID FROM MTUserMaster WHERE UserStatus = 'Y' AND UserID Like '" + prefixText + "%' ORDER BY UserID "); while (rdrValue.Read()) { if (intCheckCount <= 20) { items.Add(Convert.ToString(rdrValue.GetValue(0))); } else { break; } intCheckCount++; } rdrValue.Close(); return(items.ToArray()); }
public string[] GetUserName(string prefixText, int count) { Dbutility ObjDbutility = new Dbutility(); int intCheckCount = 1; string strvalue = count.ToString().Replace("000", "~"); string[] intvalue = strvalue.Trim().Split('~'); List <string> items = new List <string>(count); SqlDataReader rdrValue = ObjDbutility.BindReader("SELECT REPLACE(UserID,' ','')+' # '+ CAST(UID as VARCHAR) AS UserID FROM MTUserMaster WHERE UID IN(SELECT DISTINCT UID FROM MTUserLimitMaster WHERE ModuleID IN(18,19)) " + " AND UserStatus='Y' AND UserTypeID IN (0,1) AND UserID LIKE '" + prefixText + "%' ORDER BY UserID "); while (rdrValue.Read()) { if (intCheckCount <= 20) { items.Add(Convert.ToString(rdrValue.GetValue(0))); } else { break; } intCheckCount++; } rdrValue.Close(); return(items.ToArray()); }
protected void Page_Load(object sender, EventArgs e) { MembershipUser user = Membership.GetUser(); if (user != null) { string str = user.ToString(); if (Roles.IsUserInRole(str, "Admin")) { this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(str); if (this.objCompanyLoginMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString(); } } else if (Roles.IsUserInRole(str, "Employee")) { this.objStaffMasterDT = this.objStaffMasterBll.GetDataByStaffUserName(str); if (this.objStaffMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objStaffMasterDT.Rows[0]["CompanyID"].ToString(); } } Dbutility objDbutility = new Dbutility(); query = string.Format("SELECT CloudPackageID,CloudPackageName,CloudPackagePriceMonthly,CloudPackagePriceYearly,CloudPackageCurrency FROM CloudPackageMaster " + " Where CloudPackageID={0}", this.Request.QueryString["id"]); dtCloudPackageMaster = objDbutility.BindDataTable(query); if (dtCloudPackageMaster?.Rows.Count > 0) { hCloudPackageType.Value = Convert.ToString(dtCloudPackageMaster.Rows[0]["CloudPackageName"]); if (this.Request.QueryString["type"] == "M") { amount = Convert.ToString(dtCloudPackageMaster.Rows[0]["CloudPackagePriceMonthly"]); lblPaymentAmount.Text = String.Format("{0:0.00}", dtCloudPackageMaster.Rows[0]["CloudPackagePriceMonthly"]); } else { amount = Convert.ToString(dtCloudPackageMaster.Rows[0]["CloudPackagePriceMonthly"]); lblPaymentAmount.Text = String.Format("{0:0.00}", dtCloudPackageMaster.Rows[0]["CloudPackagePriceYearly"]); } lblPaymentAmount.Text = String.Format("{0} {1}", GetCurrency(Convert.ToString(dtCloudPackageMaster.Rows[0]["CloudPackageCurrency"])), lblPaymentAmount.Text); } } }
protected void Page_Load(object sender, EventArgs e) { objDbutility = new Dbutility(); if (this.Master == null) { return; } ((HtmlControl)this.Master.FindControl("clientProfile")).Attributes.Add("style", "background-color: lightgray;"); MembershipUser user = Membership.GetUser(); if (user != null) { this.objCompanyClientMasterDT = this.objCompanyClientMasterBll.GetDataByUsername(user.ToString()); if (this.objCompanyClientMasterDT.Rows.Count > 0) { this.hfClientID.Value = this.objCompanyClientMasterDT.Rows[0]["CompanyClientID"].ToString(); this.hfCompanyID.Value = this.objCompanyClientMasterDT.Rows[0]["CompanyID"].ToString(); this.pnlAddClient.Visible = true; this.ViewClientDetails(this.hfClientID.Value); } this.objCompanyClientContactDetailDT = this.objCompanyClientContactDetailBll.GetDataByUsername(user.ToString()); if (this.objCompanyClientContactDetailDT.Rows.Count > 0) { this.hfClientContactID.Value = this.objCompanyClientContactDetailDT.Rows[0]["CompanyClientContactID"].ToString(); this.hfClientID.Value = this.objCompanyClientContactDetailDT.Rows[0]["CompanyClientID"].ToString(); this.hfCompanyID.Value = this.objCompanyClientContactDetailDT.Rows[0]["CompanyID"].ToString(); this.pnlAddClient.Visible = false; this.ViewClientContactDetails(this.hfClientContactID.Value); } } if (this.IsPostBack) { return; } this.divUpdate.Visible = this.Session["updateProfile"] != null; this.Session["updateProfile"] = (object)null; this.Session.Abandon(); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { string invoiceId = InvoiceIOPayment.Decrypt(HttpUtility.UrlDecode(this.Request.QueryString["invoice"]), this.Request.QueryString["val"]); objInvoiceMasterDT = objInvoiceMasterBLL.GetDataByInvoiceID(Convert.ToInt32(invoiceId)); if (objInvoiceMasterDT?.Rows.Count > 0) { var request = (HttpWebRequest)WebRequest.Create("http://www.iopayer.com/iopg/IOPayerPaymentGateway.aspx"); string str = Convert.ToString(objInvoiceMasterDT.Rows[0]["CompanyID"]); if (!string.IsNullOrEmpty(str)) { Dbutility objDbutility = new Dbutility(); str = " Select ProductID,MerchantID,MerchantAuthkey,TransactionTypeID,TransactionAuthkey " + "From CompanyIOPayerMaster Where CompanyID=" + str; DataTable dtCompanyIOMaster = objDbutility.BindDataTable(str); if (dtCompanyIOMaster.Rows.Count > 0) { string MerchantID = Convert.ToString(dtCompanyIOMaster.Rows[0]["MerchantID"]); string ProductID = Convert.ToString(dtCompanyIOMaster.Rows[0]["ProductID"]); string TransactionTypeID = Convert.ToString(dtCompanyIOMaster.Rows[0]["TransactionTypeID"]); string MerchantAuthKey = Convert.ToString(dtCompanyIOMaster.Rows[0]["MerchantAuthkey"]); string TranAuthKey = Convert.ToString(dtCompanyIOMaster.Rows[0]["TransactionAuthkey"]); string ReturnURL = ConfigurationManager.AppSettings["SuccessClientURL"]; string ExtraParam1 = ""; string ExtraParam2 = ""; string ExtraParam3 = ""; string invoiceno = DateTime.Now.ToString("dd MM yyyy HH:mm:ss"); invoiceno = invoiceno.Replace(":", string.Empty); invoiceno = Regex.Replace(invoiceno, "\\s", string.Empty); invoiceno += Convert.ToString(objInvoiceMasterDT.Rows[0]["InvoiceNumber"]) + "BT"; str = "Update InvoiceMaster Set OrderNo='" + invoiceno + "' Where InvoiceID=" + invoiceId; objDbutility.ExecuteQuery(str); var postData = "MerchantID=" + Uri.EscapeDataString(MerchantID); postData += "&ProductID=" + Uri.EscapeDataString(ProductID); postData += "&TransactionTypeID=" + Uri.EscapeDataString(TransactionTypeID); postData += "&MerchantAuthKey=" + Uri.EscapeDataString(MerchantAuthKey); postData += "&TranAuthKey=" + Uri.EscapeDataString(TranAuthKey); postData += "&OrderAmount=" + Uri.EscapeDataString(Convert.ToString(objInvoiceMasterDT.Rows[0]["InvoiceTotal"])); postData += "&ReturnURL=" + Uri.EscapeDataString(ReturnURL); postData += "&OrderNo=" + Uri.EscapeDataString(invoiceno); postData += "&ExtraParam1=" + Uri.EscapeDataString(ExtraParam1); postData += "&ExtraParam2=" + Uri.EscapeDataString(ExtraParam2); postData += "&ExtraParam3=" + Uri.EscapeDataString(ExtraParam3); var data = Encoding.ASCII.GetBytes(postData); request.Method = "POST"; request.ContentType = "application/x-www-form-urlencoded"; request.ContentLength = data.Length; using (var stream = request.GetRequestStream()) { stream.Write(data, 0, data.Length); } Response.Clear(); var response = (HttpWebResponse)request.GetResponse(); var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd(); string strResultnew = responseString.Replace("./IOPayerPaymentGateway.aspx", "http://www.iopayer.com/iopg/IOPayerPaymentGateway.aspx"); Response.Write(strResultnew); return; } else { Response.Redirect("~/Client/InvoiceNoPayment.aspx?companyid=" + Convert.ToString(objInvoiceMasterDT.Rows[0]["CompanyID"])); } } } else { this.ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), "<script language=\"JavaScript\">" + "alert('Invoice details not found!');" + "</script>"); } } }
protected void Page_Load(object sender, EventArgs e) { if (this.Master == null) { return; } ((HtmlControl)this.Master.FindControl("generalMaster")).Attributes.Add("class", "active open"); ((HtmlControl)this.Master.FindControl("paymentGatewayIOPayer")).Attributes.Add("class", "active open"); objDbutility = new Dbutility(); if (!this.IsPostBack) { if (Admin.RoleName != null) { MembershipUser user = Membership.GetUser(); if (Admin.RoleName == "SuperAdmin") { PaymentGatewayIOPayer.AddStatus = "True"; PaymentGatewayIOPayer.EditStatus = "True"; PaymentGatewayIOPayer.ViewStatus = "True"; PaymentGatewayIOPayer.DeleteStatus = "True"; } else if (Admin.RoleName == "MasterAdmin") { if (user != null) { string str = user.ToString(); if (Roles.IsUserInRole(str, "MasterAdmin")) { this.objMasterAdminLoginMasterDT = this.objMasterAdminLoginMasterBll.GetDataByUserName(str); if (this.objMasterAdminLoginMasterDT.Rows.Count > 0) { this.hfMasterAdminID.Value = this.objMasterAdminLoginMasterDT.Rows[0]["MasterAdminUserID"].ToString(); } } } this.objMasterAdminRightsMasterDT = this.objMasterAdminRightsMasterBll.GetDataByViewPageRights(int.Parse(this.hfMasterAdminID.Value.Trim()), "PaymentGatewayIOPayer"); if (this.objMasterAdminRightsMasterDT.Rows.Count > 0) { PaymentGatewayIOPayer.AddStatus = this.objMasterAdminRightsMasterDT.Rows[0]["AddMode"].ToString(); PaymentGatewayIOPayer.EditStatus = this.objMasterAdminRightsMasterDT.Rows[0]["EditMode"].ToString(); PaymentGatewayIOPayer.ViewStatus = this.objMasterAdminRightsMasterDT.Rows[0]["ViewMode"].ToString(); PaymentGatewayIOPayer.DeleteStatus = this.objMasterAdminRightsMasterDT.Rows[0]["DeleteMode"].ToString(); } else { PaymentGatewayIOPayer.AddStatus = ""; PaymentGatewayIOPayer.EditStatus = ""; PaymentGatewayIOPayer.ViewStatus = ""; PaymentGatewayIOPayer.DeleteStatus = ""; } } else if (Admin.RoleName == "Admin") { if (user != null) { string str = user.ToString(); if (Roles.IsUserInRole(str, "Admin")) { this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(str); if (this.objCompanyLoginMasterDT.Rows.Count > 0) { this.hfCompanyID.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString(); this.hfCompanyLoginID.Value = this.objCompanyLoginMasterDT.Rows[0]["CompanyLoginID"].ToString(); } } } this.objCompanyAdminRightsMasterDT = this.objCompanyAdminRightsMasterBll.GetDataByViewPageRights(int.Parse(this.hfCompanyID.Value.Trim()), int.Parse(this.hfCompanyLoginID.Value.Trim()), "PaymentGatewayMaster"); if (this.objCompanyAdminRightsMasterDT.Rows.Count > 0) { PaymentGatewayIOPayer.AddStatus = this.objCompanyAdminRightsMasterDT.Rows[0]["AddMode"].ToString(); PaymentGatewayIOPayer.EditStatus = this.objCompanyAdminRightsMasterDT.Rows[0]["EditMode"].ToString(); PaymentGatewayIOPayer.ViewStatus = this.objCompanyAdminRightsMasterDT.Rows[0]["ViewMode"].ToString(); PaymentGatewayIOPayer.DeleteStatus = this.objCompanyAdminRightsMasterDT.Rows[0]["DeleteMode"].ToString(); } else { PaymentGatewayIOPayer.AddStatus = ""; PaymentGatewayIOPayer.EditStatus = ""; PaymentGatewayIOPayer.ViewStatus = ""; PaymentGatewayIOPayer.DeleteStatus = ""; } } else { PaymentGatewayIOPayer.AddStatus = ""; PaymentGatewayIOPayer.EditStatus = ""; PaymentGatewayIOPayer.ViewStatus = ""; PaymentGatewayIOPayer.DeleteStatus = ""; } } if (PaymentGatewayIOPayer.ViewStatus == "True") { if (this.Request.QueryString["cmd"] != null) { switch (this.Request.QueryString["cmd"]) { case "view": if (this.Request.QueryString["ID"] == null || !(PaymentGatewayIOPayer.ViewStatus == "True")) { break; } string i = this.Request.QueryString["ID"]; this.pnlViewAll.Visible = false; this.pnlAdd.Visible = false; this.pnlView.Visible = true; this.ViewRecord(i); this.btnEdit.Visible = PaymentGatewayIOPayer.EditStatus == "True"; this.btnAddPaymentGateway.Visible = this.btnAdd.Visible = PaymentGatewayIOPayer.AddStatus == "True"; this.btnDelete.Visible = PaymentGatewayIOPayer.DeleteStatus == "True"; this.btnListAll.Visible = true; this.btnUpdate.Visible = false; this.btnCancel.Visible = false; break; case "add": if (this.Request.QueryString["ID"] != null) { if (!(PaymentGatewayIOPayer.EditStatus == "True")) { break; } this.SetRecord(this.Request.QueryString["ID"]); this.pnlAdd.Visible = true; this.pnlViewAll.Visible = false; this.pnlView.Visible = false; this.btnUpdate.Visible = true; this.btnCancel.Visible = true; this.btnSubmit.Visible = false; this.btnReset.Visible = false; break; } if (!(PaymentGatewayIOPayer.AddStatus == "True")) { break; } this.Clear(); this.btnSubmit.Visible = true; this.btnReset.Visible = true; this.btnUpdate.Visible = false; this.btnCancel.Visible = false; this.pnlAdd.Visible = true; this.pnlViewAll.Visible = false; this.pnlView.Visible = false; break; default: this.BindGrid(); this.pnlViewAll.Visible = true; this.pnlView.Visible = false; this.pnlAdd.Visible = false; break; } } else { this.BindGrid(); this.pnlViewAll.Visible = true; this.pnlView.Visible = false; this.pnlAdd.Visible = false; if (PaymentGatewayIOPayer.AddStatus == "False") { this.btnAddPaymentGateway.Visible = this.btnAdd.Visible = false; } else { this.btnAddPaymentGateway.Visible = this.btnAdd.Visible = true; } } } else if (PaymentGatewayIOPayer.AddStatus == "True" && PaymentGatewayIOPayer.EditStatus == "False" && (PaymentGatewayIOPayer.ViewStatus == "False" && PaymentGatewayIOPayer.DeleteStatus == "False")) { this.pnlAdd.Visible = true; this.btnUpdate.Visible = false; this.btnCancel.Visible = false; this.pnlViewAll.Visible = false; this.pnlView.Visible = false; } else { this.pnlViewAll.Visible = false; this.pnlView.Visible = false; this.pnlAdd.Visible = false; } } }
protected void Page_Load(object sender, EventArgs e) { MembershipUser user = Membership.GetUser(); if (user != null) { query = user.ToString(); if (Roles.IsUserInRole(query, "Admin")) { this.objCompanyLoginMasterDT = this.objCompanyLoginMasterBll.GetDataByCompanyLoginName(query); if (this.objCompanyLoginMasterDT.Rows.Count > 0) { companyId = this.objCompanyLoginMasterDT.Rows[0]["CompanyID"].ToString(); } } else if (Roles.IsUserInRole(query, "Employee")) { this.objStaffMasterDT = this.objStaffMasterBll.GetDataByStaffUserName(query); if (this.objStaffMasterDT.Rows.Count > 0) { companyId = this.objStaffMasterDT.Rows[0]["CompanyID"].ToString(); } } query = string.Format("SELECT CloudPackageID,CloudPackageName,CloudPackagePriceMonthly,CloudPackagePriceYearly FROM CloudPackageMaster " + " Where CloudPackageID={0}", this.Request.QueryString["id"]); dtCloudPackageMaster = objDbutility.BindDataTable(query); if (dtCloudPackageMaster?.Rows.Count > 0) { if (this.Request.QueryString["type"] == "M") { amount = String.Format("{0:0.00}", dtCloudPackageMaster.Rows[0]["CloudPackagePriceMonthly"]); } else { amount = String.Format("{0:0.00}", dtCloudPackageMaster.Rows[0]["CloudPackagePriceYearly"]); } int num = (this.Request.QueryString["type"] == "Y") ? 365 : 30; query = String.Format("SELECT COMPANYID FROM COMPANYPACKAGEMASTER WHERE COMPANYID={0}; ", companyId); dtCompanyPackageMaster = objDbutility.BindDataTable(query); if (dtCompanyPackageMaster?.Rows.Count > 0) { query = " Update c Set c.CloudPackageID={1},c.PackageStartDate='{2}',c.PackageEndDate='{3}',c.PackageType='{4}', " + " c.PackageAmount={5},c.PackagePaymentTransDetail='{6}',c.PackagePaymentTransDate='{7}',c.PackageAssignDate='{8}',c.ActivePackage='{9}' " + " From CompanyPackageMaster c Where c.CompanyID={0}; "; } else { query = "Insert Into CompanyPackageMaster (CompanyID,CloudPackageID,PackageStartDate,PackageEndDate, " + "PackageType,PackageAmount,PackagePaymentTransDetail,PackagePaymentTransDate,PackageAssignDate, ActivePackage) " + " Select {0},{1},'{2}','{3}','{4}',{5},'{6}','{7}','{8}','{9}' "; } query = string.Format(query, companyId, this.Request.QueryString["id"], new DateTime?(DateTime.Now), new DateTime?(DateTime.Now.AddDays((double)num)), Convert.ToString(dtCloudPackageMaster.Rows[0]["CloudPackageName"]), new Decimal?(Decimal.Parse(amount)) , "Pay by Billtransact", new DateTime?(DateTime.Now), new DateTime?(DateTime.Now), true); objDbutility.ExecuteQuery(query); } } var request = (HttpWebRequest)WebRequest.Create("http://www.iopayer.com/iopg/IOPayerPaymentGateway.aspx"); objDbutility = new Dbutility(); string str = " Select ProductID,MerchantID,MerchantAuthkey,TransactionTypeID,TransactionAuthkey From PaymentGatewayIOPayer Where PaymentGatewayID=1"; DataTable dtIOPayerMaster = objDbutility.BindDataTable(str); if (dtIOPayerMaster?.Rows.Count > 0) { str = Convert.ToString(dtIOPayerMaster.Rows[0]["MerchantID"]); string postData = "MerchantID=" + Uri.EscapeDataString(str); str = Convert.ToString(dtIOPayerMaster.Rows[0]["ProductID"]); postData += "&ProductID=" + Uri.EscapeDataString(str); str = Convert.ToString(dtIOPayerMaster.Rows[0]["TransactionTypeID"]); postData += "&TransactionTypeID=" + Uri.EscapeDataString(str); str = Convert.ToString(dtIOPayerMaster.Rows[0]["MerchantAuthkey"]); postData += "&MerchantAuthKey=" + Uri.EscapeDataString(str); str = Convert.ToString(dtIOPayerMaster.Rows[0]["TransactionAuthkey"]); postData += "&TranAuthKey=" + Uri.EscapeDataString(str); postData += "&OrderAmount=" + Uri.EscapeDataString(amount); postData += "&ReturnURL=" + Uri.EscapeDataString(ConfigurationManager.AppSettings["SuccessClientURL"]); string invoiceno = DateTime.Now.ToString("dd MM yyyy HH:mm:ss"); invoiceno = invoiceno.Replace(":", string.Empty); invoiceno = Regex.Replace(invoiceno, "\\s", string.Empty); postData += "&OrderNo=" + Uri.EscapeDataString(invoiceno); var data = Encoding.ASCII.GetBytes(postData); request.Method = "POST"; request.ContentType = "application/x-www-form-urlencoded"; request.ContentLength = data.Length; using (var stream = request.GetRequestStream()) { stream.Write(data, 0, data.Length); } Response.Clear(); var response = (HttpWebResponse)request.GetResponse(); var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd(); string strResultnew = responseString.Replace("./IOPayerPaymentGateway.aspx", "http://www.iopayer.com/iopg/IOPayerPaymentGateway.aspx"); Response.Write(strResultnew); return; } else { this.ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), "<script language=\"JavaScript\">" + "alert('IO Payer Master detail not found!');" + "</script>"); } }