using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.Text; using System.ServiceModel.Web; using System.ServiceModel.Activation; using System.Data; using System.Configuration; using System.Data.SqlClient; using System.Runtime.Serialization.Json; using System.Web.Script.Services; using System.ServiceModel.Channels; using System.Web.Services; using KMASchoolERP; using nmsSetup; using nmsLogin; using nmsADO; using System.Net.Mail; using System.Net.Security; // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service" in code, svc and config file together. [ServiceContract] public class Service { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["cn"].ConnectionString); string ToMail, FromMail, BodyMail, HeadMail; //-------------Select State-------------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string selState(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("selState", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@stateId", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["stateId"].ToString(); obj.name = dr["stateName"].ToString(); obj.codeId = dr["statecode"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-------------Select State-------------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string seltypedetail(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("ddltype", con); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["id"].ToString(); obj.name = dr["name"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delState(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("delState", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@stateId", ID); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //----------------State Section----------------------// //----Insert [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insState(string Name, string Code) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("InsState", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@stateName", Name); cmd.Parameters.AddWithValue("@Abbreviation", Code); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-----delete....... [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delCity(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("delCity", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@cityId", ID); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //-----Update [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updState(string ID, string Name, string Code) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("updState", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@stateId", ID); cmd.Parameters.AddWithValue("@stateName", Name); cmd.Parameters.AddWithValue("@Abbreviation", Code); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-------------Distict Section---------------// //------------Select/View---------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string selDistrict(string ID, string SID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ RAJ.MaxJsonLength = int.MaxValue; con.Open(); SqlCommand cmd = new SqlCommand("selDistrict", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@distId", ID); cmd.Parameters.AddWithValue("@districtSCode", SID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["districtId"].ToString(); obj.name = dr["districtName"].ToString(); obj.codeId = dr["districtCode"].ToString(); obj.pinCode = dr["districtSCode"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------Bind Student---- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewconfirmBatchwithApproved(string ID, string Approved) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); RAJ.MaxJsonLength = Int32.MaxValue; SqlCommand cmd = new SqlCommand("ViewbindbatchCom12", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchid", ID); cmd.Parameters.AddWithValue("@ApprovedId", Approved); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["mBatchId"].ToString(); obj.branchCodeName = dr["mBatchCode"].ToString(); obj.name = dr["mBatchName"].ToString(); obj.StartDate = dr["mBatchStartDate"].ToString(); obj.Enddate = dr["mBatchEndDate"].ToString(); obj.countStudent = dr["countStudent"].ToString(); obj.mBatchSize = dr["mBatchSize"].ToString(); obj.Level = dr["mBatchNSQFLevel"].ToString(); obj.branchName = dr["branchName"].ToString(); obj.AssDate = dr["batchAssessmentDate"].ToString(); obj.Amount = dr["Amount"].ToString(); obj.paymentdate = dr["bpddate"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------Bind Student---- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string CountStudent() { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); RAJ.MaxJsonLength = Int32.MaxValue; SqlCommand cmd = new SqlCommand("countstudent", con); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.Registered = dr["Registered"].ToString(); obj.Enrolled = dr["Enrolled"].ToString(); obj.Certified = dr["Certified"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string selConstituency(string ID, string SID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ RAJ.MaxJsonLength = int.MaxValue; con.Open(); SqlCommand cmd = new SqlCommand("selConstituencydeepak", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@distId", ID); cmd.Parameters.AddWithValue("@districtSCode", SID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["cid"].ToString(); obj.name = dr["CName"].ToString(); obj.codeId = dr["CCode"].ToString(); obj.pinCode = dr["CStateCode"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string selCity(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("selCity", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@cityId", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["cityId"].ToString(); obj.name = dr["cityName"].ToString(); obj.codeId = dr["cityDCode"].ToString(); obj.pinCode = dr["cityCode"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string selTypeDetailDeepak(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ RAJ.MaxJsonLength = int.MaxValue; con.Open(); SqlCommand cmd = new SqlCommand("selTypeDetailDeepak", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["mtdId"].ToString(); obj.name = dr["mtdName"].ToString(); obj.codeId = dr["mtdTypeId"].ToString(); obj.srNo = dr["mtdSrNo"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string seltypedetailnew (string ID, string SID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ RAJ.MaxJsonLength = int.MaxValue; con.Open(); SqlCommand cmd = new SqlCommand("seltypedetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@distId", ID); cmd.Parameters.AddWithValue("@districtSCode", SID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["mtdid"].ToString(); obj.name = dr["mtdName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //---------------------------Ankit-----------------------------// //------Beneficiary Insert [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insMasterLedger1(string accountName, string contactPerson, string address, string city, string state, string pinCode, string mobileNo, string phoneNo, string emailId, string gstNo, string groupId, string typeId, string RAccountId, string openingBalance, string sessionId, string categoryId, string BankID, string BankName, string BranchName, string BankAccount, string BankIFSC, string benificaryName, string district, string relatedAccount, string branchId, string grpId, string panNo, string aadharNo, string cType, string staffId, string remark) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("insMasterAccount", con); cmd.CommandType = CommandType.StoredProcedure; if (RAccountId == "") { RAccountId = null; } if (relatedAccount == "") { relatedAccount = null; } cmd.Parameters.AddWithValue("@accountName", accountName); cmd.Parameters.AddWithValue("@conactPerson", contactPerson); cmd.Parameters.AddWithValue("@accountAddress", address); cmd.Parameters.AddWithValue("@accountCity", city); cmd.Parameters.AddWithValue("@accountState", state); cmd.Parameters.AddWithValue("@accountPinCode", pinCode); cmd.Parameters.AddWithValue("@accountMobileNo", mobileNo); cmd.Parameters.AddWithValue("@accountPhoneNo", phoneNo); cmd.Parameters.AddWithValue("@accountEmailId", emailId); cmd.Parameters.AddWithValue("@accountGSTNo", gstNo); cmd.Parameters.AddWithValue("@typeId", typeId); cmd.Parameters.AddWithValue("@groupId", groupId); cmd.Parameters.AddWithValue("@RAccountId", RAccountId); cmd.Parameters.AddWithValue("@openingBalance", openingBalance); cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@categoryId", categoryId); cmd.Parameters.AddWithValue("@district", district); cmd.Parameters.AddWithValue("@relatedAccountId", relatedAccount); cmd.Parameters.AddWithValue("@grpId", grpId); cmd.Parameters.AddWithValue("@branchId", branchId); cmd.Parameters.AddWithValue("@panNo", panNo); cmd.Parameters.AddWithValue("@aadharNo", aadharNo); // cmd.Parameters.AddWithValue("@cTypeId", cType); //-------------Employee Bank Detail--------------------// cmd.Parameters.AddWithValue("@bankId", BankID); cmd.Parameters.AddWithValue("@bankName", BankName); cmd.Parameters.AddWithValue("@branchName", BranchName); cmd.Parameters.AddWithValue("@accountCode", BankAccount); cmd.Parameters.AddWithValue("@ifscCode", BankIFSC); cmd.Parameters.AddWithValue("@beneficiaryName", benificaryName); //cmd.Parameters.AddWithValue("@accountId", staffId); cmd.Parameters.AddWithValue("@remark", remark); string str = cmd.ExecuteScalar().ToString(); //string str = "Successfully Saved!"; cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //------------ Bind Dropdown -------------------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string ShowTaxType(string id) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals; Integrated Security = True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("ShowTaxType", con); cmd.Parameters.AddWithValue("@mttid", id); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader dr = cmd.ExecuteReader(); mTax obj; if (dr.HasRows) { while (dr.Read()) { obj = new mTax(); obj.mttId = dr["mttId"].ToString(); obj.mttName = dr["mttName"].ToString(); obj.mTaxActive = dr["mttIsActive"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //---------Insert [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insDistrict(string Name, string Code, string stateid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("insDistrict", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@distName", Name); cmd.Parameters.AddWithValue("@stateId", stateid); cmd.Parameters.AddWithValue("@districtCode", Code); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //---------Insert [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insConstitunecy(string Name, string Code, string stateid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("insConstituency", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@distName", Name); cmd.Parameters.AddWithValue("@stateId", stateid); cmd.Parameters.AddWithValue("@districtCode", Code); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //---------Insert [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insTypeDetail(string Name, string Code, string stateid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("instypedetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@name", Name); cmd.Parameters.AddWithValue("@typeid", stateid); cmd.Parameters.AddWithValue("@srno", Code); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //---------Update [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updConstituency(string ID, string Name, string Code, string stateid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("updConstituency", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@distId", ID); cmd.Parameters.AddWithValue("@distName", Name); cmd.Parameters.AddWithValue("@stateId", stateid); cmd.Parameters.AddWithValue("@districtCode", Code); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //--------view Student------/// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string studentsearch(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("studentsearch", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchid", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.Studentcode = dr["studentCode"].ToString(); obj.name = dr["studentName"].ToString(); obj.fatherName = dr["studentFatherName"].ToString(); obj.MotherName = dr["studentMother"].ToString(); obj.relation = dr["studentRelation"].ToString(); obj.DOB = dr["studentDOB"].ToString(); obj.Age = dr["studentAge"].ToString(); obj.sex = dr["studentSex"].ToString(); obj.marital = dr["studentMarital"].ToString(); obj.address = dr["studentAddress"].ToString(); obj.pinCode = dr["studentPinCode"].ToString(); obj.studentMobileNo = dr["studentMobileNo"].ToString(); obj.phoneNo = dr["studentPhone"].ToString(); obj.emailID = dr["studentEmail"].ToString(); obj.categorydetails = dr["studentCategory"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //---------Update [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updTypeDetail (string ID, string Name, string stateid,string Code) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("updTypeDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@distId", ID); cmd.Parameters.AddWithValue("@distName", Name); cmd.Parameters.AddWithValue("@stateId", stateid); cmd.Parameters.AddWithValue("@srno", Code); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //---------Update [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updDistrict(string ID, string Name, string Code, string stateid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("updDistrict", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@distId", ID); cmd.Parameters.AddWithValue("@distName", Name); cmd.Parameters.AddWithValue("@stateId", stateid); cmd.Parameters.AddWithValue("@districtCode", Code); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-------------City [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string selTehsil(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("selectehsil", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@TehsilID", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["TehsilId"].ToString(); obj.name = dr["TehsilName"].ToString(); obj.codeId = dr["TehsilDCode"].ToString(); obj.pinCode = dr["TehsilCode"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-----delete....... [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delTehsil(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("delTehsil", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@tehsilid", ID); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delDistrict(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("deldistrict", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@cityId", ID); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delConstitunecy(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("delConstituency", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@cityId", ID); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //---------Insert //---------Insert [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insCity(string Name, string Code, string distid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("insCity", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@cityName", Name); cmd.Parameters.AddWithValue("@distId", distid); cmd.Parameters.AddWithValue("@cityCode", Code); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insTehsil(string Name, string Code, string distid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("insTehsil", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@TehsilName", Name); cmd.Parameters.AddWithValue("@TehsilCode", Code); cmd.Parameters.AddWithValue("@TeshilDCode", distid); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //---------Update [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updCity(string ID, string Name, string Code, string distid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("updCity", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@cityId", ID); cmd.Parameters.AddWithValue("@cityName", Name); cmd.Parameters.AddWithValue("@distId", distid); cmd.Parameters.AddWithValue("@cityCode", Code); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //---------Update [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updTehsil(string ID, string Name, string Code, string distid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("updTehsil", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@cityId", ID); cmd.Parameters.AddWithValue("@cityName", Name); cmd.Parameters.AddWithValue("@distId", distid); cmd.Parameters.AddWithValue("@cityCode", Code); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-------------Select [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewCity2(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ RAJ.MaxJsonLength = int.MaxValue; con.Open(); SqlCommand cmd = new SqlCommand("viewCity", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["id"].ToString(); obj.name = dr["name"].ToString(); obj.pinCode = dr["code"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-------------Select [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewTehsil(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ RAJ.MaxJsonLength = int.MaxValue; con.Open(); SqlCommand cmd = new SqlCommand("viewTeshil", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@DistrictId", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["TehsilId"].ToString(); obj.name = dr["TehsilName"].ToString(); obj.pinCode = dr["TehsilCode"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-----------------Admin Login--------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string checkLogin(string Name, string Pwd, string IP) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); clsBLlogin b = new clsBLlogin(); nmsLogin.prpLogin obj = new nmsLogin.prpLogin(); obj.loginName = Name; obj.loginPassword = Pwd; obj.IPaddress = IP; string str = b.CheckLogin(obj); return RAJ.Serialize(str); //} } //-----------------Student Login-------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string checkLogin1(string Name, string Pwd, string IP) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); clsBLlogin b = new clsBLlogin(); nmsLogin.prpLogin obj = new nmsLogin.prpLogin(); obj.loginName = Name; obj.loginPassword = Pwd; obj.IPaddress = IP; string str = b.CheckLogin1(obj); return RAJ.Serialize(str); //} } //-------------------Binding Node-----------------// //-----------------Bind Main Node------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string spMainUrl(string BID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("spMainUrl", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@empID", BID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.urlId = dr["urlId"].ToString(); obj.urlName = dr["urlName"].ToString(); obj.urlPath = dr["urlPath"].ToString(); obj.urlPrntId = dr["urlprntId"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-------------------Bind Sub Node------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string spMainUrlByPrntId(string BID, string urlRefid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("spMainUrlByPrntId", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@empID", BID); cmd.Parameters.AddWithValue("@prntId", urlRefid); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.urlId = dr["urlId"].ToString(); obj.urlName = dr["urlName"].ToString(); obj.urlPath = dr["urlPath"].ToString(); obj.urlPrntId = dr["urlprntId"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------------Branch Setup------------// //----View Referal Branch---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewReferalauthI(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); RAJ.MaxJsonLength = int.MaxValue; //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewReferalauthI", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["id"].ToString(); obj.name = dr["name"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //----View Traning Center Detail---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string ViewTraningCenterDetail(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("TraningCenterDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["tcId"].ToString(); obj.loginName = dr["empLoginName"].ToString(); obj.AssociateName = dr["tcname"].ToString(); obj.address = dr["branchAddress"].ToString(); obj.name = dr["spiName"].ToString(); obj.emailID = dr["spiEmail"].ToString(); obj.mobNo = dr["spiMobile"].ToString(); obj.codeId = dr["tcCode"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //----Student Count---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string StudentCount(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("StudentDetailByCenter", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.TotalStudent = dr["student"].ToString(); obj.BatchTrainer = dr["Traiiner"].ToString(); obj.Certified = dr["certified"].ToString(); obj.Enrolled = dr["StudentEnrolled"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------View Master City------ [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewCity1(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); RAJ.MaxJsonLength = int.MaxValue; //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewCity1", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["id"].ToString(); obj.name = dr["name"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //----------ViewStateDistrict-------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string BindStateCityname(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("BindStateCityname", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.name = dr["stateName"].ToString(); obj.Distid = dr["districtName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //---------View Desination------------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewMasterDesignation(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewMasterDesignation", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["id"].ToString(); obj.name = dr["name"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-------------Insert Branch------------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string InsBranch(string Name, string BranchCode, string Phone, string Mob, string Mail, string state, string city, string address, string District, string Limit, string BranchType, string ReferenceID, string Password, string Bstatus, string BSecurity, string OpenBalance, string CommStudent, string MstudentComm, string MSecurityComm, string person) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); Int64 MeMob = Int64.Parse(Mob); Int32 Mestatus = Convert.ToInt32(Bstatus); SqlCommand cmd = new SqlCommand("InsBranch", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchCode", BranchCode); cmd.Parameters.AddWithValue("@branchName", Name); cmd.Parameters.AddWithValue("@branchAddress", address); cmd.Parameters.AddWithValue("@branchPhone", Phone); cmd.Parameters.AddWithValue("@branchMobile", Mob); cmd.Parameters.AddWithValue("@branchEmail", Mail); cmd.Parameters.AddWithValue("@branchCity", city); cmd.Parameters.AddWithValue("@branchDistrict", District); cmd.Parameters.AddWithValue("@branchState", state); cmd.Parameters.AddWithValue("@branchLimit", Limit); cmd.Parameters.AddWithValue("@branchType", BranchType); cmd.Parameters.AddWithValue("@ReferenceBrachCodeId", ReferenceID); cmd.Parameters.AddWithValue("@password", Password); cmd.Parameters.AddWithValue("@branchStatus", Bstatus); cmd.Parameters.AddWithValue("@branchSecurity", BSecurity); cmd.Parameters.AddWithValue("@openBalance", OpenBalance); cmd.Parameters.AddWithValue("@commPerStudent", CommStudent); cmd.Parameters.AddWithValue("branchMStudentComm", MstudentComm); cmd.Parameters.AddWithValue("@branchMSecurityComm", MSecurityComm); cmd.Parameters.AddWithValue("@branchContactPerson", person); string str = cmd.ExecuteScalar().ToString(); string[] s = str.Split('!'); if (s[0].ToString() == "Successfully Done " && MeMob > 9 && Mestatus == 1) { nms_sms.cls_sms sms = new nms_sms.cls_sms(); //Visitus:www.Education Institute.com sms.SMSSend("Dear " + Name + " Welcome to IEDUP. Your Registration has been done successfully. Your ID :" + s[1].ToString(), MeMob); } else if (s[0].ToString() == "Successfully Done " && MeMob > 9) { nms_sms.cls_sms sms = new nms_sms.cls_sms(); sms.SMSSend("Dear " + Name + " Welcome to IEDUP. Your Query has been done successfully. Call Us:88960-03002", MeMob); //Your ID :" + s[1].ToString(), Mob); } string finalstr = "Successfully Saved!"; cmd.Dispose(); con.Close(); return RAJ.Serialize(finalstr); //} } //--------------Update Branch------------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updBranch(string ID, string Name, string BranchCode, string Phone, string Mob, string Mail, string state, string city, string address, string District, string Limit, string BranchType, string ReferenceID, string Password, string Bstatus, string BSecurity, string OpenBalance, string CommStudent, string MstudentComm, string MSecurityComm, string person) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); Int64 MeMob = Int64.Parse(Mob); Int32 Mestatus = Convert.ToInt32(Bstatus); if (CommStudent == "" || CommStudent == null) { CommStudent = "0"; } if (MstudentComm == "" || MstudentComm == null) { MstudentComm = "0"; } if (MSecurityComm == "" || MSecurityComm == null) { MSecurityComm = "0"; } SqlCommand cmd = new SqlCommand("updBranch", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchCodeId", ID); cmd.Parameters.AddWithValue("@branchCode", BranchCode); cmd.Parameters.AddWithValue("@branchName", Name); cmd.Parameters.AddWithValue("@branchAddress", address); cmd.Parameters.AddWithValue("@branchPhone", Phone); cmd.Parameters.AddWithValue("@branchMobile", Mob); cmd.Parameters.AddWithValue("@branchEmail", Mail); cmd.Parameters.AddWithValue("@branchCity", city); cmd.Parameters.AddWithValue("@branchDistrict", District); cmd.Parameters.AddWithValue("@branchState", state); cmd.Parameters.AddWithValue("@branchLimit", Limit); cmd.Parameters.AddWithValue("@branchType", BranchType); cmd.Parameters.AddWithValue("@ReferenceBrachCodeId", ReferenceID); cmd.Parameters.AddWithValue("@password", Password); cmd.Parameters.AddWithValue("@branchStatus", Bstatus); cmd.Parameters.AddWithValue("@branchSecurity", BSecurity); cmd.Parameters.AddWithValue("@openBalance", OpenBalance); cmd.Parameters.AddWithValue("@commPerStudent", CommStudent); cmd.Parameters.AddWithValue("branchMStudentComm", MstudentComm); cmd.Parameters.AddWithValue("@branchMSecurityComm", MSecurityComm); cmd.Parameters.AddWithValue("@branchContactPerson", person); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-------------View Branch----------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string BindBranch(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); RAJ.MaxJsonLength = Int32.MaxValue; //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("BindBranch", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.srNo = dr["row"].ToString(); obj.branchId = dr["branchId"].ToString();//jack obj.id = dr["branchCodeId"].ToString(); obj.name = dr["branchName"].ToString(); obj.codeId = dr["branchCode"].ToString(); obj.address = dr["branchAddress"].ToString(); obj.phoneNo = dr["branchPhone"].ToString(); obj.mobNo = dr["branchMobile"].ToString(); obj.emailID = dr["branchEmail"].ToString(); obj.District = dr["branchDistrict"].ToString(); obj.Stid = dr["branchState"].ToString(); obj.Type = dr["branchType"].ToString(); obj.status = dr["branchStatus"].ToString(); obj.Password = dr["empLoginPassword"].ToString(); obj.title = dr["empLoginName"].ToString(); obj.relation = dr["Statusmode"].ToString(); obj.contactperson = dr["branchContactPerson"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-----------Total Branch Detail-------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string BindBranchTotal(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("StudentDeskDetail1", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchId", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); //obj.srNo = dr["row"].ToString(); obj.codeId = dr["branchCodeId"].ToString();//jack obj.name = dr["branchName"].ToString(); obj.pendingsend = dr["PendingSend"].ToString(); obj.PendingConfirmation = dr["PendingConfirmation"].ToString(); obj.ConfirmedStudent = dr["confirmedStudent"].ToString(); obj.PrintedDiploma = dr["printDiploma"].ToString(); obj.cancelled = dr["Cancelled"].ToString(); obj.StartDate = dr["date"].ToString(); obj.days = dr["days"].ToString(); obj.status = dr["currentBalance"].ToString(); obj.id = dr["LedgerId"].ToString(); //obj.Type = dr["branchType"].ToString(); //obj.status = dr["branchStatus"].ToString(); //obj.Password = dr["empLoginPassword"].ToString(); //obj.title = dr["empLoginName"].ToString(); //obj.relation = dr["Statusmode"].ToString(); //obj.contactperson = dr["branchContactPerson"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------------Bind Front Enquirty Branch--------------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string BindEnquirtyBranch(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("BindEnquirtyBranch", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.srNo = dr["row"].ToString(); obj.branchId = dr["branchId"].ToString();//jack obj.id = dr["branchCodeId"].ToString(); obj.name = dr["branchName"].ToString(); obj.codeId = dr["branchCode"].ToString(); obj.address = dr["branchAddress"].ToString(); obj.phoneNo = dr["branchPhone"].ToString(); obj.mobNo = dr["branchMobile"].ToString(); obj.emailID = dr["branchEmail"].ToString(); obj.District = dr["branchDistrict"].ToString(); obj.Stid = dr["branchState"].ToString(); obj.Type = dr["branchType"].ToString(); obj.status = dr["branchStatus"].ToString(); obj.Password = dr["empLoginPassword"].ToString(); obj.title = dr["empLoginName"].ToString(); obj.relation = dr["Statusmode"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------------Bind Batch Type--------------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string Bindbatchtype() { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("ddlbatchtype", con); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["mtdId"].ToString(); obj.name = dr["mtdName"].ToString();//jack lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------------Bind Batch Type--------------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string BindQualification() { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("bindQualification", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", 2018); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["mtdId"].ToString(); obj.name = dr["mtdName"].ToString();//jack lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------------Bind Course Type--------------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string BindCoursetype() { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection))batchtype //{ con.Open(); SqlCommand cmd = new SqlCommand("ddlCourseType", con); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["CTypeId"].ToString(); obj.name = dr["cTypeName"].ToString();//jack lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string batchtype() { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection))batchtype //{ con.Open(); SqlCommand cmd = new SqlCommand("BatchTypes", con); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["id"].ToString(); obj.name = dr["btName"].ToString();//jack lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------------Bind Course cat--------------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string BindCourseCat() { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("ddlCourseCat", con); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["catId"].ToString(); obj.name = dr["catName"].ToString();//jack lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------------Bind Batch Course --------------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string BindBatchCourse(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("ddlCourseDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["courseId"].ToString(); obj.name = dr["courseName"].ToString();//jack obj.Level = dr["courseLevel"].ToString();//jack lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------Bind Student---- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string BindBatch(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); RAJ.MaxJsonLength = Int32.MaxValue; SqlCommand cmd = new SqlCommand("bindstudent", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchid", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.name = dr["studentName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------Bind two only Student---- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string BindBatchtwoonly(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); RAJ.MaxJsonLength = Int32.MaxValue; SqlCommand cmd = new SqlCommand("ViewbindbatchCom", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchid", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["mBatchId"].ToString(); obj.branchCodeName = dr["mBatchCode"].ToString(); obj.name = dr["mBatchName"].ToString(); obj.StartDate = dr["mBatchStartDate"].ToString(); obj.Enddate = dr["mBatchEndDate"].ToString(); obj.countStudent = dr["countStudent"].ToString(); obj.mBatchSize = dr["mBatchSize"].ToString(); obj.Level = dr["mBatchNSQFLevel"].ToString(); obj.branchName = dr["branchName"].ToString(); obj.AssDate = dr["batchAssessmentDate"].ToString(); obj.TranierName = dr["mTrainerName"].ToString(); obj.TRID = dr["TRID"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------Bind Student---- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewconfirmBatch(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); RAJ.MaxJsonLength = Int32.MaxValue; SqlCommand cmd = new SqlCommand("ViewbindbatchCom11", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchid", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["mBatchId"].ToString(); obj.branchCodeName = dr["mBatchCode"].ToString(); obj.name = dr["mBatchName"].ToString(); obj.StartDate = dr["mBatchStartDate"].ToString(); obj.Enddate = dr["mBatchEndDate"].ToString(); obj.countStudent = dr["countStudent"].ToString(); obj.mBatchSize = dr["mBatchSize"].ToString(); obj.Level = dr["mBatchNSQFLevel"].ToString(); obj.branchName = dr["branchName"].ToString(); obj.AssDate = dr["batchAssessmentDate"].ToString(); obj.Amount = dr["Amount"].ToString(); obj.TranierName = dr["mTrainerName"].ToString(); obj.TRID = dr["TRID"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-------------------Send Request----- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string SendRequest(string StuID, string Mob) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("sendforconfdeepak", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", StuID); cmd.Parameters.AddWithValue("@status", 2); string str = cmd.ExecuteScalar().ToString(); Function inw = new Function(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-------------------Confirme Request----- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string confirmstudentdeepak(string StuID, string Mob, string branchid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("confirmstudentdeepak", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", StuID); cmd.Parameters.AddWithValue("@status", 3); string str = cmd.ExecuteScalar().ToString(); Function inw = new Function(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-------------------revert Request----- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string revertbatchbyadmin(string StuID) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("spInsertBatchRevert", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@bbatchid", StuID); string str = cmd.ExecuteScalar().ToString(); Function inw = new Function(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //--------------Filter NSFQ level--------------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string fillterlevel(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("NFSQlevel", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.Level = dr["courseLevel"].ToString();//jack lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------------Bind Batch Trainer --------------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string BindTrainer(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("ddltrainer", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchId ", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["mTrainerId"].ToString(); obj.name = dr["mTrainerName"].ToString();//jack lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-------------------Batch----- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string AddBacth(string StuID, string batchid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("addbatch", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@code", StuID); cmd.Parameters.AddWithValue("@batchid", batchid); string str = cmd.ExecuteScalar().ToString(); Function inw = new Function(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //-------------------Remove Batch----- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string RemoveBacth(string stuid, string batchid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("Removebatch", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@code", stuid); cmd.Parameters.AddWithValue("@batchid", batchid); string str = cmd.ExecuteScalar().ToString(); Function inw = new Function(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //---------------Delete Enquiry Branch------------------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delBranch(string branchid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("delBranch", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchid", branchid); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-----------------Delete Admin Branch----------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delBranchNew(string branchid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("delBranchNew", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchid", branchid); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //----------------View Franchise Detail--------------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string ViewFranchiseDetail(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("ViewFranchiseDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchid", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); //------------Institute Detail-----------------// obj.codeId = dr["branchId"].ToString();//jack obj.id = dr["branchCodeId"].ToString(); obj.name = dr["branchName"].ToString(); //obj.codeId = dr["branchCode"].ToString(); obj.address = dr["branchAddress"].ToString(); //obj.phoneNo = dr["branchPhone"].ToString(); obj.emailID = dr["branchEmail"].ToString(); obj.mobNo = dr["branchmobile"].ToString(); obj.city = dr["branchCity"].ToString(); obj.District = dr["branchDistrict"].ToString(); obj.Stid = dr["branchState"].ToString(); //obj.Type = dr["branchType"].ToString(); obj.status = dr["branchStatus"].ToString(); obj.CarpetArea = dr["CarpetArea"].ToString(); obj.NoOfRooms = dr["NoOfRooms"].ToString(); obj.NoOfComputers = dr["NoOfComputers"].ToString(); obj.NoOfPrinters = dr["NoOfPrinters"].ToString(); //----------------Personal Detail----------------------// obj.PName = dr["bpDetailName"].ToString(); obj.PFatherName = dr["bpDetailFatherName"].ToString(); obj.PMail = dr["bpDetailMail"].ToString(); obj.PMobile = dr["bpDetailMob"].ToString(); obj.PQualification = dr["bpDetailQualification"].ToString(); obj.PExperience = dr["bpDetailExp"].ToString(); obj.PState = dr["bpDetailState"].ToString(); obj.PCity = dr["bpDetailCity"].ToString(); obj.PAddress = dr["bpDetailAddress"].ToString(); //-----------------Faculty Detail-----------------// obj.FName = dr["bfDetailName"].ToString(); obj.FFatherName = dr["bfDatailFatherName"].ToString(); obj.FQualification = dr["bfDetailQualification"].ToString(); obj.FExperiece = dr["bfDetailExp"].ToString(); obj.DOB = dr["bfDetailDOB"].ToString(); //-------------Document Detail-----------------// obj.DirImg = dr["BPhotoDirImg"].ToString(); obj.ReceptionImg = dr["BPhotoReceptionEraImg"].ToString(); obj.RoomImg = dr["BPhotoLabRoomImg"].ToString(); obj.SideImg = dr["BPhotoOutSideImg"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //----------------View Front Enquiry Detail------------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] //public string ViewStudentEnquiry(string ID) //{ // System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); // //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; // List lst = new List(); // //using (SqlConnection con = new SqlConnection(strConnection)) // //{ // con.Open(); // SqlCommand cmd = new SqlCommand("view_enquiry", con); // cmd.CommandType = CommandType.StoredProcedure; // cmd.Parameters.AddWithValue("@enqid", ID); // SqlDataReader dr = cmd.ExecuteReader(); // PRPSetup obj; // if (dr.HasRows) // { // while (dr.Read()) // { // obj = new PRPSetup(); // obj.srNo = dr["nwrow"].ToString(); // obj.id = dr["enqid"].ToString(); // obj.name = dr["enqname"].ToString(); // obj.address = dr["address"].ToString(); // obj.description = dr["enqmsg"].ToString(); // obj.mobNo = dr["enqmob"].ToString(); // obj.emailID = dr["enqmail"].ToString(); // obj.Type = dr["enqdepartment"].ToString(); // obj.DOJ = dr["enqdate"].ToString(); // obj.State = dr["stateName"].ToString(); // obj.District = dr["districtName"].ToString(); // lst.Add(obj); // } // } // dr.Dispose(); // cmd.Dispose(); // con.Close(); // //} // return RAJ.Serialize(lst); //} public string ViewStudentEnquiry(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); RAJ.MaxJsonLength = int.MaxValue; //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("view_enquiry", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@enqid", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.srNo = dr["nwrow"].ToString(); obj.id = dr["enqid"].ToString(); obj.name = dr["enqname"].ToString(); obj.address = dr["address"].ToString(); obj.description = dr["enqmsg"].ToString(); obj.mobNo = dr["enqmob"].ToString(); obj.emailID = dr["enqmail"].ToString(); obj.Type = dr["enqdepartment"].ToString(); obj.DOJ = dr["enqdate"].ToString(); obj.State = dr["stateName"].ToString(); obj.District = dr["districtName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //----------Select Branch---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string SelBranch(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("SelBranch", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.srNo = dr["row"].ToString(); obj.id = dr["branchCodeId"].ToString(); obj.name = dr["branchName"].ToString(); obj.codeId = dr["branchCode"].ToString(); obj.address = dr["branchAddress"].ToString(); obj.phoneNo = dr["branchPhone"].ToString(); obj.mobNo = dr["branchMobile"].ToString(); obj.emailID = dr["branchEmail"].ToString(); obj.District = dr["branchDistrict"].ToString(); obj.city = dr["branchCity"].ToString(); obj.Stid = dr["branchState"].ToString(); obj.Type = dr["branchType"].ToString(); obj.status = dr["branchStatus"].ToString(); obj.Password = dr["empLoginPassword"].ToString(); obj.title = dr["empLoginName"].ToString(); obj.reference = dr["ReferenceBrachCodeId"].ToString(); obj.branchSecurity = dr["branchSecurity"].ToString(); obj.branchMSecurityComm = dr["branchMSecurityComm"].ToString(); obj.branchMStudentComm = dr["branchMStudentComm"].ToString(); obj.commPerStudent = dr["commPerStudent"].ToString(); obj.contactperson = dr["branchContactPerson"].ToString(); obj.branchLimit = dr["branchLimit"].ToString(); obj.openBalance = "0"; lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-------------Authority Section---------------// //------------------View Autority------------ [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string BindforAuthority(string bid, string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("BindforAuthority", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@cId", bid); cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["id"].ToString(); obj.name = dr["name"].ToString(); obj.status = dr["Status"].ToString(); obj.title = dr["Title"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-----------------Insert Authority--------------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string SetBranchAuthority(string Bid, string urlid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("SetBranchAuthority", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", Bid); cmd.Parameters.AddWithValue("@Page", urlid); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //------Insert Batch------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string InsBatch(string branchcode, string branchname ,string btypid, string bCourseTypeid, string bCourseCat, string bCourseId, string Batchlevel, string bsdate, string bedate, string bSize,string isActive, string btrainerid,string assdate,string branchid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("insbatch", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@bCode", branchcode); cmd.Parameters.AddWithValue("@bName", branchname); cmd.Parameters.AddWithValue("@bTypeid", btypid); //cmd.Parameters.AddWithValue("@bCourseTypeId", bCourseTypeid); cmd.Parameters.AddWithValue("@bCourseCat", bCourseCat); cmd.Parameters.AddWithValue("@bCourseId", bCourseId); cmd.Parameters.AddWithValue("@bNSQFlevel", Batchlevel); cmd.Parameters.AddWithValue("@bSdate", bsdate); cmd.Parameters.AddWithValue("@bEdate", bedate); cmd.Parameters.AddWithValue("@bSize", bSize); cmd.Parameters.AddWithValue("@bIsActive", isActive); cmd.Parameters.AddWithValue("@bTrainerId", btrainerid); cmd.Parameters.AddWithValue("@batchAssessmentDate", assdate); cmd.Parameters.AddWithValue("@branchid", branchid); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //------Insert Trainer------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string InsTrainer(string name, string mobileno, string emailid, string isActive, string Photo,string qualification,string branchid,string job, string subsector) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("instrainer", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@name", name); cmd.Parameters.AddWithValue("@mobileno", mobileno); cmd.Parameters.AddWithValue("@emailid", emailid); cmd.Parameters.AddWithValue("@isactive", isActive); cmd.Parameters.AddWithValue("@photo", Photo); cmd.Parameters.AddWithValue("@qualification", qualification); cmd.Parameters.AddWithValue("@branchid", branchid); cmd.Parameters.AddWithValue("@job", job); cmd.Parameters.AddWithValue("@SubSector", subsector); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //--------view Batch---ddlBatchList---// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewBatchddl(string Bid, string sts) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewbatchddl", con); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["mBatchId"].ToString(); obj.branchCodeName = dr["mBatchCode"].ToString(); obj.name = dr["mBatchName"].ToString(); obj.batchcode = dr["smBatchCode"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------view Batch---ddlBatchList---// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string ddlBatchList(string branchid, string sts) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("ddlBatchList", con); cmd.Parameters.AddWithValue("@branchid", branchid); cmd.Parameters.AddWithValue("@batchStatus", sts); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["mBatchId"].ToString(); obj.name = dr["mBatchName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string studentViewBatch(string batchid ) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("studentViewBatch", con); cmd.Parameters.AddWithValue("@batchId", batchid); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.totak = dr["countStudent"].ToString(); obj.mBatchSize = dr["mBatchSize"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //------Insert Batch------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string UploadDocument(string ID, string marksheet, string certificate,string result,string Issue) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("UpdateStudentCertificate", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@studentCode", ID); cmd.Parameters.AddWithValue("@Certificate", marksheet); cmd.Parameters.AddWithValue("@Marksheet", certificate); cmd.Parameters.AddWithValue("@result", result); cmd.Parameters.AddWithValue("@Issue", Issue); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //--------view Downwise Branch over Status 0 [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewReferalauthII(string Bid, string sts) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewReferalauthII", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", Bid); cmd.Parameters.AddWithValue("@isActive", sts); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["id"].ToString(); obj.name = dr["name"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------view Batch------/// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewBatch(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("ViewBatchadmin", con); cmd.CommandType = CommandType.StoredProcedure; if(ID!=null&& ID!="") cmd.Parameters.AddWithValue("@branchid", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["mBatchId"].ToString(); obj.branchCodeName = dr["mBatchCode"].ToString(); obj.name = dr["mBatchName"].ToString(); obj.Level = dr["mBatchNSQFLevel"].ToString(); obj.StartDate = dr["mBatchStartDate"].ToString(); obj.Enddate = dr["mBatchEndDate"].ToString(); obj.size = dr["mBatchSize"].ToString(); obj.BCID = dr["BCID"].ToString(); obj.branchName = dr["branchName"].ToString(); obj.AssDate = dr["batchAssessmentDate"].ToString(); obj.TranierName = dr["mTrainerName"].ToString(); obj.TRID = dr["TRID"].ToString(); obj.ActiveBranch = dr["mBatchApprovedActive"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------view Batch------/// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewBatchStatus(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewbatchStatus", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchid", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["mBatchId"].ToString(); obj.branchCodeName = dr["mBatchCode"].ToString(); obj.name = dr["mBatchName"].ToString(); obj.Level = dr["mBatchNSQFLevel"].ToString(); obj.StartDate = dr["mBatchStartDate"].ToString(); obj.Enddate = dr["mBatchEndDate"].ToString(); obj.size = dr["mBatchSize"].ToString(); obj.BCID = dr["BCID"].ToString(); obj.branchName = dr["branchName"].ToString(); obj.AssDate = dr["batchAssessmentDate"].ToString(); obj.TranierName = dr["mTrainerName"].ToString(); obj.TRID = dr["TRID"].ToString(); obj.status = dr["statuss"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------view Batch------/// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewBatchoneonly(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("Viewbindbatch", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchid", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["mBatchId"].ToString(); obj.branchCodeName = dr["mBatchCode"].ToString(); obj.name = dr["mBatchName"].ToString(); obj.StartDate = dr["mBatchStartDate"].ToString(); obj.Enddate = dr["mBatchEndDate"].ToString(); obj.Level = dr["mBatchNSQFLevel"].ToString(); obj.Enddate = dr["mBatchEndDate"].ToString(); obj.branchName = dr["branchName"].ToString(); obj.AssDate = dr["batchAssessmentDate"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string ViewbindbatchCount(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("ViewbindbatchCount", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchid", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["mBatchId"].ToString(); obj.branchCodeName = dr["mBatchCode"].ToString(); obj.name = dr["mBatchName"].ToString(); obj.StartDate = dr["mBatchStartDate"].ToString(); obj.Enddate = dr["mBatchEndDate"].ToString(); obj.countStudent = dr["countStudent"].ToString(); obj.Level = dr["mBatchNSQFLevel"].ToString(); obj.mBatchSize = dr["mBatchSize"].ToString(); obj.branchName = dr["branchName"].ToString(); obj.AssDate = dr["batchAssessmentDate"].ToString(); obj.TranierName = dr["mTrainerName"].ToString(); obj.TRID = dr["TRID"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------view Student------/// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string ViewStudent(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewstudentnew", con); cmd.CommandType = CommandType.StoredProcedure; if(ID != null & ID != "") { cmd.Parameters.AddWithValue("@branchid", ID); } else { cmd.Parameters.AddWithValue("@branchid", null); } SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.Studentcode = dr["studentCode"].ToString(); obj.name = dr["studentName"].ToString(); obj.fatherName = dr["studentFatherName"].ToString(); obj.MotherName = dr["studentMother"].ToString(); obj.relation = dr["studentRelation"].ToString(); obj.DOB = dr["studentDOB"].ToString(); obj.Age = dr["studentAge"].ToString(); obj.sex = dr["studentSex"].ToString(); obj.marital = dr["studentMarital"].ToString(); obj.address = dr["studentAddress"].ToString(); obj.pinCode = dr["studentPinCode"].ToString(); obj.studentMobileNo = dr["studentMobileNo"].ToString(); obj.phoneNo = dr["studentPhone"].ToString(); obj.emailID = dr["studentEmail"].ToString(); obj.categorydetails = dr["studentCategory"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewTrainer(string Bid, string sts) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection))@branchid //{ con.Open(); SqlCommand cmd = new SqlCommand("viewtrainer", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchid", Bid); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["mTrainerId"].ToString(); obj.name = dr["mTrainerName"].ToString(); obj.mobNo = dr["mTrainerMobileno"].ToString(); obj.emailID = dr["mTrainerEmailID"].ToString(); obj.isActive = dr["mTrainerIsActive"].ToString(); obj.photo = dr["TrainerQualiDocument"].ToString(); obj.PQualification = dr["mTrainerQualification"].ToString(); obj.TRID = dr["TRID"].ToString(); obj.PName = dr["mtdName"].ToString(); obj.branchname = dr["branchname"].ToString(); obj.jobrole = dr["mTrainerJob"].ToString(); obj.subsector = dr["mTrainerSubSector"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-------------View Branch Security----- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewBranchSecurity(string Bid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewBranchSecurity", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branch", Bid); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.codeId = dr["CodeId"].ToString(); obj.name = dr["branchName"].ToString(); obj.branchLimit = dr["branchLimit"].ToString(); obj.branchSecurity = dr["branchSecurity"].ToString(); obj.branchId = dr["mCodeId"].ToString(); obj.branchName = dr["mbranchName"].ToString(); obj.branchMSecurityComm = dr["securityComm"].ToString(); obj.designationName = dr["branchDesination"].ToString(); obj.designationStatus = dr["mbranchDesination"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //----------------Insert Branch Security [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insBranchSecurity(string BID, string BLimit, string BSecurity, string BMSecurity) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("insBranchSecurity", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchid", BID); cmd.Parameters.AddWithValue("@limit", BLimit); cmd.Parameters.AddWithValue("@branchSecurity", BSecurity); cmd.Parameters.AddWithValue("@branchMSecurityComm", BMSecurity); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-------------------Coursewise Commission--------------------// //----------View coursewie Commission values-------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewCourseCommissionValue(string Bid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewCourseCommissionValue", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branch", Bid); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.catID = dr["catId"].ToString(); obj.Organisation = dr["orgName"].ToString(); obj.CourseCategory = dr["catName"].ToString(); obj.RAmount = dr["Value"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //----------View TRID-------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewTRID(string Bid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewTRID", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", Bid); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["mTrainerId"].ToString(); obj.name = dr["mTrainerName"].ToString(); obj.mobNo = dr["mTrainerMobileno"].ToString(); obj.emailID = dr["mTrainerEmailID"].ToString(); obj.PName = dr["mtdName"].ToString(); obj.TRID = dr["TRID"].ToString(); obj.photo = dr["TrainerQualiDocument"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //----------View BCID-------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewBCID( string Bid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewBCID", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", Bid); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["mBatchId"].ToString(); obj.branchCodeName = dr["mBatchCode"].ToString(); obj.name = dr["mBatchName"].ToString(); obj.Level = dr["mBatchNSQFLevel"].ToString(); obj.StartDate = dr["mBatchStartDate"].ToString(); obj.Enddate = dr["mBatchEndDate"].ToString(); obj.size = dr["mBatchSize"].ToString(); obj.BCID = dr["BCID"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //----------View Student Detail-------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewStudentDetail(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewstudentdetaildeepak", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.branchCodeName = dr["studentCode"].ToString(); obj.name = dr["studentName"].ToString(); obj.DOB = dr["studentDOB"].ToString(); obj.sex = dr["studentSex"].ToString(); obj.categorydetails = dr["studentCategory"].ToString(); obj.mobNo = dr["studentMobileNo"].ToString(); obj.pinCode = dr["studentPinCode"].ToString(); obj.emailID = dr["studentEmail"].ToString(); obj.State = dr["stateName"].ToString(); obj.District = dr["districtName"].ToString(); obj.city = dr["cityName"].ToString(); obj.photo = dr["photo1"].ToString(); obj.Religion = dr["studentReligion"].ToString(); obj.address = dr["studentAddress1"].ToString(); obj.education = dr["studentEducation"].ToString(); obj.PExperience = dr["studentPreTraining"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //----------View Student By Batch-------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewStudentByBatch(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewstudentlistdeepak", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.branchCodeName = dr["stuMId"].ToString(); obj.Studentcode = dr["studentCode"].ToString(); obj.name = dr["studentName"].ToString(); obj.DOB = dr["studentDOB"].ToString(); obj.sex = dr["studentSex"].ToString(); obj.categorydetails = dr["studentCategory"].ToString(); obj.mobNo = dr["studentMobileNo"].ToString(); obj.pinCode = dr["studentPinCode"].ToString(); obj.emailID = dr["studentEmail"].ToString(); obj.State = dr["stateName"].ToString(); obj.District = dr["districtName"].ToString(); obj.city = dr["cityName"].ToString(); obj.photo = dr["photo1"].ToString(); obj.Religion = dr["studentReligion"].ToString(); obj.address = dr["studentAddress1"].ToString(); obj.education = dr["studentEducation"].ToString(); obj.PExperience = dr["studentPreTraining"].ToString(); obj.TRID = dr["pinMaskValue"].ToString(); obj.photo = dr["Certificate"].ToString(); obj.document = dr["Marksheet"].ToString(); obj.fatherName = dr["studentFatherName"].ToString(); obj.MotherName = dr["studentMother"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //----------View Student By Batch-------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewDocument(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewdocument", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.photo = dr["Certificate"].ToString(); obj.document = dr["Marksheet"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //----------View coursewie Commission 1-------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewCourseCommissionValue1(string Bid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewCourseCommissionValue1new", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branch", Bid); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.catID = dr["catId"].ToString(); obj.Organisation = dr["orgName"].ToString(); obj.CourseCategory = dr["catName"].ToString(); obj.RAmount = dr["Value"].ToString(); obj.Target = dr["Target"].ToString(); obj.id = dr["catId"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //------------------------Insert Coursewise Commission------------ [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insCommissionvalue(string BID, string courseid, string Amount) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("insCommissionvalue", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchid", BID); cmd.Parameters.AddWithValue("@Courseid", courseid); cmd.Parameters.AddWithValue("@value", Amount); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //---------------------------Course Section---------------// //-------------View State------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewState() { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewState", con); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["id"].ToString(); obj.name = dr["name"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------------View Districr---------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewDistrict(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewDistrict", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["id"].ToString(); obj.name = dr["name"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //----------------View City---------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewCity(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewCity", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["id"].ToString(); obj.name = dr["name"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //----------------Bind University Detail-------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string View_jackOrgMasterDetail(string Id) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); try { SqlCommand cmd = new SqlCommand("View_jackOrgMasterDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@orgid", Id); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["orgId"].ToString(); obj.name = dr["orgName"].ToString(); obj.Type = dr["orgType"].ToString(); obj.city = dr["cityName"].ToString(); obj.District = dr["districtName"].ToString(); obj.State = dr["stateName"].ToString(); //----------------------// obj.Cityid = dr["orgCity"].ToString(); obj.Distid = dr["orgDistrict"].ToString(); obj.Stid = dr["orgState"].ToString(); obj.address = dr["orgAddress"].ToString(); obj.pinCode = dr["orgPinCode"].ToString(); obj.mailId = dr["orgEmailId"].ToString(); obj.mobNo = dr["orgMobile"].ToString(); obj.phoneNo = dr["orgPhoneNo"].ToString(); obj.FaxNo = dr["orgFaxNo"].ToString(); obj.StartDate = dr["jStartDate"].ToString(); obj.Enddate = dr["jEndDate"].ToString(); obj.typeurl = dr["UniType"].ToString(); obj.status = dr["orgIsActive"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } catch (Exception ex) { return RAJ.Serialize(ex.Message); } } //-----------------Update Organisation Detail------------ [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updOrgmasterDetail(string ID, string UName, string UType, string Ustate, string Udistrict, string Ucity, string Uaddress, string Upincode, string Umail, string Umob, string Uphone, string UfaxNo, string Ustdate, string UEndDate) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); try { SqlCommand cmd = new SqlCommand("updOrgmasterDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@orgId", ID); cmd.Parameters.AddWithValue("@orgName", UName); cmd.Parameters.AddWithValue("@orgType", UType); cmd.Parameters.AddWithValue("@orgCity", Ucity); cmd.Parameters.AddWithValue("@orgDistrict", Udistrict); cmd.Parameters.AddWithValue("@orgState", Ustate); cmd.Parameters.AddWithValue("@orgAddress", Uaddress); cmd.Parameters.AddWithValue("@orgPinCode", Upincode); cmd.Parameters.AddWithValue("@orgEmailId", Umail); cmd.Parameters.AddWithValue("@orgMobile", Umob); cmd.Parameters.AddWithValue("@orgPhoneNo", Uphone); cmd.Parameters.AddWithValue("@orgFaxNo", UfaxNo); cmd.Parameters.AddWithValue("@orgApprovalDate", Ustdate); cmd.Parameters.AddWithValue("@orgApprovalEndDate", UEndDate); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } catch (Exception ex) { return RAJ.Serialize(ex.Message); } //} } //-----------------Course Type--------------// //---------View Course Tupe--------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string SelCourseType(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("SelCourseType", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@CTypeId", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["id"].ToString(); obj.name = dr["name"].ToString(); obj.description = dr["ctypedetail"].ToString(); obj.ImagePath = dr["ctypeImage"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-------------------Insert Course Type------------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string InsCourseType(string Name, string sts, string detail, string photo) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("InsCourseType", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@cTypeName", Name); cmd.Parameters.AddWithValue("@isActive", sts); cmd.Parameters.AddWithValue("@ctypedetail", detail); cmd.Parameters.AddWithValue("@ctypImage", photo); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //------------------Update Course Type------------ [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string UpdCourseType(string ID, string Name, string sts, string detail, string photo) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("UpdCourseType", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@CTypeId", ID); cmd.Parameters.AddWithValue("@cTypeName", Name); cmd.Parameters.AddWithValue("@isActive", sts); cmd.Parameters.AddWithValue("@ctypedetail", detail); cmd.Parameters.AddWithValue("@ctypImage", photo); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //---------------------Course Category----------// //------------Insert--------------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string InsmasterCourseCategory(string image1, string image, string Morg, string TypeNme, string Name, string sts, string detail) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("InsmasterCourseCategory", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@catName", Name); cmd.Parameters.AddWithValue("@catCourseType", TypeNme); cmd.Parameters.AddWithValue("@catOrgId", Morg); cmd.Parameters.AddWithValue("@isActive", sts); cmd.Parameters.AddWithValue("@catdetail", detail); cmd.Parameters.AddWithValue("@catimage", image); cmd.Parameters.AddWithValue("@catimage1", image1); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-------------------Update Course Category---------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string UpdmasterCourseCategory(string image1, string image, string ID, string Morg, string TypeNme, string Name, string sts, string detail) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("UpdmasterCourseCategory", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@catId", ID); cmd.Parameters.AddWithValue("@catName", Name); cmd.Parameters.AddWithValue("@catCourseType", TypeNme); cmd.Parameters.AddWithValue("@catOrgId", Morg); cmd.Parameters.AddWithValue("@isActive", sts); cmd.Parameters.AddWithValue("@catdetail", detail); cmd.Parameters.AddWithValue("@catimage", image); cmd.Parameters.AddWithValue("@catimage1", image1); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //--------------View Course Category-------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewCourseCategory(string OrgID, string TypeID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewCourseCategory", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@uniId", OrgID); cmd.Parameters.AddWithValue("@id", TypeID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["id"].ToString(); obj.name = dr["name"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-----------------Select Course Category----- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string selCourseCategory(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("selCourseCategory", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@catId", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["id"].ToString(); obj.name = dr["name"].ToString(); obj.status = dr["isActive"].ToString(); obj.CourseType = dr["catCourseType"].ToString(); obj.Organisation = dr["catOrgId"].ToString(); obj.description = dr["catdetail"].ToString(); obj.ImagePath = dr["catImage"].ToString(); obj.SideImg = dr["catImage1"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-----------------Delete Course Category---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delCourseCategory(string ID) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("delCourseCategory", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@catid", ID); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-----------------Delete Batch---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delBatch(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("deletBatch", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-----------------Delete Trainer---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delTrainer(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("deletTrainer", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-----------------Delete Student---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delStudent(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("deletestudent", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //[OperationContract] //[WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wr apped, ResponseFormat = WebMessageFormat.Json)] //public string selCourseCategory(string ID) //{ // System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); // //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; // List lst = new List(); // //using (SqlConnection con = new SqlConnection(strConnection)) // //{ // con.Open(); // SqlCommand cmd = new SqlCommand("selCourseCategory", con); // cmd.CommandType = CommandType.StoredProcedure; // cmd.Parameters.AddWithValue("@catId", ID); // SqlDataReader dr = cmd.ExecuteReader(); // PRPSetup obj; // if (dr.HasRows) // { // while (dr.Read()) // { // obj = new PRPSetup(); // obj.id = dr["id"].ToString(); // obj.name = dr["name"].ToString(); // obj.status = dr["isActive"].ToString(); // obj.CourseType = dr["catCourseType"].ToString(); // obj.Organisation = dr["catOrgId"].ToString(); // obj.description = dr["catdetail"].ToString(); // lst.Add(obj); // } // } // dr.Dispose(); // cmd.Dispose(); // con.Close(); // //} // return RAJ.Serialize(lst); //} //-----------------Delete Course Type---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delCourseTYpe(string ID) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("DelCourse", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@CTtpeId", ID); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-------------------Master Course Detail--------// //-----------------Insert Course Detail---------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insCourse(string CDuration, string NSFLvl, string Eligibilty, string QPFile, string ClmModel, string ovPhoto, string ovDetail, string ctimetype, string chighstatus, string OrgID, string CCatid, string CourseName, string coursecode, string shortName, string corusetime, string CourseStatus, string description, string imagpath) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("insCourse", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@courseOrgID", OrgID); cmd.Parameters.AddWithValue("@courseCatId", CCatid); cmd.Parameters.AddWithValue("@courseName", CourseName); cmd.Parameters.AddWithValue("@courseCode", coursecode); cmd.Parameters.AddWithValue("@courseShortName", shortName); cmd.Parameters.AddWithValue("@courseTime", corusetime); cmd.Parameters.AddWithValue("@IsActive", CourseStatus); cmd.Parameters.AddWithValue("@courseContent", description); cmd.Parameters.AddWithValue("@img", imagpath); cmd.Parameters.AddWithValue("@chightstatus", chighstatus); cmd.Parameters.AddWithValue("@courseTimeType", ctimetype); cmd.Parameters.AddWithValue("@coimage", ovPhoto); cmd.Parameters.AddWithValue("@covdetail", ovDetail); cmd.Parameters.AddWithValue("@courseLevel", NSFLvl); cmd.Parameters.AddWithValue("@courseDuration", CDuration); cmd.Parameters.AddWithValue("@courseEligibility", Eligibilty); cmd.Parameters.AddWithValue("@coursecurriculumfile", ClmModel); cmd.Parameters.AddWithValue("@courseQPFile", QPFile); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //------------------Update Course Detail-------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updCourse(string CDuration, string NSFLvl, string Eligibilty, string QPFile, string ClmModel, string ovPhoto, string ovDetail, string ctimetype, string chighstatus, string ID, string OrgID, string CCatid, string CourseName, string coursecode, string shortName, string corusetime, string CourseStatus, string description, string imagpath) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("updCourse", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@courseId", ID); cmd.Parameters.AddWithValue("@courseOrgID", OrgID); cmd.Parameters.AddWithValue("@courseCatId", CCatid); cmd.Parameters.AddWithValue("@courseName", CourseName); cmd.Parameters.AddWithValue("@courseCode", coursecode); cmd.Parameters.AddWithValue("@courseShortName", shortName); cmd.Parameters.AddWithValue("@courseTime", corusetime); cmd.Parameters.AddWithValue("@IsActive", CourseStatus); cmd.Parameters.AddWithValue("@courseContent", description); cmd.Parameters.AddWithValue("@img", imagpath); cmd.Parameters.AddWithValue("@chightstatus", chighstatus); cmd.Parameters.AddWithValue("@courseTimeType", ctimetype); cmd.Parameters.AddWithValue("@coimage", ovPhoto); cmd.Parameters.AddWithValue("@covdetail", ovDetail); cmd.Parameters.AddWithValue("@courseLevel", NSFLvl); cmd.Parameters.AddWithValue("@courseDuration", CDuration); cmd.Parameters.AddWithValue("@courseEligibility", Eligibilty); cmd.Parameters.AddWithValue("@coursecurriculumfile", ClmModel); cmd.Parameters.AddWithValue("@courseQPFile", QPFile); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //--------view Course Detail----- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string ViewCourseDetail(string OrgId, string CourseCatid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("ViewCourseDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@courseUniID", OrgId); cmd.Parameters.AddWithValue("@courseCatID", CourseCatid); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["courseId"].ToString(); obj.name = dr["courseName"].ToString(); obj.title = dr["courseShortName"].ToString(); obj.codeId = dr["courseCode"].ToString(); obj.courseTime = dr["courseTime"].ToString(); obj.status = dr["IsActive"].ToString(); obj.CourseType = dr["courseCatId"].ToString(); obj.Organisation = dr["courseOrgID"].ToString(); obj.description = dr["courseContent"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //---------------Select Course Detail---------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string selCourse(string courseid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("selCourse", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@courseId", courseid); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["courseId"].ToString(); obj.name = dr["courseName"].ToString(); obj.title = dr["courseShortName"].ToString(); obj.codeId = dr["courseCode"].ToString(); obj.courseTime = dr["courseTime"].ToString(); obj.status = dr["IsActive"].ToString(); obj.CourseCategory = dr["courseCatId"].ToString(); obj.Organisation = dr["courseOrgID"].ToString(); obj.CourseType = dr["CTypeId"].ToString(); obj.Organisation = dr["courseOrgID"].ToString(); obj.description = dr["courseContent"].ToString(); obj.ImagePath = dr["courseimage"].ToString(); obj.Applicationno = dr["coursehighlightstatus"].ToString(); obj.CourseType1 = dr["courseTimeType"].ToString(); obj.abbriviation = dr["overviewdetail"].ToString(); obj.ActiveBranch = dr["overviewPicture"].ToString(); obj.AnsA = dr["courseLevel"].ToString(); obj.AnsB = dr["courseEligibility"].ToString(); obj.AnsC = dr["courseDuration"].ToString(); obj.AnsD = dr["courseQPFile"].ToString(); obj.Chequenum = dr["coursecurriculumfile"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //---------------Select Batch---------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string selBatch(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("selectBatch", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["mBatchId"].ToString(); obj.branchCodeName = dr["mBatchCode"].ToString(); obj.name = dr["mBatchName"].ToString(); obj.batchtypeid = dr["mBatchTypeId"].ToString(); obj.BatchCourseTypeId = dr["mBatchCourseTypeId"].ToString(); obj.BatchCourseCategoryId = dr["mBatchCourseCategoryId"].ToString(); obj.BatchCourseId = dr["mBatchCourseId"].ToString(); obj.Level = dr["mBatchNSQFLevel"].ToString(); obj.StartDate = dr["mBatchStartDate"].ToString(); obj.Enddate = dr["mBatchEndDate"].ToString(); obj.size = dr["mBatchSize"].ToString(); obj.isActive = dr["mBatchIsActive"].ToString(); obj.BatchTrainer = dr["mBatchTrainerId"].ToString(); obj.AssDate = dr["batchAssessmentDate"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //---------------Select Trainer---------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string seltrainer(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("selectTranier", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["mTrainerId"].ToString(); obj.name = dr["mTrainerName"].ToString(); obj.mobNo = dr["mTrainerMobileno"].ToString(); obj.emailID = dr["mTrainerEmailID"].ToString(); obj.isActive = dr["mTrainerIsActive"].ToString(); obj.photo = dr["mTrainerQualiDocument"].ToString(); obj.PQualification = dr["mTrainerQualification"].ToString(); obj.jobrole = dr["mTrainerJob"].ToString(); obj.subsector = dr["mTrainerSubSector"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //---------------Select Student---------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string selStudent(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("SelStudent", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.Studentcode = dr["studentCode"].ToString(); obj.Shortname = dr["studentShortName"].ToString(); obj.countrycode = dr["studentCountryCode"].ToString(); obj.Religion = dr["studentReligion"].ToString(); obj.Disability = dr["studentDisability"].ToString(); obj.DisabilityProof = dr["studentDisabilityProof"].ToString(); obj.alternateid = dr["studentAlternateId"].ToString(); obj.alternateproof = dr["studentAlternateProof"].ToString(); obj.adharrno = dr["studentAdhaarNumber"].ToString(); obj.state1 = dr["studentState1"].ToString(); obj.district1 = dr["studentDistrict1"].ToString(); obj.tehsil = dr["studentTehsil"].ToString(); obj.Constituency = dr["studentConstituency"].ToString(); obj.address1 = dr["studentAddress1"].ToString(); obj.state2 = dr["studentState2"].ToString(); obj.district2 = dr["studentDistrict2"].ToString(); obj.tehsil1 = dr["studentTehsil1"].ToString(); obj.city1 = dr["studentCity1"].ToString(); obj.pincode1 = dr["studentPinCode1"].ToString(); obj.Constituency1 = dr["studentConstituency1"].ToString(); obj.ifsccode = dr["studentIFSCCode"].ToString(); obj.bankaddress = dr["studentBankAddress"].ToString(); obj.education = dr["studentEducation"].ToString(); obj.passingyear = dr["studentYearOfPassing"].ToString(); obj.photo1 = dr["photo1"].ToString(); obj.Education1 = dr["studentEducation1"].ToString(); obj.passingyear1 = dr["studentYearOfPassing1"].ToString(); obj.supportingdocument = dr["SupportinDocument"].ToString(); obj.pretraining = dr["studentPreTraining"].ToString(); obj.ExperieceSector = dr["PreExperienceSector"].ToString(); obj.expeSectorMonth = dr["NoOfMonthExpeSector"].ToString(); obj.Experiecejob = dr["PreExperienceJob"].ToString(); obj.expeSectoryear = dr["NoOfYearPreExperience"].ToString(); obj.EmployeeID = dr["Employed"].ToString(); obj.heardaboutus = dr["HeardAboutUs"].ToString(); obj.sector = dr["SelectSector"].ToString(); obj.subsector = dr["SelectSubSector"].ToString(); obj.jobrole = dr["SelectJobRole"].ToString(); obj.name = dr["studentName"].ToString(); obj.mobNo = dr["studentMobileNo"].ToString(); obj.emailID = dr["studentEmail"].ToString(); obj.sex = dr["studentSex"].ToString(); obj.DOB = dr["studentDOB"].ToString(); obj.marital = dr["studentMarital"].ToString(); obj.State = dr["studentState"].ToString(); obj.District = dr["studentDistrict"].ToString(); obj.categorydetails = dr["studentCategory"].ToString(); obj.MotherName = dr["studentMother"].ToString(); obj.fatherName = dr["studentFatherName"].ToString(); obj.PAddress = dr["studentAddress"].ToString(); obj.city = dr["studentCity"].ToString(); obj.pinCode = dr["studentPinCode"].ToString(); obj.photo = dr["photo"].ToString(); obj.bankusername = dr["paymentBankUserName"].ToString(); obj.BankAccount = dr["paymentBankAC"].ToString(); obj.Bankname = dr["paymentBankName"].ToString(); obj.courseId = dr["smCourseId"].ToString(); obj.EmployeeID = dr["EmploymentstatusId"].ToString(); obj.Employeedetail = dr["EmploymentDetail"].ToString(); obj.DisabilitySelection = dr["studentDisabilitySelection"].ToString(); obj.IdentitySelection = dr["studentIdentitySelection"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //---------------Select Student---------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string StudentAllDetail(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("StudentAllDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.Studentcode = dr["studentCode"].ToString(); obj.Shortname = dr["studentShortName"].ToString(); obj.countrycode = dr["studentCountryCode"].ToString(); obj.Religion = dr["studentReligion"].ToString(); obj.Disability = dr["studentDisability"].ToString(); obj.DisabilityProof = dr["studentDisabilityProof"].ToString(); obj.alternateid = dr["studentAlternateId"].ToString(); obj.alternateproof = dr["studentAlternateProof"].ToString(); obj.adharrno = dr["studentAdhaarNumber"].ToString(); obj.state1 = dr["studentState1"].ToString(); obj.district1 = dr["studentDistrict1"].ToString(); obj.tehsil = dr["studentTehsil"].ToString(); obj.Constituency = dr["studentConstituency"].ToString(); obj.address1 = dr["studentAddress1"].ToString(); obj.state2 = dr["studentState2"].ToString(); obj.district2 = dr["studentDistrict2"].ToString(); obj.tehsil1 = dr["studentTehsil1"].ToString(); obj.city1 = dr["studentCity1"].ToString(); obj.pincode1 = dr["studentPinCode1"].ToString(); obj.Constituency1 = dr["studentConstituency1"].ToString(); obj.ifsccode = dr["studentIFSCCode"].ToString(); obj.bankaddress = dr["studentBankAddress"].ToString(); obj.education = dr["studentEducation"].ToString(); obj.passingyear = dr["studentYearOfPassing"].ToString(); obj.photo1 = dr["photo1"].ToString(); obj.Education1 = dr["studentEducation1"].ToString(); obj.passingyear1 = dr["studentYearOfPassing1"].ToString(); obj.supportingdocument = dr["SupportinDocument"].ToString(); obj.pretraining = dr["studentPreTraining"].ToString(); obj.ExperieceSector = dr["PreExperienceSector"].ToString(); obj.expeSectorMonth = dr["NoOfMonthExpeSector"].ToString(); obj.Experiecejob = dr["PreExperienceJob"].ToString(); obj.expeSectoryear = dr["NoOfYearPreExperience"].ToString(); obj.EmployeeID = dr["Employed"].ToString(); obj.heardaboutus = dr["HeardAboutUs"].ToString(); obj.sector = dr["SelectSector"].ToString(); obj.subsector = dr["SelectSubSector"].ToString(); obj.jobrole = dr["SelectJobRole"].ToString(); obj.name = dr["studentName"].ToString(); obj.mobNo = dr["studentMobileNo"].ToString(); obj.emailID = dr["studentEmail"].ToString(); obj.sex = dr["studentSex"].ToString(); obj.DOB = dr["studentDOB"].ToString(); obj.marital = dr["studentMarital"].ToString(); obj.State = dr["studentState"].ToString(); obj.District = dr["studentDistrict"].ToString(); obj.categorydetails = dr["studentCategory"].ToString(); obj.MotherName = dr["studentMother"].ToString(); obj.fatherName = dr["studentFatherName"].ToString(); obj.PAddress = dr["studentAddress"].ToString(); obj.city = dr["studentCity"].ToString(); obj.pinCode = dr["studentPinCode"].ToString(); obj.photo = dr["photo"].ToString(); obj.bankusername = dr["paymentBankUserName"].ToString(); obj.BankAccount = dr["paymentBankAC"].ToString(); obj.Bankname = dr["paymentBankName"].ToString(); obj.courseId = dr["smCourseId"].ToString(); obj.EmployeeID = dr["EmploymentstatusId"].ToString(); obj.Employeedetail = dr["EmploymentDetail"].ToString(); obj.DisabilitySelection = dr["studentDisabilitySelection"].ToString(); obj.IdentitySelection = dr["studentIdentitySelection"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //---------------Select Student---------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string StudentAllDetailForExcel(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("StudentAllDetailForExcel", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.Salutation = dr["Salutation"].ToString(); obj.FullName = dr["FullName"].ToString(); obj.Gender = dr["Gender"].ToString(); obj.DateOfBirth = dr["DateOfBirth"].ToString(); obj.EmailID = dr["EmailID"].ToString(); obj.MaritalStatus = dr["MaritalStatus"].ToString(); obj.FathersName = dr["FathersName"].ToString(); obj.Religion = dr["Religion"].ToString(); obj.Category = dr["Category"].ToString(); obj.TypeOfDisability = dr["TypeOfDisability"].ToString(); obj.DomicileState = dr["DomicileState"].ToString(); obj.DomicileDistrict = dr["DomicileDistrict"].ToString(); obj.TypeofAlternateID = dr["TypeofAlternateID"].ToString(); obj.AdharReferenceNo = dr["AdharReferenceNo"].ToString(); obj.CountryCode = dr["CountryCode"].ToString(); obj.MobileNo = dr["MobileNo"].ToString(); obj.EducationLevel = dr["EducationLevel"].ToString(); obj.PermanentAddressAddress = dr["PermanentAddressAddress"].ToString(); obj.PermanentAddressState = dr["PermanentAddressState"].ToString(); obj.PermanentAddressDistrict = dr["PermanentAddressDistrict"].ToString(); obj.PermanentAddressPINCode = dr["PermanentAddressPINCode"].ToString(); obj.PermanentAddressCity = dr["PermanentAddressCity"].ToString(); obj.PermanentAddressTehsil = dr["PermanentAddressTehsil"].ToString(); obj.PermanentAddressConstituency = dr["PermanentAddressConstituency"].ToString(); obj.CommunicationSameasPermanentAddress = dr["CommunicationSameasPermanentAddress"].ToString(); obj.CommunicationAddressState = dr["CommunicationAddressState"].ToString(); obj.CommunicationAddressDistrict = dr["CommunicationAddressDistrict"].ToString(); obj.CommunicationAddressCity = dr["CommunicationAddressCity"].ToString(); obj.CommunicationAddressTehsil = dr["CommunicationAddressTehsil"].ToString(); obj.CommunicationAddressPermanentConstituency = dr["CommunicationAddressPermanentConstituency"].ToString(); obj.PreviousExperienceSector = dr["PreviousExperienceSector"].ToString(); obj.Noofmonthsofpreviousexperience = dr["Noofmonthsofpreviousexperience"].ToString(); obj.Employed = dr["Employed"].ToString(); obj.EmploymentStatus = dr["EmploymentStatus"].ToString(); obj.EmploymentDetails = dr["EmploymentDetails"].ToString(); obj.HeardAboutUs = dr["HeardAboutUs"].ToString(); obj.sector = dr["SelectSubSector"].ToString(); obj.jobrole = dr["SelectJobRole"].ToString(); obj.CommunicationAddressPINCode = dr["CommunicationAddressPINCode"].ToString(); obj.TrainingStatus = dr["TrainingStatus"].ToString(); obj.MothersName = dr["MothersName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //------------Course to Web--------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string CourseToWeb(string ID) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("CourseToWeb", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //--------------------Course Fee Detail----------------// //----------View Only Course Name by Course Cat [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewCoursename(string CourseCatid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewCoursename", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", CourseCatid); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["id"].ToString(); obj.name = dr["name"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //----------View Only Course Name by Course Cat [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewCoursename1(string CourseCatid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewCoursename", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", CourseCatid); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["id"].ToString(); obj.name = dr["name"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //------------View Course Fee Detail-------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string BindmasterCourseFee(string CourseID,string FeeId) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("BindmasterCourseFee", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@courseid", CourseID); cmd.Parameters.AddWithValue("@FeeId", FeeId); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["feeId"].ToString(); obj.courseId = dr["feeCourseId"].ToString(); obj.courseName = dr["coursename"].ToString(); obj.codeId = dr["feeSemCode"].ToString(); obj.title = dr["feeSemName"].ToString(); obj.coursefee = dr["feeCourseFee"].ToString(); obj.examfee = dr["feeExamFee"].ToString(); obj.Regfee = dr["feeregFee"].ToString(); obj.Otherfee = dr["feeOtherFee"].ToString(); obj.Total = dr["feeTotalFee"].ToString(); obj.CourseType = dr["catCourseType"].ToString(); obj.CourseCategory = dr["courseCatId"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-------------Select Course Fee Detail--------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string selmasterCourseFee(string FeeID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("selmasterCourseFee", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@courseid", FeeID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["feeId"].ToString(); obj.courseId = dr["feeCourseId"].ToString(); obj.codeId = dr["feeSemCode"].ToString(); obj.title = dr["feeSemName"].ToString(); obj.coursefee = dr["feeCourseFee"].ToString(); obj.examfee = dr["feeExamFee"].ToString(); obj.Regfee = dr["feeregFee"].ToString(); obj.Otherfee = dr["feeOtherFee"].ToString(); obj.Total = dr["feeTotalFee"].ToString(); obj.CourseType = dr["catCourseType"].ToString(); obj.CourseCategory = dr["courseCatId"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //------------Insert Course Fee-------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insmasterCourseFee(string courseid, string coursecode, string coursefeename, string coursefee, string examfee, string regfee, string otherfee, string totalfee) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("insmasterCourseFee", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@feeCourseId", courseid); cmd.Parameters.AddWithValue("@feeSemCode", coursecode); cmd.Parameters.AddWithValue("@feeSemName", coursefeename); cmd.Parameters.AddWithValue("@feeCourseFee", Convert.ToInt32(coursefee)); cmd.Parameters.AddWithValue("@feeExamFee", Convert.ToInt32(examfee)); cmd.Parameters.AddWithValue("@feeregFee", Convert.ToInt32(regfee)); cmd.Parameters.AddWithValue("@feeOtherFee", Convert.ToInt32(otherfee)); cmd.Parameters.AddWithValue("@feeTotalFee", Convert.ToInt32(totalfee)); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //---------------Update Course Fee----- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updmasterCourseFee(string ID, string courseid, string coursecode, string coursefeename, string coursefee, string examfee, string regfee, string otherfee, string totalfee) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("updmasterCourseFee", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@feeId", ID); cmd.Parameters.AddWithValue("@feeCourseId", courseid); cmd.Parameters.AddWithValue("@feeSemCode", coursecode); cmd.Parameters.AddWithValue("@feeSemName", coursefeename); cmd.Parameters.AddWithValue("@feeCourseFee", Convert.ToInt32(coursefee)); cmd.Parameters.AddWithValue("@feeExamFee", Convert.ToInt32(examfee)); cmd.Parameters.AddWithValue("@feeregFee", Convert.ToInt32(regfee)); cmd.Parameters.AddWithValue("@feeOtherFee", Convert.ToInt32(otherfee)); cmd.Parameters.AddWithValue("@feeTotalFee", Convert.ToInt32(totalfee)); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //---------------Update Course Fee----- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updateBatch(string ID, string branchcode, string branchname, string btypid, string bCourseTypeid, string bCourseCat, string bCourseId, string Batchlevel, string bsdate, string bedate, string bSize, string isActive, string btrainerid,string assdate) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("updatebtach", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); cmd.Parameters.AddWithValue("@bCode", branchcode); cmd.Parameters.AddWithValue("@bName", branchname); cmd.Parameters.AddWithValue("@bTypeid", btypid); //cmd.Parameters.AddWithValue("@bCourseTypeId", 0); cmd.Parameters.AddWithValue("@bCourseCat", bCourseCat); cmd.Parameters.AddWithValue("@bCourseId", bCourseId); cmd.Parameters.AddWithValue("@bNSQFlevel", Batchlevel); cmd.Parameters.AddWithValue("@bSdate", bsdate); cmd.Parameters.AddWithValue("@bEdate", bedate); cmd.Parameters.AddWithValue("@bSize", bSize); cmd.Parameters.AddWithValue("@bIsActive", isActive); cmd.Parameters.AddWithValue("@bTrainerId", btrainerid); cmd.Parameters.AddWithValue("@AssDate", assdate); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //---------------Update Course Fee----- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updateStudentDeepak(string ID, string studentShortName, string studentName, string photo, string studentCountryCode, string studentMobileNo, string studentEmail, string studentSex, string studentDOB, string studentMarital, string studentState, string studentDistrict, string studnetCategory, string studentReligion, string studentDisability, string studentDisabilityProof, string motherName, string studentFatherName, string studentAlternateId, string studentAlternateProof, string studentAdhaarNumber, string studentAddress, string studentState1, string studentDistrict1, string studentTehsil, string studentCity, string studentPinCode, string studentConstituency, string studentAddress1, string studentState2, string studentDistrict2, string studentTehsil1, string studentCity1, string studentPinCode1, string studentConstituency1, string paymentBankUserName, string paymentBankAC, string studentIFSCCode, string paymentBankName, string studentBankAddress, string studentEducation, string courseId, string studentYearOfPassing, string photo1, string studentEducation1, string studentYearOfPassing1, string SupportinDocument, string studentPreTraining, string CTypeId, string NoOfMonthExpeSector, string PreExperienceJob, string NoOfYearPreExperience, string Employed, string HeardAboutUs, string CTypeId1, string catid, string branchid, string EmploymentstatusId, string EmploymentDetail, string disabilityselection, string identityselecion) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("updatestudentdeepak", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@studentCode", ID); //cmd.Parameters.AddWithValue("@studentShortName", studentShortName); //cmd.Parameters.AddWithValue("@studentName", studentName); //cmd.Parameters.AddWithValue("@photo", photo); //cmd.Parameters.AddWithValue("@studentCountryCode", studentCountryCode); //cmd.Parameters.AddWithValue("@studentMobileNo", studentMobileNo); //cmd.Parameters.AddWithValue("@studentEmail", studentEmail); //cmd.Parameters.AddWithValue("@studentSex", studentSex); //cmd.Parameters.AddWithValue("@studentDOB", studentDOB); //cmd.Parameters.AddWithValue("@studentMarital", studentMarital); //cmd.Parameters.AddWithValue("@studentState", studentState); //cmd.Parameters.AddWithValue("@studentDistrict", studentDistrict); //cmd.Parameters.AddWithValue("@studnetCategory", studnetCategory); //cmd.Parameters.AddWithValue("@studentReligion", studentReligion); //cmd.Parameters.AddWithValue("@studentDisability", studentDisability); //cmd.Parameters.AddWithValue("@studentDisabilityProof", studentDisabilityProof); //cmd.Parameters.AddWithValue("@motherName", motherName); //cmd.Parameters.AddWithValue("@studentFatherName", studentFatherName); //if (studentAlternateId != null && studentAlternateId != "") // cmd.Parameters.AddWithValue("@studentAlternateId ", studentAlternateId); //if (studentAlternateProof != null && studentAlternateProof != "") // cmd.Parameters.AddWithValue("@studentAlternateProof ", studentAlternateProof); //cmd.Parameters.AddWithValue("@studentAdhaarNumber ", studentAdhaarNumber); //cmd.Parameters.AddWithValue("@studentAddress", studentAddress); //cmd.Parameters.AddWithValue("@studentState1", studentState1); //cmd.Parameters.AddWithValue("@studentDistrict1", studentDistrict1); //cmd.Parameters.AddWithValue("@studentTehsil", studentTehsil); //cmd.Parameters.AddWithValue("@studentCity", studentCity); //cmd.Parameters.AddWithValue("@studentPinCode", studentPinCode); //cmd.Parameters.AddWithValue("@studentConstituency", studentConstituency); //cmd.Parameters.AddWithValue("@studentAddress1", studentAddress1); //cmd.Parameters.AddWithValue("@studentState2", studentState2); //cmd.Parameters.AddWithValue("@studentDistrict2", studentDistrict2); //cmd.Parameters.AddWithValue("@studentTehsil1", studentTehsil1); //cmd.Parameters.AddWithValue("@studentCity1", studentCity1); //cmd.Parameters.AddWithValue("@studentPinCode1", studentPinCode1); //cmd.Parameters.AddWithValue("@studentConstituency1", studentConstituency1); //cmd.Parameters.AddWithValue("@paymentBankUserName", paymentBankUserName); //cmd.Parameters.AddWithValue("@paymentBankAC", paymentBankAC); //cmd.Parameters.AddWithValue("@studentIFSCCode", studentIFSCCode); //cmd.Parameters.AddWithValue("@paymentBankName", paymentBankName); //cmd.Parameters.AddWithValue("@studentBankAddress", studentBankAddress); //cmd.Parameters.AddWithValue("@studentEducation", studentEducation); //cmd.Parameters.AddWithValue("@smCourseId", courseId); //cmd.Parameters.AddWithValue("@studentYearOfPassing", studentYearOfPassing); //cmd.Parameters.AddWithValue("@photo1", photo1); //cmd.Parameters.AddWithValue("@studentEducation1", studentEducation1); //if (studentYearOfPassing1 != null && studentYearOfPassing1 != "") // cmd.Parameters.AddWithValue("@studentYearOfPassing1", studentYearOfPassing1); //cmd.Parameters.AddWithValue("@SupportinDocument", SupportinDocument); //cmd.Parameters.AddWithValue("@studentPreTraining", studentPreTraining); //cmd.Parameters.AddWithValue("@PreExperienceSector", CTypeId); //cmd.Parameters.AddWithValue("@NoOfMonthExpeSector", NoOfMonthExpeSector); //cmd.Parameters.AddWithValue("@PreExperienceJob", PreExperienceJob); //cmd.Parameters.AddWithValue("@NoOfYearPreExperience", NoOfYearPreExperience); //cmd.Parameters.AddWithValue("@Employed", Employed); //cmd.Parameters.AddWithValue("@HeardAboutUs", HeardAboutUs); //cmd.Parameters.AddWithValue("@SelectSector", CTypeId1); //cmd.Parameters.AddWithValue("@SelectSubSector", catid); //cmd.Parameters.AddWithValue("@SelectJobRole", courseId); cmd.Parameters.AddWithValue("@studentShortName", studentShortName); cmd.Parameters.AddWithValue("@studentName", studentName); cmd.Parameters.AddWithValue("@photo", photo); cmd.Parameters.AddWithValue("@studentCountryCode", studentCountryCode); cmd.Parameters.AddWithValue("@studentMobileNo", studentMobileNo); cmd.Parameters.AddWithValue("@studentEmail", studentEmail); cmd.Parameters.AddWithValue("@studentSex", studentSex); cmd.Parameters.AddWithValue("@studentDOB", studentDOB); cmd.Parameters.AddWithValue("@studentMarital", studentMarital); cmd.Parameters.AddWithValue("@studentState", studentState); cmd.Parameters.AddWithValue("@studentDistrict", studentDistrict); cmd.Parameters.AddWithValue("@studnetCategory", studnetCategory); cmd.Parameters.AddWithValue("@studentReligion", studentReligion); cmd.Parameters.AddWithValue("@studentDisability", studentDisability); cmd.Parameters.AddWithValue("@studentDisabilityProof", studentDisabilityProof); cmd.Parameters.AddWithValue("@motherName", motherName); cmd.Parameters.AddWithValue("@studentFatherName", studentFatherName); if (studentAlternateId != null && studentAlternateId != "") cmd.Parameters.AddWithValue("@studentAlternateId ", studentAlternateId); if (studentAlternateProof != null && studentAlternateProof != "") cmd.Parameters.AddWithValue("@studentAlternateProof ", studentAlternateProof); cmd.Parameters.AddWithValue("@studentAdhaarNumber ", studentAdhaarNumber); cmd.Parameters.AddWithValue("@studentAddress", studentAddress); cmd.Parameters.AddWithValue("@studentState1", studentState1); cmd.Parameters.AddWithValue("@studentDistrict1", studentDistrict1); cmd.Parameters.AddWithValue("@studentTehsil", studentTehsil); cmd.Parameters.AddWithValue("@studentCity", studentCity); cmd.Parameters.AddWithValue("@studentPinCode", studentPinCode); cmd.Parameters.AddWithValue("@studentConstituency", studentConstituency); cmd.Parameters.AddWithValue("@studentAddress1", studentAddress1); cmd.Parameters.AddWithValue("@studentState2", studentState2); cmd.Parameters.AddWithValue("@studentDistrict2", studentDistrict2); cmd.Parameters.AddWithValue("@studentTehsil1", studentTehsil1); cmd.Parameters.AddWithValue("@studentCity1", studentCity1); cmd.Parameters.AddWithValue("@studentPinCode1", studentPinCode1); cmd.Parameters.AddWithValue("@studentConstituency1", studentConstituency1); cmd.Parameters.AddWithValue("@paymentBankUserName", paymentBankUserName); cmd.Parameters.AddWithValue("@paymentBankAC", paymentBankAC); cmd.Parameters.AddWithValue("@studentIFSCCode", studentIFSCCode); cmd.Parameters.AddWithValue("@paymentBankName", paymentBankName); cmd.Parameters.AddWithValue("@studentBankAddress", studentBankAddress); cmd.Parameters.AddWithValue("@studentEducation", studentEducation); cmd.Parameters.AddWithValue("@smCourseId", courseId); cmd.Parameters.AddWithValue("@studentYearOfPassing", studentYearOfPassing); cmd.Parameters.AddWithValue("@photo1", photo1); cmd.Parameters.AddWithValue("@studentEducation1", studentEducation1); if (studentYearOfPassing1 != null && studentYearOfPassing1 != "") cmd.Parameters.AddWithValue("@studentYearOfPassing1", studentYearOfPassing1); cmd.Parameters.AddWithValue("@SupportinDocument", SupportinDocument); cmd.Parameters.AddWithValue("@studentPreTraining", studentPreTraining); cmd.Parameters.AddWithValue("@PreExperienceSector", CTypeId1); cmd.Parameters.AddWithValue("@NoOfMonthExpeSector", NoOfMonthExpeSector); cmd.Parameters.AddWithValue("@PreExperienceJob", PreExperienceJob); cmd.Parameters.AddWithValue("@NoOfYearPreExperience", NoOfYearPreExperience); cmd.Parameters.AddWithValue("@Employed", Employed); cmd.Parameters.AddWithValue("@HeardAboutUs", HeardAboutUs); cmd.Parameters.AddWithValue("@SelectSector", CTypeId); cmd.Parameters.AddWithValue("@SelectSubSector", catid); cmd.Parameters.AddWithValue("@SelectJobRole", courseId); //cmd.Parameters.AddWithValue("@branchid", branchid); cmd.Parameters.AddWithValue("@EmploymentstatusId", EmploymentstatusId); cmd.Parameters.AddWithValue("@EmploymentDetail", EmploymentDetail); cmd.Parameters.AddWithValue("@studentDisabilitySelection", disabilityselection); cmd.Parameters.AddWithValue("@studentIdentitySelection", identityselecion); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //------Insert Trainer------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string UpdateTrainer(string ID,string name, string mobileno, string emailid, string isActive, string Photo, string qualification,string job,string subsector) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("updatetrainer", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); cmd.Parameters.AddWithValue("@name", name); cmd.Parameters.AddWithValue("@mobileno", mobileno); cmd.Parameters.AddWithValue("@emailid", emailid); cmd.Parameters.AddWithValue("@isactive", isActive); cmd.Parameters.AddWithValue("@photo", Photo); cmd.Parameters.AddWithValue("@qualification", qualification); cmd.Parameters.AddWithValue("@job", job); cmd.Parameters.AddWithValue("@SubSector", subsector); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //---------------------------Delete MasterFee--------------------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delMasterCourseFee(string CourseID, string courseid, string coursecode, string coursefeename, string coursefee, string examfee, string regfee, string otherfee, string totalfee) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("delMasterCourseFee", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@feeId", CourseID); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //--------------Master Subject-------------// //--------View Subject [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewmasterSubject(string OrgId) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; RAJ.MaxJsonLength = int.MaxValue; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewmasterSubject", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", OrgId); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["id"].ToString(); obj.codeId = dr["subCode"].ToString(); obj.name = dr["name"].ToString(); obj.maxmark = dr["subMaxMarks"].ToString(); obj.minmark = dr["subMinMarks"].ToString(); obj.Organisation = dr["subOrgId"].ToString(); obj.status = dr["subIsActive"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //------------------------------Course Wise Subject ----------------------------------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewsubjectCourseWise(string OrgID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; RAJ.MaxJsonLength = int.MaxValue; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewsubjectCourseWise", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@courseId", OrgID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.subId = dr["scwId"].ToString(); obj.id = dr["subId"].ToString(); obj.codeId = dr["subCode"].ToString(); obj.name = dr["subName"].ToString(); obj.maxmark = dr["subMaxMarks"].ToString(); obj.minmark = dr["subMinMarks"].ToString(); obj.courseName = dr["courseName"].ToString(); obj.courseId = dr["courseId"].ToString(); obj.CourseCategory = dr["courseCode"].ToString(); obj.CourseCategory1 = dr["courseShortName"].ToString(); obj.serial = dr["scwSerialNo"].ToString(); //obj.status = dr["subIsActive"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //----------------Select Subject------ [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string SelmasterSubject(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("SelmasterSubject", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@subId", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["subId"].ToString(); obj.codeId = dr["subCode"].ToString(); obj.name = dr["subName"].ToString(); obj.maxmark = dr["subMaxMarks"].ToString(); obj.minmark = dr["subMinMarks"].ToString(); obj.Organisation = dr["subOrgId"].ToString(); obj.status = dr["subIsActive"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //----------------Insert Subject------ [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string InsmasterSubject(string Code, string Name, string Minmark, string MaxMark, string Org, string status) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("InsmasterSubject", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@subCode", Code); cmd.Parameters.AddWithValue("@subName", Name); cmd.Parameters.AddWithValue("@subMaxMarks", MaxMark); cmd.Parameters.AddWithValue("@subMinMarks", Minmark); cmd.Parameters.AddWithValue("@subOrgId", Org); cmd.Parameters.AddWithValue("@subIsActive", status); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //----------------Update Subject Serial Number------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string UpdSubjectByCourse(string ID, string Name, string Minmark, string MaxMark, string Org, string Value) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("UpdSubjectByCourse", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@SubId", ID); cmd.Parameters.AddWithValue("@Serial", Value); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-------------Update Subject------ [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string UpdmasterSubject(string ID, string Code, string Name, string Minmark, string MaxMark, string Org, string status) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("UpdmasterSubject", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@subId", ID); cmd.Parameters.AddWithValue("@subCode", Code); cmd.Parameters.AddWithValue("@subName", Name); cmd.Parameters.AddWithValue("@subMaxMarks", Minmark); cmd.Parameters.AddWithValue("@subMinMarks", MaxMark); cmd.Parameters.AddWithValue("@subOrgId", Org); cmd.Parameters.AddWithValue("@sbuIsActive", status); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string DelmasterSubject(string ID) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("DelmasterSubject", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@subId", ID); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //--------------------Subject Course Wise----------------------// //------Insert [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string InssubjectCourseWise(string SubID, string CourseID, string Module, string OrgName, string SrNo) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("InssubjectCourseWise", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@scwCourseId", CourseID); cmd.Parameters.AddWithValue("@scwSubjectId", SubID); cmd.Parameters.AddWithValue("@subOrgId", OrgName); cmd.Parameters.AddWithValue("@scwTrimID", Module); cmd.Parameters.AddWithValue("@scwSerialNo", SrNo); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //---------------------Registration--------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string InsStudent(string CourseID, string Name, string Mob, string StartDate, string Relation, string FatherName, string DOB, string Sex, string Address, string City, string Distt, string State, string Pincode, string PhoneNo, string Email, string BranchID, string EmployeeID, string Photo, string Document, string Org, string ApplicationNo, string UserName, string MotherName, string Category, string CourseFee, string OtherFee, string LateFee, string NetAmmount, string Concession, string payableAmount, string PaidFee, string PendingFee, string remark, string date, string DueDate, string paymentType, string paymentBankType, string bankId, string chequeNo, string bankDate, string chequeBankName, string chequeBranchName, string voucherType, string cashCBalance, string bankCBalance, string accountCBalance, string headCBalance, string discountCBalance, string lateCBalance,string branchsendname,string branchcontact, string studentMiddleName, string studentLastName, string fatherMiddleName, string fatherLastName, string identityProofNo ) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); Int64 Mob1=0; Function inw = new Function(); if ( Mob!="" && Mob!=null) { Mob1= Int64.Parse(Mob); } //DOB = DateTime.ParseExact(DOB, "yyyy-MM-dd", null).ToString("MM/dd/yyyy"); //StartDate = DateTime.ParseExact(StartDate, "yyyy-MM-dd", null).ToString("MM/dd/yyyy"); //if (DueDate != null && DueDate != "") //{ // DueDate = DateTime.ParseExact(DueDate, "yyyy-MM-dd", null).ToString("MM/dd/yyyy"); //} if (CourseFee == "" || CourseFee == null) { CourseFee = "0"; } if (Concession == "" || Concession == null) { Concession = "0"; } if (payableAmount == "" || payableAmount == null) { payableAmount = "0"; } if (PendingFee == "" || PendingFee == null) { PendingFee = "0"; } if (discountCBalance == "" || discountCBalance == null) { discountCBalance = "0"; } if (lateCBalance == "" || lateCBalance == null) { lateCBalance = "0"; } if (cashCBalance == "" || cashCBalance == null) { cashCBalance = "0"; } if (PaidFee == "" || PaidFee == null) { PaidFee = "0"; } if (LateFee == "" || LateFee == null) { LateFee = "0"; } if (OtherFee == "" || OtherFee == null) { OtherFee = "0"; } SqlCommand cmd = new SqlCommand("InsStudent", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@smSessionStartDate", StartDate); cmd.Parameters.AddWithValue("@studentName", Name); cmd.Parameters.AddWithValue("@studentRelation", Relation); cmd.Parameters.AddWithValue("@studentFatherName", FatherName); cmd.Parameters.AddWithValue("@motherName", MotherName); cmd.Parameters.AddWithValue("@studentDOB", DOB); cmd.Parameters.AddWithValue("@studentSex", Sex); cmd.Parameters.AddWithValue("@studentMarital", "Un-married"); cmd.Parameters.AddWithValue("@studentAddress", Address); cmd.Parameters.AddWithValue("@studentCity", City); cmd.Parameters.AddWithValue("@studentDistrict", Distt); cmd.Parameters.AddWithValue("@studentState", State); cmd.Parameters.AddWithValue("@studentPinCode", Pincode); cmd.Parameters.AddWithValue("@studentMobileNo", Mob); cmd.Parameters.AddWithValue("@studentPhone", PhoneNo); cmd.Parameters.AddWithValue("@studentEmail", Email); cmd.Parameters.AddWithValue("@pinBranchId", BranchID); cmd.Parameters.AddWithValue("@pinEmployeeId", EmployeeID); cmd.Parameters.AddWithValue("@photo", Photo); cmd.Parameters.AddWithValue("@documentProof", Document); cmd.Parameters.AddWithValue("@IdentityProofNo", identityProofNo); cmd.Parameters.AddWithValue("@smOrgId", Org); cmd.Parameters.AddWithValue("@smCourseId", CourseID); cmd.Parameters.AddWithValue("@smApplicationNo", ApplicationNo); cmd.Parameters.AddWithValue("@smFee", CourseFee); cmd.Parameters.AddWithValue("@ftOtherCharges", OtherFee); cmd.Parameters.AddWithValue("@ftLateFee", LateFee); cmd.Parameters.AddWithValue("@ftNetAmount", NetAmmount); cmd.Parameters.AddWithValue("@Concession", Concession); cmd.Parameters.AddWithValue("@payableAmount", payableAmount); cmd.Parameters.AddWithValue("@fmPendingAmount", PendingFee); cmd.Parameters.AddWithValue("@fmInsPaid", PaidFee); cmd.Parameters.AddWithValue("@ConcessionR", remark); cmd.Parameters.AddWithValue("@fmInsDueDate", DueDate); cmd.Parameters.AddWithValue("@ftPayDate", date); cmd.Parameters.AddWithValue("@paymentType", paymentType); cmd.Parameters.AddWithValue("@paymentBankType", paymentBankType); cmd.Parameters.AddWithValue("@bankId", bankId); cmd.Parameters.AddWithValue("@chequeNo", chequeNo); cmd.Parameters.AddWithValue("@bankDate", bankDate); cmd.Parameters.AddWithValue("@ChequeBankName", chequeBankName); cmd.Parameters.AddWithValue("@ChequeBranchName", chequeBranchName); cmd.Parameters.AddWithValue("@voucherType", voucherType); cmd.Parameters.AddWithValue("@cashCBalance", cashCBalance); if (bankCBalance != "") cmd.Parameters.AddWithValue("@bankCBalance", bankCBalance); if (accountCBalance != "") cmd.Parameters.AddWithValue("@accountCBalance", accountCBalance); if (headCBalance != "") cmd.Parameters.AddWithValue("@headCBalance", headCBalance); cmd.Parameters.AddWithValue("@discountCBalance", discountCBalance); cmd.Parameters.AddWithValue("@lateCBalance", lateCBalance); cmd.Parameters.AddWithValue("@ftFeeInWord", inw.IntoWord(Convert.ToInt32(payableAmount))); cmd.Parameters.AddWithValue("@userName", UserName); cmd.Parameters.AddWithValue("@catId", Category); cmd.Parameters.AddWithValue("@sMiddleName", studentMiddleName); cmd.Parameters.AddWithValue("@sLastName", studentLastName); cmd.Parameters.AddWithValue("@fMiddleName", fatherMiddleName); cmd.Parameters.AddWithValue("@fLastName", fatherLastName); string str1 = ""; string str = cmd.ExecuteScalar().ToString(); //string[] st = str.Split('!'); //string ss = branchsendname; //if (st[0].ToString() == "Successfully Done ") if (str.ToString() == "Successfully Entry") { nms_sms.cls_sms sms = new nms_sms.cls_sms(); // sms.SMSSend("Dear " + Name + " Welcome To AICVPS. Your admission has been done successfully with " + branchsendname + " ContactUs:" + branchcontact + " Helpline No: +(91) 83978 96006.", Mob1); // sms.SMSSend("Dear " + Name + " WELCOME TO GRAMIN SKILL. YOUR ADMISSION HAS BEEN DONE SUCCESSFULLY WITH " + branchsendname+ ".FOR ANY ASSISTANCE CONTACT YOUR GRAMIN SKILL BRANCH 00000-00000.", Mob1); str1 = "Admission is Successfully Done!"; } else { str1 = "Admission Unsuccessfull"; //str1 = "Sorry,You have not Enough Sufficient Balance!"; } cmd.Dispose(); con.Close(); return RAJ.Serialize(str1); //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string InsStudent1(string id, string CourseID, string Name, string Mob, string StartDate, string Relation, string FatherName, string DOB, string Sex, string Address, string City, string Distt, string State, string Pincode, string PhoneNo, string Email, string BranchID, string EmployeeID, string Photo, string Document, string Org, string ApplicationNo, string UserName, string MotherName, string Category, string CourseFee, string OtherFee, string LateFee, string NetAmmount, string Concession, string payableAmount, string PaidFee, string PendingFee, string remark, string date, string DueDate, string paymentType, string paymentBankType, string bankId, string chequeNo, string bankDate, string chequeBankName, string chequeBranchName, string voucherType, string cashCBalance, string bankCBalance, string accountCBalance, string headCBalance, string discountCBalance, string lateCBalance ) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); Function inw = new Function(); Int64 Mob1 = Int64.Parse(Mob); //DOB = DateTime.ParseExact(DOB, "yyyy-MM-dd", null).ToString("MM/dd/yyyy"); //StartDate = DateTime.ParseExact(StartDate, "yyyy-MM-dd", null).ToString("MM/dd/yyyy"); //if (DueDate != null && DueDate != "") //{ // DueDate = DateTime.ParseExact(DueDate, "yyyy-MM-dd", null).ToString("MM/dd/yyyy"); //} if (CourseFee == "" || CourseFee == null) { CourseFee = "0"; } if (Concession == "" || Concession == null) { Concession = "0"; } if (payableAmount == "" || payableAmount == null) { payableAmount = "0"; } if (PendingFee == "" || PendingFee == null) { PendingFee = "0"; } if (discountCBalance == "" || discountCBalance == null) { discountCBalance = "0"; } if (lateCBalance == "" || lateCBalance == null) { lateCBalance = "0"; } if (cashCBalance == "" || cashCBalance == null) { cashCBalance = "0"; } if (PaidFee == "" || PaidFee == null) { PaidFee = "0"; } if (LateFee == "" || LateFee == null) { LateFee = "0"; } if (OtherFee == "" || OtherFee == null) { OtherFee = "0"; } SqlCommand cmd = new SqlCommand("InsStudent1", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Id", id); cmd.Parameters.AddWithValue("@smSessionStartDate", StartDate); cmd.Parameters.AddWithValue("@studentName", Name); cmd.Parameters.AddWithValue("@studentRelation", Relation); cmd.Parameters.AddWithValue("@studentFatherName", FatherName); cmd.Parameters.AddWithValue("@motherName", MotherName); cmd.Parameters.AddWithValue("@studentDOB", DOB); cmd.Parameters.AddWithValue("@studentSex", Sex); cmd.Parameters.AddWithValue("@studentMarital", "Un-married"); cmd.Parameters.AddWithValue("@studentAddress", Address); cmd.Parameters.AddWithValue("@studentCity", City); cmd.Parameters.AddWithValue("@studentDistrict", Distt); cmd.Parameters.AddWithValue("@studentState", State); cmd.Parameters.AddWithValue("@studentPinCode", Pincode); cmd.Parameters.AddWithValue("@studentMobileNo", Mob); cmd.Parameters.AddWithValue("@studentPhone", PhoneNo); cmd.Parameters.AddWithValue("@studentEmail", Email); cmd.Parameters.AddWithValue("@pinBranchId", BranchID); cmd.Parameters.AddWithValue("@pinEmployeeId", EmployeeID); cmd.Parameters.AddWithValue("@photo", Photo); cmd.Parameters.AddWithValue("@documentProof", Document); cmd.Parameters.AddWithValue("@smOrgId", Org); cmd.Parameters.AddWithValue("@smCourseId", CourseID); cmd.Parameters.AddWithValue("@smApplicationNo", ApplicationNo); cmd.Parameters.AddWithValue("@smFee", CourseFee); cmd.Parameters.AddWithValue("@ftOtherCharges", OtherFee); cmd.Parameters.AddWithValue("@ftLateFee", LateFee); cmd.Parameters.AddWithValue("@ftNetAmount", NetAmmount); cmd.Parameters.AddWithValue("@Concession", Concession); cmd.Parameters.AddWithValue("@payableAmount", payableAmount); cmd.Parameters.AddWithValue("@fmPendingAmount", PendingFee); cmd.Parameters.AddWithValue("@fmInsPaid", PaidFee); cmd.Parameters.AddWithValue("@ConcessionR", remark); cmd.Parameters.AddWithValue("@fmInsDueDate", DueDate); cmd.Parameters.AddWithValue("@ftPayDate", date); cmd.Parameters.AddWithValue("@paymentType", paymentType); cmd.Parameters.AddWithValue("@paymentBankType", paymentBankType); cmd.Parameters.AddWithValue("@bankId", bankId); cmd.Parameters.AddWithValue("@chequeNo", chequeNo); cmd.Parameters.AddWithValue("@bankDate", bankDate); cmd.Parameters.AddWithValue("@ChequeBankName", chequeBankName); cmd.Parameters.AddWithValue("@ChequeBranchName", chequeBranchName); cmd.Parameters.AddWithValue("@voucherType", voucherType); cmd.Parameters.AddWithValue("@cashCBalance", cashCBalance); if (bankCBalance != "") cmd.Parameters.AddWithValue("@bankCBalance", bankCBalance); if (accountCBalance != "") cmd.Parameters.AddWithValue("@accountCBalance", accountCBalance); if (headCBalance != "") cmd.Parameters.AddWithValue("@headCBalance", headCBalance); cmd.Parameters.AddWithValue("@discountCBalance", discountCBalance); cmd.Parameters.AddWithValue("@lateCBalance", lateCBalance); cmd.Parameters.AddWithValue("@ftFeeInWord", inw.IntoWord(Convert.ToInt32(payableAmount))); cmd.Parameters.AddWithValue("@userName", UserName); cmd.Parameters.AddWithValue("@catId", Category); string str1 = ""; string str = cmd.ExecuteScalar().ToString(); string[] st = str.Split('!'); if (st[0].ToString() == "Successfully Entry" && Mob1 > 9) { //nms_sms.cls_sms sms = new nms_sms.cls_sms(); //sms.SMSSend("Dear " + Name + " Welcome To BASP. Your admission has been done successfully ContactUs: +(91) 83978 96006", Mob1); str1 = "Admission is Successfully Done!"; } else { str1 = "Sorry,You have not Enough Sufficient Balance!"; } cmd.Dispose(); con.Close(); return RAJ.Serialize(str1); //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updPayment(string id, string NetAmmount, string Concession, string payableAmount, string PaidFee, string PendingFee, string remark, string date, string paymentType, string paymentBankType, string bankId, string chequeNo, string bankDate, string chequeBankName, string chequeBranchName, string voucherType, string cashCBalance, string bankCBalance, string accountCBalance, string headCBalance, string discountCBalance, string lateCBalance ) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); Function inw = new Function(); if (Concession == "" || Concession == null) { Concession = "0"; } if (payableAmount == "" || payableAmount == null) { payableAmount = "0"; } if (PendingFee == "" || PendingFee == null) { PendingFee = "0"; } if (discountCBalance == "" || discountCBalance == null) { discountCBalance = "0"; } if (lateCBalance == "" || lateCBalance == null) { lateCBalance = "0"; } if (cashCBalance == "" || cashCBalance == null) { cashCBalance = "0"; } if (PaidFee == "" || PaidFee == null) { PaidFee = "0"; } SqlCommand cmd = new SqlCommand("updBranchPayment", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Id", id); cmd.Parameters.AddWithValue("@ftNetAmount", NetAmmount); cmd.Parameters.AddWithValue("@Concession", Concession); cmd.Parameters.AddWithValue("@payableAmount", payableAmount); cmd.Parameters.AddWithValue("@fmPendingAmount", PendingFee); cmd.Parameters.AddWithValue("@fmInsPaid", PaidFee); cmd.Parameters.AddWithValue("@ConcessionR", remark); cmd.Parameters.AddWithValue("@ftPayDate", date); cmd.Parameters.AddWithValue("@paymentType", paymentType); cmd.Parameters.AddWithValue("@paymentBankType", paymentBankType); cmd.Parameters.AddWithValue("@bankId", bankId); cmd.Parameters.AddWithValue("@chequeNo", chequeNo); cmd.Parameters.AddWithValue("@bankDate", bankDate); cmd.Parameters.AddWithValue("@ChequeBankName", chequeBankName); cmd.Parameters.AddWithValue("@ChequeBranchName", chequeBranchName); cmd.Parameters.AddWithValue("@voucherType", voucherType); cmd.Parameters.AddWithValue("@cashCBalance", cashCBalance); if (bankCBalance != "") cmd.Parameters.AddWithValue("@bankCBalance", bankCBalance); if (accountCBalance != "") cmd.Parameters.AddWithValue("@accountCBalance", accountCBalance); if (headCBalance != "") cmd.Parameters.AddWithValue("@headCBalance", headCBalance); cmd.Parameters.AddWithValue("@discountCBalance", discountCBalance); cmd.Parameters.AddWithValue("@lateCBalance", lateCBalance); cmd.Parameters.AddWithValue("@ftFeeInWord", inw.IntoWord(Convert.ToInt32(payableAmount))); string str1 = ""; string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str1); } //-----------Check Siblings-----------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string GetSiblings(string Name, string FName, string Course) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("GetSiblings", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Name", Name); cmd.Parameters.AddWithValue("@FatherName", FName); cmd.Parameters.AddWithValue("@courseName", Course); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.name = dr["studentName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------Check Sibling1 [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string GetSiblings1(string Name, string FName) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("GetSiblings1", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Name", Name); cmd.Parameters.AddWithValue("@FatherName", FName); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.courseName = dr["courseName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-----------------------Send for Confrimation-----------// //----------------View All Data for confirmation-------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewStudentDetailNew(string BranchID, string status, string PageIndex, string Pagesize) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer() { MaxJsonLength = 86753090 }; //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewStudentDetailNew", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchid", BranchID); cmd.Parameters.AddWithValue("@status", status); cmd.Parameters.AddWithValue("@PageNumber", PageIndex); cmd.Parameters.AddWithValue("@PageSize", Pagesize); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["studentCode"].ToString(); obj.name = dr["studentName"].ToString(); obj.fatherName = dr["studentFatherName"].ToString(); obj.StartDate = dr["Joiningdate"].ToString(); obj.city = dr["studentCity"].ToString(); obj.District = dr["studentDistrict"].ToString(); obj.CourseType = dr["courseName"].ToString(); obj.Organisation = dr["orgName"].ToString(); obj.status = dr["Status"].ToString(); obj.photo = dr["photo"].ToString(); obj.coursefee = dr["smFee"].ToString(); obj.branchName = dr["branchName"].ToString(); obj.loginName = dr["loginName"].ToString(); obj.rollNo = dr["loginSrNo"].ToString(); obj.Password = dr["password"].ToString(); obj.studentMobileNo = dr["studentMobileNo"].ToString(); obj.MotherName = dr["studentMother"].ToString(); obj.DOB = dr["DOB"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //------------------Update Student Profile------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string UpdStudent(string ID, string Name, string Mob, string StartDate, string Relation, string FatherName, string MotherName, string DOB, string Email, string Photo, string Category,string Addresse,string studentcity, string studentdistrict,string studentstate,string pincode) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("UpdStudent", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@studentCode", ID); cmd.Parameters.AddWithValue("@studentDate", StartDate); cmd.Parameters.AddWithValue("@studentName", Name); cmd.Parameters.AddWithValue("@studentRelation", Relation); if (Relation == "S/o") { cmd.Parameters.AddWithValue("@studentSex", "Male"); } else { cmd.Parameters.AddWithValue("@studentSex", "Female"); } cmd.Parameters.AddWithValue("@studentFatherName", FatherName); cmd.Parameters.AddWithValue("@studentDOB", DOB); cmd.Parameters.AddWithValue("@studentMarital", "Un-married"); //cmd.Parameters.AddWithValue("@studentAddress", Address); //cmd.Parameters.AddWithValue("@studentPinCode", Pincode); cmd.Parameters.AddWithValue("@studentMobileNo", Mob); //cmd.Parameters.AddWithValue("@studentPhone", PhoneNo); cmd.Parameters.AddWithValue("@studentEmail", Email); cmd.Parameters.AddWithValue("@photo", Photo); cmd.Parameters.AddWithValue("@studentAddress", Addresse); //cmd.Parameters.AddWithValue("@applicationNo", ApplicationNo); cmd.Parameters.AddWithValue("@motherName", MotherName); cmd.Parameters.AddWithValue("@catId", Category); cmd.Parameters.AddWithValue("@studentCity", studentcity); cmd.Parameters.AddWithValue("@studentDistrict", studentdistrict); //cmd.Parameters.AddWithValue("@applicationNo", ApplicationNo); cmd.Parameters.AddWithValue("@studentState", studentstate); cmd.Parameters.AddWithValue("@studentPinCode", pincode); string str1 = "Successfully Updated!"; string str = cmd.ExecuteScalar().ToString(); //string[] st = str.Split('!'); //if (st[0].ToString() == "Successfully Done") //{ // str1 = "Successfully Updated"; //} //else //{ // str1 = "Something went wrong!"; //} cmd.Dispose(); con.Close(); return RAJ.Serialize(str1); //} } //-------------------Request for Confirmation----- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string sendforconf(string StuID,string Mob) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("sendforconf", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", StuID); cmd.Parameters.AddWithValue("@status", 2); string str = cmd.ExecuteScalar().ToString(); Function inw = new Function(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //----------Delete Student------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string StudentStatus(string StuID) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("StudentStatus", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@studentid", StuID); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-------------Select Student Detail------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string selStudentDetail(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("selStudentDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@studentId", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["studentCode"].ToString(); obj.StartDate = dr["studentDate"].ToString(); obj.name = dr["studentName"].ToString(); obj.relation = dr["studentRelation"].ToString(); obj.fatherName = dr["studentFatherName"].ToString(); obj.MotherName = dr["studentMother"].ToString(); obj.catID = dr["studentCategory"].ToString(); obj.DOB = dr["studentDOB"].ToString(); obj.address = dr["studentAddress"].ToString(); obj.city = dr["studentCity"].ToString(); obj.city1 = dr["studentCity"].ToString(); obj.District = dr["studentDistrict"].ToString(); obj.Stid = dr["studentState"].ToString(); obj.pinCode = dr["studentPinCode"].ToString(); obj.mobNo = dr["studentMobileNo"].ToString(); obj.phoneNo = dr["studentPhone"].ToString(); obj.emailID = dr["studentEmail"].ToString(); obj.Applicationno = dr["smApplicationNo"].ToString(); obj.marital = dr["studentMarital"].ToString(); obj.photo = dr["photo"].ToString(); obj.document = dr["documentProof"].ToString(); obj.uniID = dr["orgId"].ToString(); obj.Organisation1 = dr["orgName"].ToString(); obj.CourseType = dr["cTypeName"].ToString(); obj.CourseType1 = dr["cTypeName"].ToString(); obj.CourseCategory = dr["catName"].ToString(); obj.CourseCategory1 = dr["catName"].ToString(); obj.codeId = dr["courseId"].ToString(); obj.courseName1 = dr["courseName"].ToString(); obj.Password = dr["loginAPassword"].ToString(); obj.status = dr["loginStatus"].ToString(); obj.loginName = dr["loginName"].ToString(); obj.DOJ = dr["DOJ"].ToString(); obj.security = dr["DOB"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //------------------remed Admission---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string ConfirmStudent(string EmpID, string BranchID, string StuID,string Mob,string password) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("ConfirmStudent", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@pinConBranchId", BranchID); cmd.Parameters.AddWithValue("@pinConEmployeeId", EmpID); cmd.Parameters.AddWithValue("@studentcodeid", StuID); Int64 Mob1=0; if (Mob != "" && Mob != null) { Mob1 = Int64.Parse(Mob); } string str = cmd.ExecuteScalar().ToString(); if (str.ToString() == "Successfully Done !" && Mob != "" && Mob != null) { nms_sms.cls_sms sms = new nms_sms.cls_sms(); sms.SMSSend("Dear Student, Welcome To IEDUP. Your admission has been done successfully ContactUs: +(91) 88960 03002", Mob1); //nms_sms.cls_sms1 sms = new nms_sms.cls_sms1(); // sms.SMSSend("Dear Student, Welcome To BASP. Your admission has been Confirmed Successfully. Your Student Id : " + StuID + " and password is:"+password+ " Helpline No: 01662-225440.", Mob); } Mob = ""; StuID = ""; password = ""; cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //---------------------Wallet Recharge-------------// //-------------Admin Recharge [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string AdminWalletRecharge(string BranchID, string Amount, string RechargeDate, string RechargeQuery) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("AdminWalletRecharge", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@RechBranchid", BranchID); cmd.Parameters.AddWithValue("@Ramount", Amount); cmd.Parameters.AddWithValue("@RDate", RechargeDate); cmd.Parameters.AddWithValue("@Remark", RechargeQuery); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-------------view Admin Wallet Detail------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string AdminfiveTran() { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("AdminfiveTran", con); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.RAmount = dr["Ramount"].ToString(); obj.StartDate = dr["RDate"].ToString(); obj.remark = dr["Remark"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //----------View Branch Waller Detail-----// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string BranchfiveTran(string BranchID, string Sts) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("BranchfiveTran", con); cmd.Parameters.AddWithValue("@Branchid", BranchID); cmd.Parameters.AddWithValue("@status", Sts); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.branchName = dr["RechargeBranch"].ToString(); obj.rechargeType = dr["rcType"].ToString(); obj.rechargeDate = dr["rcCreateDate"].ToString(); obj.balanceBeforeRecharge = dr["balanceBeforeRecharge"].ToString(); obj.rechargeBalance = dr["rcBalance"].ToString(); obj.balanceAfterRecharge = dr["balanceAfterRecharge"].ToString(); obj.carryforwardedBalance = dr["carryforwardedBalance"].ToString(); obj.validity = dr["Validity"].ToString(); obj.remark = dr["Remark"].ToString(); obj.rechargeBy = dr["RechargeBy"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //----------------Branch Recharge------ // [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string branchRecharge(string BranchID, string Amount, string RechargeDate, string RechargeQuery, string RechargeBy, string Status, string RechargedById) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("branchRecharge", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@rcBranchId", BranchID); cmd.Parameters.AddWithValue("@rcBalance", Amount); cmd.Parameters.AddWithValue("@validity", RechargeDate); cmd.Parameters.AddWithValue("@rcStatus", Status); cmd.Parameters.AddWithValue("@rcRechargedById", RechargedById); cmd.Parameters.AddWithValue("@Remark", RechargeQuery); cmd.Parameters.AddWithValue("@rcRechargedBy", RechargeBy); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-----------------Website Detail----------------// //--------------view Text category----------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewTextCategory(string OrgID, string Catid, string txtid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewTextCategory", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", OrgID); cmd.Parameters.AddWithValue("@catid", Catid); cmd.Parameters.AddWithValue("@txtcatid", txtid); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["id"].ToString(); obj.name = dr["name"].ToString(); obj.isActive = dr["isActive"].ToString(); obj.ActiveBranch = dr["sts"].ToString(); obj.catID = dr["txtmainCatid"].ToString(); obj.ImagePath = dr["Imgpath"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //------------------Insert--------------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insText(string OrgID, string TCatid, string Title, string SubTitle, string Description, string imagpath, string Status, string Pagetitle, string Pagekeyword, string Pagedescription) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("insText", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@textTitle", Title); cmd.Parameters.AddWithValue("@textsubtitle", SubTitle); cmd.Parameters.AddWithValue("@textImageUrl", imagpath); cmd.Parameters.AddWithValue("@textDescription", Description); cmd.Parameters.AddWithValue("@textuniID", OrgID); cmd.Parameters.AddWithValue("@textCatID", TCatid); cmd.Parameters.AddWithValue("@isActive", Status); cmd.Parameters.AddWithValue("@textpagetitle", Pagetitle); cmd.Parameters.AddWithValue("@textkeyword", Pagekeyword); cmd.Parameters.AddWithValue("@textseodescription", Pagedescription); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-----------------------Update---------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updText(string ID, string OrgID, string TCatid, string Title, string SubTitle, string Description, string imagpath, string Status, string Pagetitle, string Pagekeyword, string Pagedescription) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("updText", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@textID", ID); cmd.Parameters.AddWithValue("@textTitle", Title); cmd.Parameters.AddWithValue("@textsubtitle", SubTitle); cmd.Parameters.AddWithValue("@textImageUrl", imagpath); cmd.Parameters.AddWithValue("@textDescription", Description); cmd.Parameters.AddWithValue("@textuniID", OrgID); cmd.Parameters.AddWithValue("@textCatID", TCatid); cmd.Parameters.AddWithValue("@isActive", Status); cmd.Parameters.AddWithValue("@textpagetitle", Pagetitle); cmd.Parameters.AddWithValue("@textkeyword", Pagekeyword); cmd.Parameters.AddWithValue("@textseodescription", Pagedescription); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-----------------------View Text Detail--------------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewTextDetail(string OrgID, string CatID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewTextDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@uniid", OrgID); cmd.Parameters.AddWithValue("@textcatid", CatID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["textID"].ToString(); obj.title = dr["textTitle"].ToString(); obj.description = dr["textDescription"].ToString(); obj.uniID = dr["uniName"].ToString(); obj.isActive = dr["isActive"].ToString(); obj.catID = dr["txtCatName"].ToString(); obj.urlPath = dr["imagePath"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-----------------------Select Text Detail------------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string selText(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("selText", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@textID", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["textID"].ToString(); obj.title = dr["textTitle"].ToString(); obj.description = dr["textDescription"].ToString(); obj.uniID = dr["textuniID"].ToString(); obj.isActive = dr["isActive"].ToString(); obj.urlPath = dr["imagePath"].ToString(); obj.catID = dr["textCatID"].ToString(); obj.subtitle = dr["textsubtitle"].ToString(); obj.textpagetitle = dr["textpagetitle"].ToString(); obj.textkeyword = dr["textkeyword"].ToString(); obj.textseodescription = dr["textseodescription"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-------------Delete Text Detail-------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delText(string ID) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("delText", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@textID", ID); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //----------View Payment Deduction [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewPaymentDeductType() { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("viewPaymentDeductType", con); cmd.CommandType = CommandType.StoredProcedure; string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //----------------Insert Payment Detail-----------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string ins_tblpayment(string amount, string remark, string payname, string email, string mob, string country, string state, string city, string address, string zipcode, string currency) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("ins_tblpayment", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@paymentamount", amount); cmd.Parameters.AddWithValue("@paymentremark", remark); cmd.Parameters.AddWithValue("@paymentname", payname); cmd.Parameters.AddWithValue("@paymentmail", email); cmd.Parameters.AddWithValue("@paymentmob", mob); cmd.Parameters.AddWithValue("@paymentcountry", country); cmd.Parameters.AddWithValue("@paymentstate", state); cmd.Parameters.AddWithValue("@paymentcity", city); cmd.Parameters.AddWithValue("@paymentaddress", address); cmd.Parameters.AddWithValue("@paymentzip", zipcode); cmd.Parameters.AddWithValue("@paymentcurrency", currency); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-----------------------View Tax--------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string view_tblpayment(string id) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("view_tblpayment", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@paymentid", id); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.paymentid = dr["paymentid"].ToString(); obj.paymentamount = dr["paymentamount"].ToString(); obj.paymentremark = dr["paymentremark"].ToString(); obj.paymentname = dr["paymentname"].ToString(); obj.paymentmail = dr["paymentmail"].ToString(); obj.paymentmob = dr["paymentmob"].ToString(); obj.paymentcountry = dr["paymentcountry"].ToString(); obj.paymentstate = dr["paymentstate"].ToString(); obj.paymentcity = dr["paymentcity"].ToString(); obj.paymentaddress = dr["paymentaddress"].ToString(); obj.paymentzip = dr["paymentzip"].ToString(); obj.paymentcurrency = dr["paymentcurrency"].ToString(); obj.paymentstatus = dr["paymentstatus"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-----------------------------Get Max Detail------------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string view_maxid(string id) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("view_maxid", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@paymentid", id); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.paymentid = dr["paymentid"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------------------------Get New Max id----------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string view_newmaxid(string id) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("view_maxid", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@paymentid", id); string st = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); //} return st; } //------------------------------Get New Payment Detail-----------------// //-----------------------View Tax--------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public PRPSetup view_newtblpayment(PRPSetup p) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("view_tblpayment", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@paymentid", p.id); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj = new PRPSetup(); if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.paymentid = dr["paymentid"].ToString(); obj.paymentamount = dr["paymentamount"].ToString(); obj.paymentremark = dr["paymentremark"].ToString(); obj.paymentname = dr["paymentname"].ToString(); obj.paymentmail = dr["paymentmail"].ToString(); obj.paymentmob = dr["paymentmob"].ToString(); obj.paymentcountry = dr["paymentcountry"].ToString(); obj.paymentstate = dr["paymentstate"].ToString(); obj.paymentcity = dr["paymentcity"].ToString(); obj.paymentaddress = dr["paymentaddress"].ToString(); obj.paymentzip = dr["paymentzip"].ToString(); obj.paymentcurrency = dr["paymentcurrency"].ToString(); obj.paymentstatus = dr["paymentstatus"].ToString(); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return obj; } //---------------Bind All Student---------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string view_AllStudents(string id) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("view_AllStudents", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@flag", id); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.noOfRecord = dr["getme"].ToString(); obj.loginName = dr["metype"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-------Accounts Work.---------------- //----------Master Group------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewMasterAccountGroupDDL(string id) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("select magId, magName from MasterAccountGroup", con); // cmd.Parameters.AddWithValue("@mGroupId", id); SqlDataReader dr = cmd.ExecuteReader(); mgroup obj; if (dr.HasRows) { while (dr.Read()) { obj = new mgroup(); obj.id = dr["magId"].ToString(); obj.name = dr["magName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //----------Master Group------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewMasterAccountTypeDDL() { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("select macId, macName from MasterAccountCategory", con); // cmd.Parameters.AddWithValue("@mGroupId", id); SqlDataReader dr = cmd.ExecuteReader(); mgroup obj; if (dr.HasRows) { while (dr.Read()) { obj = new mgroup(); obj.id = dr["macId"].ToString(); obj.name = dr["macName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //-------- Master Leger. [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewMasterLedgerDDL(string groupId, string accountTypeId, string sessionId, string branchId, string sts, string branchId1) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); RAJ.MaxJsonLength = Int32.MaxValue; List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("viewMasterAccountDDL", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@groupId", groupId); cmd.Parameters.AddWithValue("@accountTypeId", accountTypeId); cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@grpId", branchId); cmd.Parameters.AddWithValue("@branchId", branchId1); cmd.Parameters.AddWithValue("@sts", sts); SqlDataReader dr = cmd.ExecuteReader(); mgroup obj; if (dr.HasRows) { while (dr.Read()) { obj = new mgroup(); obj.id = dr["mAccountId"].ToString(); obj.name = dr["mAccountName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //-------- Master Leger Detail. [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewMasterLedger(string groupId, string typeId, string accountId, string tId, string grpId) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("viewLedgerDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@groupId", groupId); cmd.Parameters.AddWithValue("@typeId", typeId); cmd.Parameters.AddWithValue("@ledgerId", accountId); cmd.Parameters.AddWithValue("@aTypeId", tId); cmd.Parameters.AddWithValue("@grpId", grpId); SqlDataReader dr = cmd.ExecuteReader(); account obj; if (dr.HasRows) { while (dr.Read()) { obj = new account(); obj.accountId = dr["mAccountId"].ToString(); obj.accountName = dr["mAccountName"].ToString(); obj.contactPerson = dr["mAccountPerson"].ToString(); obj.accountAddress = dr["mAccountAddress"].ToString(); obj.accountMobileNo = dr["mAccountMobileNo"].ToString(); obj.accountCategory = dr["categoryName"].ToString(); obj.accountGroupName = dr["groupName"].ToString(); obj.mAccountName = dr["RAccountName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //--------------------Cordinator Score-------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insMasterLedger(string accountName, string contactPerson, string address, string city, string state, string pinCode, string mobileNo, string phoneNo, string emailId, string gstNo, string groupId, string typeId, string RAccountId, string openingBalance, string sessionId, string categoryId, string relatedAccount, int grpId, int branchId) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("insMasterAccount", con); cmd.CommandType = CommandType.StoredProcedure; if (RAccountId == "") { RAccountId = null; } if (relatedAccount == "") { relatedAccount = null; } cmd.Parameters.AddWithValue("@accountName", accountName); cmd.Parameters.AddWithValue("@conactPerson", contactPerson); cmd.Parameters.AddWithValue("@accountAddress", address); cmd.Parameters.AddWithValue("@accountCity", city); cmd.Parameters.AddWithValue("@accountState", state); cmd.Parameters.AddWithValue("@accountPinCode", pinCode); cmd.Parameters.AddWithValue("@accountMobileNo", mobileNo); cmd.Parameters.AddWithValue("@accountPhoneNo", phoneNo); cmd.Parameters.AddWithValue("@accountEmailId", emailId); cmd.Parameters.AddWithValue("@accountGSTNo", gstNo); cmd.Parameters.AddWithValue("@typeId", typeId); cmd.Parameters.AddWithValue("@groupId", groupId); cmd.Parameters.AddWithValue("@RAccountId", RAccountId); cmd.Parameters.AddWithValue("@openingBalance", openingBalance); cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@categoryId", categoryId); cmd.Parameters.AddWithValue("@relatedAccountId", relatedAccount); cmd.Parameters.AddWithValue("@grpId", grpId); cmd.Parameters.AddWithValue("@branchId", branchId); string str = cmd.ExecuteScalar().ToString(); //string str = "Successfully Saved!"; cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //--------------------Cordinator Score-------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updMasterLedger(string accountId, string accountName, string contactPerson, string address, string city, string state, string pinCode, string mobileNo, string phoneNo, string emailId, string gstNo, string groupId, string typeId, string RAccountId, string openingBalance, string sessionId, string categoryId, string relatedAccount, int grpId, int branchId) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("updMasterAccount", con); cmd.CommandType = CommandType.StoredProcedure; if (RAccountId == "") { RAccountId = null; } cmd.Parameters.AddWithValue("@accountId", accountId); cmd.Parameters.AddWithValue("@accountName", accountName); cmd.Parameters.AddWithValue("@conactPerson", contactPerson); cmd.Parameters.AddWithValue("@accountAddress", address); cmd.Parameters.AddWithValue("@accountCity", city); cmd.Parameters.AddWithValue("@accountState", state); cmd.Parameters.AddWithValue("@accountPinCode", pinCode); cmd.Parameters.AddWithValue("@accountMobileNo", mobileNo); cmd.Parameters.AddWithValue("@accountPhoneNo", phoneNo); cmd.Parameters.AddWithValue("@accountEmailId", emailId); cmd.Parameters.AddWithValue("@accountGSTNo", gstNo); cmd.Parameters.AddWithValue("@typeId", typeId); cmd.Parameters.AddWithValue("@groupId", groupId); cmd.Parameters.AddWithValue("@RAccountId", RAccountId); cmd.Parameters.AddWithValue("@openingBalance", openingBalance); cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@categoryId", categoryId); cmd.Parameters.AddWithValue("@relatedAccountId", relatedAccount); cmd.Parameters.AddWithValue("@grpId", grpId); cmd.Parameters.AddWithValue("@branchId", branchId); string str = cmd.ExecuteScalar().ToString(); // string str = "Successfully Saved!"; cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //--------Sel Master Leger . [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string selMasterLedger(string Id, string sessionId) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("selMasterAccount", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@accountId", Id); cmd.Parameters.AddWithValue("@sessionId", sessionId); SqlDataReader dr = cmd.ExecuteReader(); account obj; if (dr.HasRows) { while (dr.Read()) { obj = new account(); obj.accountId = dr["mAccountId"].ToString(); obj.accountName = dr["mAccountName"].ToString(); obj.contactPerson = dr["mAccountPerson"].ToString(); obj.accountAddress = dr["mAccountAddress"].ToString(); obj.accountState = dr["mAccountState"].ToString(); obj.accountCity = dr["mAccountCity"].ToString(); obj.accountPinCode = dr["mAccountPinCode"].ToString(); obj.accountMobileNo = dr["mAccountMobileNo"].ToString(); obj.accountPhoneNo = dr["mAccountPhoneNo"].ToString(); obj.accountEmailid = dr["mAccountEmailId"].ToString(); obj.accountGSTNo = dr["mAccountGSTNo"].ToString(); obj.accountGroupId = dr["mAccountGroupId"].ToString(); obj.accountMasterTypeId = dr["mAccountCatId"].ToString(); obj.mAccountId = dr["mAccountReferenceId"].ToString(); obj.openingBalance = dr["mAccountOpeningBalance"].ToString(); obj.accountCategoryId = dr["mAccountType"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //---------------View Master Profile--------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delMasterLedger(string Id) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); String Query = @"if exists(select * from TransDayBook where tdbAccountId=@Id and tdbReferencesId is null) begin delete from TransDayBook where tdbAccountId=@Id; delete from TransOpeningBalance where tobAccountId=@Id;delete from masterAccount where mAccountId=@Id end else (select 'Group Cannot Be Delete')"; SqlCommand cmd = new SqlCommand(Query, con); cmd.Parameters.AddWithValue("@Id", Id); cmd.ExecuteNonQuery(); string str = "Successfully Deleted!"; cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //--------------------------Master Item Category---------------// //--------Insert [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insMasterItemCategory(string name) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("insert MasterItemCategory(micName, micIsActive) values(@micName,1)", con); cmd.Parameters.AddWithValue("@micName", name); cmd.ExecuteNonQuery(); string str = "Save Successfully!"; cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //------Update [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updMasterItemCategory(string name, string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("update MasterItemCategory set micName=@micName where micId=@micId", con); cmd.Parameters.AddWithValue("@micName", name); cmd.Parameters.AddWithValue("@micId", ID); cmd.ExecuteNonQuery(); string str = "Save Successfully!"; cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //--------View- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewMasterItemCategory() { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("select micId,micName from MasterItemCategory", con); cmd.CommandType = CommandType.Text; SqlDataReader dr = cmd.ExecuteReader(); mItemCategory obj; if (dr.HasRows) { while (dr.Read()) { obj = new mItemCategory(); obj.micId = dr["micId"].ToString(); obj.micName = dr["micName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //--------View- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewMasterItemType() { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("select mitId,mitName from MasterItemType", con); cmd.CommandType = CommandType.Text; SqlDataReader dr = cmd.ExecuteReader(); mItemCategory obj; if (dr.HasRows) { while (dr.Read()) { obj = new mItemCategory(); obj.micId = dr["mitId"].ToString(); obj.micName = dr["mitName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //-----Select [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string selMasterItemCategory(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("select micId,micName from MasterItemCategory where micId=" + ID + "", con); cmd.CommandType = CommandType.Text; SqlDataReader dr = cmd.ExecuteReader(); mItemCategory obj; if (dr.HasRows) { while (dr.Read()) { obj = new mItemCategory(); obj.micId = dr["micId"].ToString(); obj.micName = dr["micName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //------------------------Master Item Measurment-----------// //--------Insert [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insMasterItemMeasurment(string name) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("insert MasterItemMeasurment(mimName) values(@mimName)", con); cmd.Parameters.AddWithValue("@mimName", name); cmd.ExecuteNonQuery(); string str = "Save Successfully!"; cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //------Update [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updMasterItemMeasurment(string name, string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("update MasterItemMeasurment set mimName=@mimName where mimId=@mimId", con); cmd.Parameters.AddWithValue("@mimName", name); cmd.Parameters.AddWithValue("@mimId", ID); cmd.ExecuteNonQuery(); string str = "Save Successfully!"; cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //--------View- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewMasterItemMeasurment() { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("select mimId,mimName from MasterItemMeasurment", con); cmd.CommandType = CommandType.Text; SqlDataReader dr = cmd.ExecuteReader(); mMasterItemMeasurment obj; if (dr.HasRows) { while (dr.Read()) { obj = new mMasterItemMeasurment(); obj.mimId = dr["mimId"].ToString(); obj.mimName = dr["mimName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //-----Select [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string selMasterItemMeasurment(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("select mimId,mimName from MasterItemMeasurment where mimId=" + ID + "", con); cmd.CommandType = CommandType.Text; SqlDataReader dr = cmd.ExecuteReader(); mMasterItemMeasurment obj; if (dr.HasRows) { while (dr.Read()) { obj = new mMasterItemMeasurment(); obj.mimId = dr["mimId"].ToString(); obj.mimName = dr["mimName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //------------------------Master Tax-------------// //--------Insert [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insMasterTax(string name, string IGST, string CGST, string SGST) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("insert MasterTax(mTaxName,mTaxIGST,mTaxCGST,mTaxSGST) values(@mTaxName,@mTaxIGST,@mTaxCGST,@mTaxSGST)", con); cmd.Parameters.AddWithValue("@mTaxName", name); cmd.Parameters.AddWithValue("@mTaxIGST", IGST); cmd.Parameters.AddWithValue("@mTaxCGST", CGST); cmd.Parameters.AddWithValue("@mTaxSGST", SGST); cmd.ExecuteNonQuery(); string str = "Save Successfully!"; cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //------Update [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updMasterTax(string name, string IGST, string ID, string CGST, string SGST) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("update MasterTax set mTaxName=@mTaxName,mTaxIGST=@mTaxIGST,mTaxCGST=@mTaxCGST,mTaxSGST=@mTaxSGST where mTaxId=@mTaxId", con); cmd.Parameters.AddWithValue("@mTaxName", name); cmd.Parameters.AddWithValue("@mTaxIGST", IGST); cmd.Parameters.AddWithValue("@mTaxId", ID); cmd.Parameters.AddWithValue("@mTaxCGST", CGST); cmd.Parameters.AddWithValue("@mTaxSGST", SGST); cmd.ExecuteNonQuery(); string str = "Save Successfully!"; cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //--------View- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewMasterTax() { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("select mTaxId,mTaxName,mTaxIGST,mTaxCGST,mTaxSGST from MasterTax", con); cmd.CommandType = CommandType.Text; SqlDataReader dr = cmd.ExecuteReader(); mTax obj; if (dr.HasRows) { while (dr.Read()) { obj = new mTax(); obj.mTaxId = dr["mTaxId"].ToString(); obj.mTaxName = dr["mTaxName"].ToString(); obj.mTaxIGST = dr["mTaxIGST"].ToString(); obj.mTaxCGST = dr["mTaxCGST"].ToString(); obj.mTaxSGST = dr["mTaxSGST"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //-----Select [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string selMasterTax(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("select mTaxId,mTaxName,mTaxIGST,mTaxCGST,mTaxSGST from MasterTax where mTaxId=" + ID + "", con); cmd.CommandType = CommandType.Text; SqlDataReader dr = cmd.ExecuteReader(); mTax obj; if (dr.HasRows) { while (dr.Read()) { obj = new mTax(); obj.mTaxId = dr["mTaxId"].ToString(); obj.mTaxName = dr["mTaxName"].ToString(); obj.mTaxIGST = dr["mTaxIGST"].ToString(); obj.mTaxCGST = dr["mTaxCGST"].ToString(); obj.mTaxSGST = dr["mTaxSGST"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //-------------------Master Item------------// //--Insert [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insMasterItem(string itemtype, string itemcat, string name, string itemunit, string itemtax, string MRP, string Rate, string SalePrice, string openingStock, string sessionId, string trackingId, string alertDays, string taxName, string measurmentName, string type, string Hsn ) { try { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("insMasterItem", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@HSNNo", Hsn); //cmd.Parameters.AddWithValue("@mItemTypeId", itemtype); cmd.Parameters.AddWithValue("@mItemCategoryId", itemcat); cmd.Parameters.AddWithValue("@mItemMeasurementId", itemunit); cmd.Parameters.AddWithValue("@mItemTaxId", itemtax); cmd.Parameters.AddWithValue("@mItemName", name); cmd.Parameters.AddWithValue("@mItemMRP", MRP); cmd.Parameters.AddWithValue("@openingStock", openingStock); cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@trackingId", trackingId); cmd.Parameters.AddWithValue("@alertDays", alertDays); cmd.Parameters.AddWithValue("@mItemTax", taxName); cmd.Parameters.AddWithValue("@mItemMeasurment", measurmentName); cmd.Parameters.AddWithValue("@type", type); if (Rate != null && Rate != "") { cmd.Parameters.AddWithValue("@mItemRate", Rate); } else { cmd.Parameters.AddWithValue("@mItemRate", null); } cmd.Parameters.AddWithValue("@mItemSalePrice", SalePrice); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } catch (Exception ex) { string str = ex.Message; return str; } } //----Update [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updMasterItem(string ID, string itemtype, string itemcat, string name, string itemunit, string itemtax, string MRP, string Rate, string SalePrice, string trackingId, string alertDays, string taxName, string measurmentName) { try { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("updMasterItem", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@mItemId", ID); // cmd.Parameters.AddWithValue("@mItemTypeId", itemtype); cmd.Parameters.AddWithValue("@mItemCategoryId", itemcat); cmd.Parameters.AddWithValue("@mItemName", name); cmd.Parameters.AddWithValue("@mItemMRP", MRP); cmd.Parameters.AddWithValue("@trackingId", trackingId); cmd.Parameters.AddWithValue("@alertDays", alertDays); if (Rate != null && Rate != "") { cmd.Parameters.AddWithValue("@mItemRate", Rate); } else { cmd.Parameters.AddWithValue("@mItemRate", null); } if (itemunit != null && itemunit != "") { cmd.Parameters.AddWithValue("@mItemMeasurementId", itemunit); } else { cmd.Parameters.AddWithValue("@mItemMeasurementId", null); } if (itemtax != null && itemtax != "") { cmd.Parameters.AddWithValue("@mItemTaxId", itemtax); } else { cmd.Parameters.AddWithValue("@mItemTaxId", null); } cmd.Parameters.AddWithValue("@mItemTax", taxName); cmd.Parameters.AddWithValue("@mItemMeasurment", measurmentName); cmd.Parameters.AddWithValue("@mItemSalePrice", SalePrice); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } catch (Exception ex) { string str = ex.Message; return str; } } //--------View [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewMasterItem(string categoryId) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("viewMasterItem", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@categoryId", categoryId); SqlDataReader dr = cmd.ExecuteReader(); mItem obj; if (dr.HasRows) { while (dr.Read()) { obj = new mItem(); obj.mItemId = dr["mItemId"].ToString(); obj.micid = dr["micid"].ToString(); obj.mimId = dr["mimId"].ToString(); obj.mTaxId = dr["mTaxId"].ToString(); obj.micName = dr["micName"].ToString(); obj.mimName = dr["mimName"].ToString(); obj.mTaxName = dr["Tax"].ToString(); obj.mItemName = dr["mItemName"].ToString(); obj.mItemMRP = dr["mItemMRP"].ToString(); obj.mItemRate = dr["mItemRate"].ToString(); obj.mItemSalePrice = dr["mItemSalePrice"].ToString(); obj.tracking = dr["mItemTracking"].ToString(); obj.alertDays = dr["mItemAlertDays"].ToString(); obj.openingStock = dr["openingStock"].ToString(); //obj.mitName = dr["mitName"].ToString(); // obj.mitId = dr["typeId"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //--------View [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewMasterItemDetail(string sessionId, string BranchId) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("viewItemDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@branchId", BranchId); SqlDataReader dr = cmd.ExecuteReader(); mItem obj; if (dr.HasRows) { while (dr.Read()) { obj = new mItem(); obj.mItemId = dr["mItemId"].ToString(); obj.mItemName = dr["mItemName"].ToString(); obj.mItemRate = dr["mItemRate"].ToString(); obj.mItemMRP = dr["mItemMRP"].ToString(); obj.mItemSalePrice = dr["mItemSalePrice"].ToString(); obj.mTaxName = dr["mTaxSlab"].ToString(); obj.mimName = dr["mimName"].ToString(); obj.mItemQnty = dr["mItemAvailableStock"].ToString(); obj.openingStock = dr["OpeningStock"].ToString(); obj.mItemPerQnty = dr["Purchase"].ToString(); obj.Query = dr["Sale"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //---------View Expence Item [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewMasterExpItem() { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("viewMasterExpItem", con); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader dr = cmd.ExecuteReader(); mItem obj; if (dr.HasRows) { while (dr.Read()) { obj = new mItem(); obj.mItemId = dr["mItemId"].ToString(); obj.micid = dr["micid"].ToString(); obj.mimId = dr["mimId"].ToString(); obj.micName = dr["micName"].ToString(); obj.mimName = dr["mimName"].ToString(); obj.mItemName = dr["mItemName"].ToString(); obj.mItemMRP = dr["mItemMRP"].ToString(); obj.mItemRate = dr["mItemRate"].ToString(); obj.mItemSalePrice = dr["mItemSalePrice"].ToString(); obj.tracking = dr["mItemTracking"].ToString(); obj.alertDays = dr["mItemAlertDays"].ToString(); obj.mitName = dr["typeName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //--------Select [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string selMasterItem(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("select mItemId,mItemName,mItemMeasurmentId, isnull(mTaxIGST,0) mTaxIGST, isnull(mimName,'') mimName, mItemcategoryId,mItemTypeId,mItemMRP,mItemRate,mItemSalePrice, mItemTracking, mItemAlertDays,mItemAvailableStock Quantity, tInventoryMeasurment measurment, tInventoryTax tax,mItemTaxId,mHSNNo from MasterItem left join masterItemDetail on mItemId=midItemId left Join MasterTax on mItemTaxId=mTaxId left join MasterItemMeasurment on mimId=mItemMeasurmentId left join TransInventory on tInventoryItemId=mItemId and tInventoryTransType='Opening Stock' where mItemId=" + ID + "", con); cmd.CommandType = CommandType.Text; SqlDataReader dr = cmd.ExecuteReader(); mItem obj; if (dr.HasRows) { while (dr.Read()) { obj = new mItem(); obj.mItemId = dr["mItemId"].ToString(); obj.mItemName = dr["mItemName"].ToString(); obj.mimId = dr["mItemMeasurmentId"].ToString(); obj.mTaxId = dr["mTaxIGST"].ToString(); obj.micid = dr["mItemcategoryId"].ToString(); obj.mItemMRP = dr["mItemMRP"].ToString(); obj.mItemRate = dr["mItemRate"].ToString(); obj.mItemSalePrice = dr["mItemSalePrice"].ToString(); obj.tracking = dr["mItemTracking"].ToString(); obj.alertDays = dr["mItemAlertDays"].ToString(); obj.mTaxName = dr["tax"].ToString(); obj.micName = dr["measurment"].ToString(); obj.mimName = dr["mimName"].ToString(); obj.openingStock = dr["Quantity"].ToString(); obj.mitId = dr["mItemTypeId"].ToString(); obj.mItemTaxId = dr["mItemTaxId"].ToString(); obj.mHSNNo = dr["mHSNNo"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //--------View [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewMasterItemDDL(string categoryId) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("viewMasterItemDDL", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@categoryId", categoryId); SqlDataReader dr = cmd.ExecuteReader(); mItem obj; if (dr.HasRows) { while (dr.Read()) { obj = new mItem(); obj.id = dr["id"].ToString(); obj.name = dr["name"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //--------Get Account Balance //[OperationContract] //[WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] //public string getAccountBalance(string ledgerId, string sessionId, string branchId, string type) //{ // System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); // List lst = new List(); // con.Open(); // SqlCommand cmd = new SqlCommand("currentBalance", con); // cmd.CommandType = CommandType.StoredProcedure; // cmd.Parameters.AddWithValue("@ledgerId", ledgerId); // cmd.Parameters.AddWithValue("@sessionId", sessionId); // cmd.Parameters.AddWithValue("@branchId", branchId); // cmd.Parameters.AddWithValue("@typeId", type); // string dr = cmd.ExecuteScalar().ToString(); // return RAJ.Serialize(dr); //} //--------View- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewMasterVoucherDDL() { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("select mvtId, mvtName from MasterVoucherType", con); cmd.CommandType = CommandType.Text; SqlDataReader dr = cmd.ExecuteReader(); mItem obj; if (dr.HasRows) { while (dr.Read()) { obj = new mItem(); obj.id = dr["mvtId"].ToString(); obj.name = dr["mvtName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //-------------------Get Student Fee.---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insertExpanse(string detail, string accountId, string transType, string netAmount, string payableAmount, string payNow, string concession, string balanceAmount, string date, string paymentType, string paymentBankType, string bankId, string chequeNo, string bankDate, string branchId, string branchType, string sessionId, string staffId, string accountHeadId, string remark, string voucherType, string cashCBalance, string bankCBalance, string accountCBalance, string headCBalance, string discountCBalance, string groupId) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("insExpenseEntry", con); cmd.CommandType = CommandType.StoredProcedure; if (bankId == null || bankId == "") { bankId = null; } if (bankDate == null || bankDate == "") bankDate = null; if (date == null || date == "") date = null; if (discountCBalance == null || discountCBalance == "") discountCBalance = null; if (headCBalance == null || headCBalance == "") headCBalance = null; if (accountCBalance == null || accountCBalance == "") accountCBalance = null; cmd.Parameters.AddWithValue("@detail", detail); cmd.Parameters.AddWithValue("@accountId", accountId); cmd.Parameters.AddWithValue("@transType", transType); cmd.Parameters.AddWithValue("@netAmount", netAmount); cmd.Parameters.AddWithValue("@payableAmount", payableAmount); cmd.Parameters.AddWithValue("@payNow", payNow); cmd.Parameters.AddWithValue("@discount", concession); cmd.Parameters.AddWithValue("@Balance", balanceAmount); cmd.Parameters.AddWithValue("@date", date); cmd.Parameters.AddWithValue("@paymentType", paymentType); cmd.Parameters.AddWithValue("@paymentBankType", paymentBankType); cmd.Parameters.AddWithValue("@bankId", bankId); cmd.Parameters.AddWithValue("@UTRNo", chequeNo); cmd.Parameters.AddWithValue("@bankDate", bankDate); cmd.Parameters.AddWithValue("@branchId", branchId); cmd.Parameters.AddWithValue("@branchType", branchType); cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@staffId", staffId); cmd.Parameters.AddWithValue("@accountHeadId", accountHeadId); cmd.Parameters.AddWithValue("@remark", remark); cmd.Parameters.AddWithValue("@voucherType", voucherType); cmd.Parameters.AddWithValue("@cashCBalance", cashCBalance); cmd.Parameters.AddWithValue("@bankCBalance", bankCBalance); cmd.Parameters.AddWithValue("@accountCBalance", accountCBalance); cmd.Parameters.AddWithValue("@headCBalance", headCBalance); cmd.Parameters.AddWithValue("@discountCBalance", discountCBalance); // cmd.Parameters.AddWithValue("@groupId", groupId); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //-------------------Get Student Fee.---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insertSale(string detail, string accountId, string transType, string netAmount, string payableAmount, string payNow, string concession, string balanceAmount, string date, string paymentType, string paymentBankType, string bankId, string chequeNo, string bankDate, string branchId, string branchType, string sessionId, string staffId, string accountHeadId, string remark, string voucherType, string cashCBalance, string bankCBalance, string accountCBalance, string headCBalance, string discountCBalance, string groupId) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("insSaleEntry", con); cmd.CommandType = CommandType.StoredProcedure; if (bankId == null || bankId == "") { bankId = null; } if (bankDate == null || bankDate == "") bankDate = null; if (date == null || date == "") date = null; if (discountCBalance == null || discountCBalance == "") discountCBalance = null; if (headCBalance == null || headCBalance == "") headCBalance = null; if (accountCBalance == null || accountCBalance == "") accountCBalance = null; cmd.Parameters.AddWithValue("@detail", detail); cmd.Parameters.AddWithValue("@accountId", accountId); cmd.Parameters.AddWithValue("@transType", transType); cmd.Parameters.AddWithValue("@netAmount", netAmount); cmd.Parameters.AddWithValue("@payableAmount", payableAmount); cmd.Parameters.AddWithValue("@payNow", payNow); cmd.Parameters.AddWithValue("@discount", concession); cmd.Parameters.AddWithValue("@Balance", balanceAmount); cmd.Parameters.AddWithValue("@date", date); cmd.Parameters.AddWithValue("@paymentType", paymentType); cmd.Parameters.AddWithValue("@paymentBankType", paymentBankType); cmd.Parameters.AddWithValue("@bankId", bankId); cmd.Parameters.AddWithValue("@UTRNo", chequeNo); cmd.Parameters.AddWithValue("@bankDate", bankDate); cmd.Parameters.AddWithValue("@branchId", branchId); cmd.Parameters.AddWithValue("@branchType", branchType); cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@staffId", staffId); cmd.Parameters.AddWithValue("@accountHeadId", accountHeadId); cmd.Parameters.AddWithValue("@remark", remark); cmd.Parameters.AddWithValue("@voucherType", voucherType); cmd.Parameters.AddWithValue("@cashCBalance", cashCBalance); cmd.Parameters.AddWithValue("@bankCBalance", bankCBalance); cmd.Parameters.AddWithValue("@accountCBalance", accountCBalance); cmd.Parameters.AddWithValue("@headCBalance", headCBalance); cmd.Parameters.AddWithValue("@discountCBalance", discountCBalance); // cmd.Parameters.AddWithValue("@groupId", groupId); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //-------------------View Ledger.---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string VoucherDetail(string sessionId, string schoolId, string fundId) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("viewVoucher", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@branchId", schoolId); cmd.Parameters.AddWithValue("@fundId", fundId); SqlDataReader dr = cmd.ExecuteReader(); clsAccount obj; if (dr.HasRows) { while (dr.Read()) { obj = new clsAccount(); obj.id = dr["tdbId"].ToString(); obj.particular = dr["masterAccount"].ToString(); obj.voucherNo = dr["voucherNo"].ToString(); obj.voucherType = dr["voucherName"].ToString(); obj.transType = dr["transType"].ToString(); obj.credit = dr["Credit"].ToString(); obj.debit = dr["Debit"].ToString(); obj.date = dr["Date1"].ToString(); obj.remark = dr["Remark"].ToString(); obj.accountName = dr["mAccountName"].ToString(); // obj.SchoolId = dr["mSchoolName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //-------------------Get Student Fee.---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insertReceviedPayment(string accountId, string transType, string netAmount, string payNow, string date, string paymentType, string paymentBankType, string bankId, string balance, string chequeNo, string bankDate, string branchId, string branchType, string sessionId, string staffId, string accountHeadId, string remark, string voucherType, string cashCBalance, string bankCBalance, string accountCBalance, string headCBalance, string groupId) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("insReceviedPayment", con); cmd.CommandType = CommandType.StoredProcedure; if (bankId == null || bankId == "") { bankId = null; } if (bankDate == null || bankDate == "") bankDate = null; if (date == null || date == "") date = null; if (accountCBalance == null || accountCBalance == "") { accountCBalance = null; } cmd.Parameters.AddWithValue("@accountId", accountId); cmd.Parameters.AddWithValue("@transType", transType); cmd.Parameters.AddWithValue("@payableAmount", netAmount); cmd.Parameters.AddWithValue("@payNow", payNow); cmd.Parameters.AddWithValue("@date", date); cmd.Parameters.AddWithValue("@paymentType", paymentType); cmd.Parameters.AddWithValue("@paymentBankType", paymentBankType); cmd.Parameters.AddWithValue("@bankId", bankId); cmd.Parameters.AddWithValue("@UTRNo", chequeNo); cmd.Parameters.AddWithValue("@bankDate", bankDate); cmd.Parameters.AddWithValue("@branchId", branchId); cmd.Parameters.AddWithValue("@Balance", balance); // cmd.Parameters.AddWithValue("@branchType", branchType); cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@staffId", staffId); cmd.Parameters.AddWithValue("@accountHeadId", accountHeadId); cmd.Parameters.AddWithValue("@remark", remark); cmd.Parameters.AddWithValue("@voucherType", voucherType); if (cashCBalance == null && cashCBalance == "") { cmd.Parameters.AddWithValue("@cashCBalance", 0.00); } else { cmd.Parameters.AddWithValue("@cashCBalance", cashCBalance); } if (bankCBalance == null && bankCBalance == "") { cmd.Parameters.AddWithValue("@bankCBalance", 0.00); } else { cmd.Parameters.AddWithValue("@bankCBalance", bankCBalance); } if (accountCBalance == null && accountCBalance == "") { cmd.Parameters.AddWithValue("@accountCBalance", 0.00); } else { cmd.Parameters.AddWithValue("@accountCBalance", accountCBalance); } //if (headCBalance == null && headCBalance == "") cmd.Parameters.AddWithValue("@headCBalance", 0.00); // cmd.Parameters.AddWithValue("@headCBalance", headCBalance); cmd.Parameters.AddWithValue("@groupId1", groupId); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //-------------------Get Student Fee.---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insertPaidPayment(string accountId, string transType, string netAmount, string payNow, string date, string paymentType, string paymentBankType, string bankId, string balance, string chequeNo, string bankDate, string branchId, string branchType, string sessionId, string staffId, string accountHeadId, string remark, string voucherType, string cashCBalance, string bankCBalance, string accountCBalance, string headCBalance, string groupId) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("insPaidPayment", con); cmd.CommandType = CommandType.StoredProcedure; if (bankId == null || bankId == "") { bankId = null; } if (bankDate == null || bankDate == "") bankDate = null; if (date == null || date == "") date = null; if (headCBalance == null || headCBalance == "") headCBalance = null; cmd.Parameters.AddWithValue("@accountId", accountId); cmd.Parameters.AddWithValue("@transType", transType); cmd.Parameters.AddWithValue("@payableAmount", netAmount); cmd.Parameters.AddWithValue("@payNow", payNow); cmd.Parameters.AddWithValue("@date", date); cmd.Parameters.AddWithValue("@paymentType", paymentType); cmd.Parameters.AddWithValue("@paymentBankType", paymentBankType); cmd.Parameters.AddWithValue("@bankId", bankId); cmd.Parameters.AddWithValue("@UTRNo", chequeNo); cmd.Parameters.AddWithValue("@bankDate", bankDate); cmd.Parameters.AddWithValue("@branchId", branchId); cmd.Parameters.AddWithValue("@Balance", balance); // cmd.Parameters.AddWithValue("@branchType", branchType); cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@staffId", staffId); cmd.Parameters.AddWithValue("@accountHeadId", accountHeadId); cmd.Parameters.AddWithValue("@remark", remark); cmd.Parameters.AddWithValue("@voucherType", voucherType); if (cashCBalance == null && cashCBalance == "") { cmd.Parameters.AddWithValue("@cashCBalance", 0.00); } else { cmd.Parameters.AddWithValue("@cashCBalance", cashCBalance); } if (bankCBalance == null && bankCBalance == "") { cmd.Parameters.AddWithValue("@bankCBalance", 0.00); } else { cmd.Parameters.AddWithValue("@bankCBalance", bankCBalance); } if (accountCBalance == null && accountCBalance == "") { cmd.Parameters.AddWithValue("@accountCBalance", 0.00); } else { cmd.Parameters.AddWithValue("@accountCBalance", accountCBalance); } cmd.Parameters.AddWithValue("@headCBalance", headCBalance); cmd.Parameters.AddWithValue("@groupId1", groupId); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //-------------------View Day Book.---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewDayBook(string sessionId, string schoolId, string crossEntry, string startDate, string endDate) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("viewDayBook", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@schoolId", schoolId); cmd.Parameters.AddWithValue("@crossEntry", crossEntry); cmd.Parameters.AddWithValue("@startDate", startDate); cmd.Parameters.AddWithValue("@endDate", endDate); SqlDataReader dr = cmd.ExecuteReader(); clsAccount obj; if (dr.HasRows) { while (dr.Read()) { obj = new clsAccount(); obj.id = dr["tFundId"].ToString(); obj.particular = dr["masterAccount"].ToString(); obj.voucherNo = dr["voucherNo"].ToString(); obj.voucherType = dr["voucherName"].ToString(); obj.transType = dr["transType"].ToString(); obj.credit = dr["Credit"].ToString(); obj.debit = dr["Debit"].ToString(); obj.date = dr["Date1"].ToString(); obj.remark = dr["Remark"].ToString(); obj.accountName = dr["mAccountName"].ToString(); obj.SchoolId = dr["mSchoolName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //----------------DayBookdelete satpal [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delDayBook(string sessionId, string schoolId, string fundId, string delType, string remark) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("delDayBookEntry1", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@branchId", schoolId); cmd.Parameters.AddWithValue("@fundId", fundId); cmd.Parameters.AddWithValue("@delType", delType); cmd.Parameters.AddWithValue("@remark", remark); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //-------------------View Day Book.---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string TrailBalance(string sessionId, string schoolId, string status) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("TrailBalance", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@branchId", schoolId); //cmd.Parameters.AddWithValue("@paymentType", status); SqlDataReader dr = cmd.ExecuteReader(); clsAccount obj; if (dr.HasRows) { while (dr.Read()) { obj = new clsAccount(); obj.id = dr["magId"].ToString(); obj.accountName = dr["accountName"].ToString(); obj.debit = dr["Debit"].ToString(); obj.credit = dr["Credit"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //--------------TrailDeatil------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string TrailBalanceDetail(string sessionId, string schoolId, string groupId) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("TrailBalanceDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@branchId", schoolId); cmd.Parameters.AddWithValue("@groupId", groupId); SqlDataReader dr = cmd.ExecuteReader(); clsAccount obj; if (dr.HasRows) { while (dr.Read()) { obj = new clsAccount(); obj.id = dr["mAccountId"].ToString(); obj.accountName = dr["accountName"].ToString(); obj.debit = dr["Debit"].ToString(); obj.credit = dr["Credit"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //------------------Ledger Detail1.---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string LedgerDetail1(string sessionId, string schoolId, string ledgerId, string startDate, string endDate) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("viewLedger", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@ledgerId", ledgerId); clsAccount obj; SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { obj = new clsAccount(); obj.id = dr["tdbId"].ToString(); obj.particular = dr["mAccountName"].ToString(); obj.voucherNo = dr["voucherNo"].ToString(); obj.voucherType = dr["voucherName"].ToString(); obj.transType = dr["transType"].ToString(); obj.credit = dr["Credit"].ToString(); obj.debit = dr["Debit"].ToString(); obj.date = dr["Date1"].ToString(); obj.remark = dr["Remark"].ToString(); obj.accountName = dr["masterAccount"].ToString(); // obj.SchoolId = dr["mSchoolName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //-------------------View Day Book.---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string plAccount(string sessionId, string schoolId, string status) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("PLAccount", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@branchId", schoolId); // cmd.Parameters.AddWithValue("@paymentType", status); SqlDataReader dr = cmd.ExecuteReader(); clsAccount obj; if (dr.HasRows) { while (dr.Read()) { obj = new clsAccount(); obj.id = dr["magId"].ToString(); obj.accountName = dr["accountName"].ToString(); obj.credit = dr["Credit"].ToString(); obj.debit = dr["Debit"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //-------------------View Day Book.---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string IncomeExpenditure(string sessionId, string schoolId, string status) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("IncomeExpenditure", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@branchId", schoolId); cmd.Parameters.AddWithValue("@paymentType", status); SqlDataReader dr = cmd.ExecuteReader(); clsAccount obj; if (dr.HasRows) { while (dr.Read()) { obj = new clsAccount(); obj.id = dr["mAccountId"].ToString(); obj.particular = dr["GroupName"].ToString(); obj.credit = dr["Amount"].ToString(); obj.accountName = dr["accountName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //-------------------View Day Book.---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string OutStandingBalance(string sessionId, string schoolId, string status) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("OutstandingBalance", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@branchId", schoolId); cmd.Parameters.AddWithValue("@typeId", status); SqlDataReader dr = cmd.ExecuteReader(); clsAccount obj; if (dr.HasRows) { while (dr.Read()) { obj = new clsAccount(); obj.id = dr["mAccountId"].ToString(); obj.credit = dr["Amount"].ToString(); obj.accountName = dr["accountName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //-------------------View Day Book.---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string BalanceSheet(string sessionId, string schoolId, string status) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("BalanceSheet", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@branchId", schoolId); cmd.Parameters.AddWithValue("@paymentType", status); SqlDataReader dr = cmd.ExecuteReader(); clsAccount obj; if (dr.HasRows) { while (dr.Read()) { obj = new clsAccount(); obj.id = dr["mAccountId"].ToString(); obj.particular = dr["GroupName"].ToString(); obj.credit = dr["Amount"].ToString(); obj.accountName = dr["accountName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //-------------------View Ledger.---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string LedgerDetail(string sessionId, string schoolId, string ledgerId, string startDate, string endDate) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("viewLedger", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@branchId", schoolId); cmd.Parameters.AddWithValue("@ledgerId", ledgerId); cmd.Parameters.AddWithValue("@startDate", startDate); cmd.Parameters.AddWithValue("@endDate", endDate); SqlDataReader dr = cmd.ExecuteReader(); clsAccount obj; if (dr.HasRows) { while (dr.Read()) { obj = new clsAccount(); obj.id = dr["tdbId"].ToString(); obj.particular = dr["mAccountName"].ToString(); obj.voucherNo = dr["voucherNo"].ToString(); obj.voucherType = dr["voucherName"].ToString(); obj.transType = dr["transType"].ToString(); obj.credit = dr["Credit"].ToString(); obj.debit = dr["Debit"].ToString(); obj.date = dr["Date1"].ToString(); obj.remark = dr["Remark"].ToString(); obj.accountName = dr["masterAccount"].ToString(); // obj.SchoolId = dr["mSchoolName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //-------------------In Out Between Dates.---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string InOut(string sessionId, string schoolId, string startDate, string endDate) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("dailyBalance", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@schoolId", schoolId); // cmd.Parameters.AddWithValue("@ledgerId", ledgerId); cmd.Parameters.AddWithValue("@startDate", startDate); cmd.Parameters.AddWithValue("@endDate", endDate); SqlDataReader dr = cmd.ExecuteReader(); clsAccount obj; if (dr.HasRows) { while (dr.Read()) { obj = new clsAccount(); obj.id = dr["headId"].ToString(); obj.particular = dr["headName"].ToString(); obj.credit = dr["Expense"].ToString(); obj.debit = dr["Income"].ToString(); obj.transType = dr["Status"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //-------------------In OUt Head Wise.---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string InOutheadWise(string sessionId, string schoolId, string startDate, string endDate, string headId) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("dailyBalanceDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@schoolId", schoolId); cmd.Parameters.AddWithValue("@headId", headId); cmd.Parameters.AddWithValue("@startDate", startDate); cmd.Parameters.AddWithValue("@endDate", endDate); SqlDataReader dr = cmd.ExecuteReader(); clsAccount obj; if (dr.HasRows) { while (dr.Read()) { obj = new clsAccount(); obj.date = dr["Date"].ToString(); obj.id = dr["tfundId"].ToString(); obj.particular = dr["mAccountName"].ToString(); obj.voucherNo = dr["voucherNo"].ToString(); obj.voucherType = dr["voucherName"].ToString(); obj.credit = dr["Credit"].ToString(); obj.debit = dr["Debit"].ToString(); obj.remark = dr["Remark"].ToString(); obj.accountName = dr["masterAccount"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //---------view Master Class--- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewSummery(string groupId, string sessionId, string staffId) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("viewSummery", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@groupId", groupId); cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@staffId", staffId); SqlDataReader dr = cmd.ExecuteReader(); mAccount obj; if (dr.HasRows) { while (dr.Read()) { obj = new mAccount(); obj.totalSchool = dr["totalSchool"].ToString(); obj.totalStudent = dr["totalStudent"].ToString(); obj.newStudent = dr["newStudent"].ToString(); obj.totalFee = dr["totalFee"].ToString(); obj.pendingBalance = dr["pendingBalance"].ToString(); obj.pendingFee = dr["pendingFee"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //---------View Registration--- [OperationContract] [WebInvoke(Method = "GET", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json, UriTemplate = "viewreg/{username}/{email}/{password}/{gender}")] public string viewreg(string username, string email, string password, string gender) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("insdprofile", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@username", username); cmd.Parameters.AddWithValue("@email", email); cmd.Parameters.AddWithValue("@password", password); cmd.Parameters.AddWithValue("@gender", gender); SqlDataReader dr = cmd.ExecuteReader(); preg obj; if (dr.HasRows) { while (dr.Read()) { obj = new preg(); obj.id = dr["id"].ToString(); obj.username = dr["username"].ToString(); obj.email = dr["email"].ToString(); obj.gender = dr["gender"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //-----------------Master Course Data----------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewMasterFileType() { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("select*from MasterFileType", con); cmd.CommandType = CommandType.Text; cmd.Connection = con; SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["mftid"].ToString(); obj.name = dr["mftName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string InsMasterTopicFileOld(string UserID, string topic, string title, string desp, string path, string extn, string filetype, string RefCode) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("InsMasterTopicFile", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@mtfUserCode", UserID); cmd.Parameters.AddWithValue("@mtfTopicId", topic); cmd.Parameters.AddWithValue("@mtftitles", title); cmd.Parameters.AddWithValue("@mtfDescription", desp); cmd.Parameters.AddWithValue("@mtfFilePath", path); cmd.Parameters.AddWithValue("@mtfExtenstion", extn); cmd.Parameters.AddWithValue("@mtfType", filetype); cmd.Parameters.AddWithValue("@mtfUserReferalCode", RefCode); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //---------------------Update [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string UpdMasterTopicFileOld(string ID, string UserID, string topic, string title, string desp, string path, string extn, string filetype, string RefCode) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("UpdMasterTopicFile", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@mtfid", ID); cmd.Parameters.AddWithValue("@mtfUserCode", UserID); cmd.Parameters.AddWithValue("@mtfTopicId", topic); cmd.Parameters.AddWithValue("@mtftitles", title); cmd.Parameters.AddWithValue("@mtfDescription", desp); cmd.Parameters.AddWithValue("@mtfFilePath", path); cmd.Parameters.AddWithValue("@mtfExtenstion", extn); cmd.Parameters.AddWithValue("@mtfType", filetype); cmd.Parameters.AddWithValue("@mtfUserReferalCode", RefCode); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-----View [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string view_MTopicFileDetialOld(string ID, string Typeid, string Topicid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("view_MTopicFileDetial", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@mtfid", ID); cmd.Parameters.AddWithValue("@FileType", Typeid); cmd.Parameters.AddWithValue("@Topicid", Topicid); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["mtfid"].ToString(); obj.title = dr["mtftitles"].ToString(); obj.description = dr["mtfDescription"].ToString(); obj.urlPath = dr["mtfFilePath"].ToString(); obj.subtitle = dr["mtfExtenstion"].ToString(); obj.name = dr["mftName"].ToString(); obj.catID = dr["mtfType"].ToString(); obj.courseName = dr["courseName"].ToString(); obj.courseId = dr["mtfTopicid"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //----------------------View Front Topic Data--------------/ [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string View_TopicFileDetailOld(string Topicid, string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("View_TopicFileDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); cmd.Parameters.AddWithValue("@topicid", Topicid); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["mtfid"].ToString(); obj.title = dr["mtftitles"].ToString(); obj.description = dr["mtfDescription"].ToString(); obj.urlPath = dr["mtfFilePath"].ToString(); obj.subtitle = dr["mtfExtenstion"].ToString(); obj.name = dr["mftName"].ToString(); obj.catID = dr["mtfType"].ToString(); obj.courseName = dr["courseName"].ToString(); obj.courseId = dr["mtfTopicid"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //---------------------Student Web Registration---------------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string InsStudentWeb(string name, string mob, string mail, string state, string city, string RefCode) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); if (RefCode == null || RefCode == "") { RefCode = "16700"; } Int64 mob1 = Int64.Parse(mob); SqlCommand cmd = new SqlCommand("InsStudentWeb", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@studentName", name); cmd.Parameters.AddWithValue("@studentCity", city); cmd.Parameters.AddWithValue("@studentState", state); cmd.Parameters.AddWithValue("@studentMobileNo", mob); cmd.Parameters.AddWithValue("@studentEmail", mail); cmd.Parameters.AddWithValue("@RefCode", Convert.ToInt32(RefCode)); string st = cmd.ExecuteScalar().ToString(); string[] getval = st.Split('!'); if (mob1 > 9 && getval[0] == "Ok") { nms_sms.cls_sms sms = new nms_sms.cls_sms(); sms.SMSSend("Dear " + name + " Welcome To IEDUP, Your Enquiry has been done Successfully Your ID- " + getval[1] + ".", mob1); } else { st = "Something is Wrong!"; } cmd.Dispose(); con.Close(); return RAJ.Serialize(st); } //--------------------Web Franchise------------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string WebInsBranch(string Name, string Mob, string Mail, string state, string pwd, string city, string ReferenceID) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); string BranchID = ""; string BranchType = ""; string BranchStatus = ""; string finalstr = ""; //----------Password--------------// //Random rnd = new Random(); //fname = rnd.Next(99, 99999) + file.FileName.Replace(' ', '-'); if (ReferenceID != null && ReferenceID != "") { BranchID = ReferenceID; BranchType = "4"; BranchStatus = "3"; } else { BranchID = "9426"; BranchType = "4"; BranchStatus = "3"; } Int64 MeMob = Int64.Parse(Mob); Int32 Mestatus = Convert.ToInt32(BranchStatus); Int32 metype = Convert.ToInt32(BranchType); SqlCommand cmd = new SqlCommand("InsBranch", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchName", Name); cmd.Parameters.AddWithValue("@password", pwd); cmd.Parameters.AddWithValue("@branchMobile", Mob); cmd.Parameters.AddWithValue("@branchEmail", Mail); cmd.Parameters.AddWithValue("@branchCity", city); cmd.Parameters.AddWithValue("@branchDistrict", city); cmd.Parameters.AddWithValue("@branchState", state); cmd.Parameters.AddWithValue("@branchType", metype); cmd.Parameters.AddWithValue("@ReferenceBrachCodeId", Convert.ToInt32(BranchID)); cmd.Parameters.AddWithValue("@branchStatus", BranchStatus); string str = cmd.ExecuteScalar().ToString(); string[] s = str.Split('!'); if (s[0].ToString() == "Successfully Done " && MeMob > 9 && Mestatus == 1) { nms_sms.cls_sms sms = new nms_sms.cls_sms(); //Visitus:www.Education Institute.com sms.SMSSend("Dear " + Name + " Welcome to IEDUP, Your Enquiry has been done Successfully. Your ID :" + s[1].ToString(), MeMob); } else if (s[0].ToString() == "Successfully Done " && MeMob > 9) { nms_sms.cls_sms sms = new nms_sms.cls_sms(); sms.SMSSend("Dear " + Name + " Welcome to IEDUP, Your Enquiry has been done successfully. Your ID :" + s[1].ToString(), MeMob); //Your ID :" + s[1].ToString(), Mob); } if (BranchType == "5") { finalstr = s[1]; } else { finalstr = "Successfully Saved!"; } cmd.Dispose(); con.Close(); return RAJ.Serialize(finalstr); //} } //---------------------------Franchisee Section-----------------------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string InsNewFranchisee(string Branchid, string PName, string PFatherName, string PMob, string PMail, string PQuali, string PExp, string Pstate, string Pcity, string PAddress, string FName, string FFatherName, string FQuali, string FExp, string FDOB, string DirImg, string ReceptionImg, string LabImg, string outsideImg, string branchName, string branchAddress, string branchMob, string branchmail, string bcity, string bstate, string branchArea, string branchRoom, string branchcomputer, string branchPrinter, string branchType) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("InsNewFranchisee", con); cmd.CommandType = CommandType.StoredProcedure; //-----Branch Personal Detail------------------// cmd.Parameters.AddWithValue("@branchCodeId", Convert.ToInt32(Branchid)); cmd.Parameters.AddWithValue("@branchType", Convert.ToInt32(branchType)); cmd.Parameters.AddWithValue("@bpDetailName", PName); cmd.Parameters.AddWithValue("@bpDetailFatherName", PFatherName); cmd.Parameters.AddWithValue("@bpDetailMail", PMail); cmd.Parameters.AddWithValue("@bpDetailMob", Convert.ToInt64(PMob)); cmd.Parameters.AddWithValue("@bpDetailQualification", PQuali); cmd.Parameters.AddWithValue("@bpDetailExp", PExp); cmd.Parameters.AddWithValue("@bpDetailState", Pstate); cmd.Parameters.AddWithValue("@bpDetailCity", Pcity); cmd.Parameters.AddWithValue("@bpDetailAddress", PAddress); //-----Branch Faculty Detail------------------// cmd.Parameters.AddWithValue("@bfDetailName", FName); cmd.Parameters.AddWithValue("@bfDatailFatherName", FFatherName); cmd.Parameters.AddWithValue("@bfDetailQualification", FQuali); cmd.Parameters.AddWithValue("@bfDetailExp", FExp); cmd.Parameters.AddWithValue("@bfDetailDOB", FDOB); //---------------Brach Document Photo------------------// cmd.Parameters.AddWithValue("@BPhotoDirImg", DirImg); cmd.Parameters.AddWithValue("@BPhotoReceptionEraImg", ReceptionImg); cmd.Parameters.AddWithValue("@BPhotoLabRoomImg", LabImg); cmd.Parameters.AddWithValue("@BPhotoOutSideImg", outsideImg); //---------------Institute Detail------------------// cmd.Parameters.AddWithValue("@branchName", branchName); cmd.Parameters.AddWithValue("@branchAddress", branchAddress); cmd.Parameters.AddWithValue("@branchMobile", branchMob); cmd.Parameters.AddWithValue("@branchEmail", branchmail); cmd.Parameters.AddWithValue("@branchCity", bcity); cmd.Parameters.AddWithValue("@branchState", bstate); cmd.Parameters.AddWithValue("@CarpetArea", branchArea); cmd.Parameters.AddWithValue("@NoOfRooms", branchRoom); cmd.Parameters.AddWithValue("@NoOfComputers", branchcomputer); cmd.Parameters.AddWithValue("@NoOfPrinters", branchPrinter); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //--------------------Getting Web Branch Detail on Branchid-----// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string Get_WebBranchDetail(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("Get_WebBranchDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchid", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); //------------Institute Detail-----------------// obj.codeId = dr["branchId"].ToString();//jack obj.id = dr["branchCodeId"].ToString(); obj.name = dr["branchName"].ToString(); //obj.codeId = dr["branchCode"].ToString(); obj.address = dr["branchAddress"].ToString(); //obj.phoneNo = dr["branchPhone"].ToString(); obj.emailID = dr["branchEmail"].ToString(); obj.mobNo = dr["branchmobile"].ToString(); obj.city = dr["branchCity"].ToString(); obj.District = dr["branchDistrict"].ToString(); obj.Stid = dr["branchState"].ToString(); //obj.Type = dr["branchType"].ToString(); obj.status = dr["branchStatus"].ToString(); obj.CarpetArea = dr["CarpetArea"].ToString(); obj.NoOfRooms = dr["NoOfRooms"].ToString(); obj.NoOfComputers = dr["NoOfComputers"].ToString(); obj.NoOfPrinters = dr["NoOfPrinters"].ToString(); //----------------Personal Detail----------------------// obj.PName = dr["bpDetailName"].ToString(); obj.PFatherName = dr["bpDetailFatherName"].ToString(); obj.PMail = dr["bpDetailMail"].ToString(); obj.PMobile = dr["bpDetailMob"].ToString(); obj.PQualification = dr["bpDetailQualification"].ToString(); obj.PExperience = dr["bpDetailExp"].ToString(); obj.PState = dr["bpDetailState"].ToString(); obj.PCity = dr["bpDetailCity"].ToString(); obj.PAddress = dr["bpDetailAddress"].ToString(); //-----------------Faculty Detail-----------------// obj.FName = dr["bfDetailName"].ToString(); obj.FFatherName = dr["bfDatailFatherName"].ToString(); obj.FQualification = dr["bfDetailQualification"].ToString(); obj.FExperiece = dr["bfDetailExp"].ToString(); obj.DOB = dr["bfDetailDOB"].ToString(); //-------------Document Detail-----------------// obj.DirImg = dr["BPhotoDirImg"].ToString(); obj.ReceptionImg = dr["BPhotoReceptionEraImg"].ToString(); obj.RoomImg = dr["BPhotoLabRoomImg"].ToString(); obj.SideImg = dr["BPhotoOutSideImg"].ToString(); lst.Add(obj); } cmd.Dispose(); con.Close(); } dr.Dispose(); //} return RAJ.Serialize(lst); } //--------------------Getting Web Branch Detail on Branchid-----// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string Get_WebUserDetail(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand(@"select studentid,studentcode,studentName,studentcity,studentDistrict,studentState,studentmobileno,studentEmail, loginname,loginAPassword,loginstatus,logintype from joinStudentProfile join joinstudentLogin on studentCode=loginCode where studentCode=" + ID + "", con); cmd.CommandType = CommandType.Text; cmd.Connection = con; SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["studentcode"].ToString(); obj.name = dr["studentName"].ToString(); obj.State = dr["studentState"].ToString(); obj.city = dr["studentcity"].ToString(); obj.District = dr["studentDistrict"].ToString(); obj.mobNo = dr["studentmobileno"].ToString(); obj.mailId = dr["studentEmail"].ToString(); obj.status = dr["loginstatus"].ToString(); obj.Type = dr["logintype"].ToString(); lst.Add(obj); } cmd.Dispose(); con.Close(); } dr.Dispose(); //} return RAJ.Serialize(lst); } //------------Branch Status Changed------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string UpdBranch_Status(string ID, string Mob, string Name) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); Int64 MeMob = Int64.Parse(Mob); SqlCommand cmd = new SqlCommand("UpdBranch_Status", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@codeid", ID); string str = cmd.ExecuteScalar().ToString(); if (str == "Good") { nms_sms.cls_sms sms = new nms_sms.cls_sms(); sms.SMSSend("Dear " + Name + " ,Your Application has been Approved,Now Make Payment.Regards: IEDUP", MeMob); } cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-----------------Getting Student Detail on UserCode---------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string Get_WebStudentDetail(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("select*from studentdetail where studentcode=" + ID + "", con); cmd.CommandType = CommandType.Text; cmd.Connection = con; SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.name = dr["studentName"].ToString(); obj.State = dr["studentState"].ToString(); obj.city = dr["studentCity"].ToString(); obj.District = dr["studentDistrict"].ToString(); obj.mobNo = dr["studentMobileNo"].ToString(); obj.mailId = dr["studentEmail"].ToString(); obj.status = dr["smIsActive"].ToString(); obj.pinCode = dr["loginCode"].ToString(); obj.courseId = dr["courseid"].ToString(); obj.courseName = dr["courseName"].ToString(); lst.Add(obj); } cmd.Dispose(); con.Close(); } dr.Dispose(); //} return RAJ.Serialize(lst); } //------------------Master Bank Detail Setup----------------------------------------------------------------------------------------------------------------------// //------Insert Bank Setup. [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insBankSetup(string bankName, string accountName, string ifscCode, string accountNo, string ledgerId) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand(@"insert masterBankAccountSetup(mbasBankName, mbasBankAccountName, mbasBankIFSCCode, mbasIsActive, mbasBankAccountNo,mbasBankLedgerId)values(@bankName,@accountName, @ifscCode,1,@accountNo,@ledgerId)", con); cmd.Parameters.AddWithValue("@bankName", bankName); cmd.Parameters.AddWithValue("@accountName", accountName); cmd.Parameters.AddWithValue("@ifscCode", ifscCode); cmd.Parameters.AddWithValue("@accountNo", accountNo); cmd.Parameters.AddWithValue("@ledgerId", ledgerId); cmd.ExecuteNonQuery(); string str = "Insert Successfully!"; cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //-----Update Bank Setup Detail [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updBankSetup(string bankName, string accountName, string ifscCode, string accountNo, string Id, string ledgerId) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand(@"update masterBankAccountSetup set mbasBankName=@bankName, mbasBankAccountName=@accountName,mbasBankIFSCCode=@ifscCode, mbasBankAccountNo=@accountNo, mbasBankLedgerId=@ledgerId where mbasId=@Id", con); cmd.Parameters.AddWithValue("@bankName", bankName); cmd.Parameters.AddWithValue("@accountName", accountName); cmd.Parameters.AddWithValue("@ifscCode", ifscCode); cmd.Parameters.AddWithValue("@accountNo", accountNo); cmd.Parameters.AddWithValue("@ledgerId", ledgerId); cmd.Parameters.AddWithValue("@Id", Id); cmd.ExecuteNonQuery(); string str = "Updated Successfully!"; cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //-----View Bank Setup Detail [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewBankSetup(string Id) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand(@"select mbasId, mbasBankName, mbasBankAccountName, mbasBankIFSCCode, mbasIsActive, mbasBankAccountNo,mAccountName from masterBankAccountSetup inner join masterAccount on mbasBankLedgerId=mAccountId", con); // cmd.Parameters.AddWithValue("@groupId", Id); SqlDataReader dr = cmd.ExecuteReader(); bankSetupPRP obj; if (dr.HasRows) { while (dr.Read()) { obj = new bankSetupPRP(); obj.id = dr["mbasId"].ToString(); obj.bankName = dr["mbasBankName"].ToString(); obj.accountName = dr["mbasBankAccountName"].ToString(); obj.ifscCode = dr["mbasBankIFSCCode"].ToString(); obj.accountNo = dr["mbasBankAccountNo"].ToString(); obj.ledgerId = dr["mAccountName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-----View Bank Setup Detail [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewBankSetupDDL(string Id) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("viewMasterBankAccountDDL", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@groupId", Id); SqlDataReader dr = cmd.ExecuteReader(); bankSetupPRP obj; if (dr.HasRows) { while (dr.Read()) { obj = new bankSetupPRP(); obj.id = dr["id"].ToString(); obj.name = dr["name"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-----Select Bank Setup Detail [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string selBankSetup(string Id) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand(@"select mbasId, mbasBankName, mbasBankAccountName, mbasBankIFSCCode, mbasIsActive, mbasBankAccountNo,mbasBankLedgerId from masterBankAccountSetup where mbasId=@Id", con); cmd.Parameters.AddWithValue("@Id", Id); SqlDataReader dr = cmd.ExecuteReader(); bankSetupPRP obj; if (dr.HasRows) { while (dr.Read()) { obj = new bankSetupPRP(); obj.id = dr["mbasId"].ToString(); obj.bankName = dr["mbasBankName"].ToString(); obj.accountName = dr["mbasBankAccountName"].ToString(); obj.ifscCode = dr["mbasBankIFSCCode"].ToString(); obj.accountNo = dr["mbasBankAccountNo"].ToString(); obj.ledgerId = dr["mbasBankLedgerId"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //----------------------------Exam Section--------------------// //---------------Test Detail [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewTestDetail(string Stuid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewTestDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@studentId", Stuid); SqlDataReader dr = cmd.ExecuteReader(); clsExam obj; { while (dr.Read()) { obj = new clsExam(); obj.id = dr["questionpaperid"].ToString(); //obj.stat = dr["isactive"].ToString(); //obj.status = dr["isview"].ToString(); obj.testSdate = dr["TestHeldDate"].ToString(); obj.hour = dr["Testhour"].ToString(); obj.mint = dr["TestMinute"].ToString(); obj.name = dr["courseName"].ToString(); obj.testname = dr["Testname"].ToString(); //obj.uniID = dr["testtime"].ToString(); obj.totle_Quest = dr["totalQuestion"].ToString(); obj.totle_time = dr["totalTime"].ToString(); obj.testEdate = dr["TestEndDate"].ToString(); obj.status = dr["teststatus"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //---------Quize----------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewfinalTestDetail(string ID, string Stuid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewfinalTestDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@paperid", ID); cmd.Parameters.AddWithValue("@studentid", Stuid); SqlDataReader dr = cmd.ExecuteReader(); clsExam obj; { while (dr.Read()) { obj = new clsExam(); obj.id = dr["row"].ToString(); obj.empid = dr["QuesId"].ToString(); obj.que_Name = dr["Question"].ToString(); obj.que_AnsA = dr["AnsA"].ToString(); obj.que_AnsB = dr["AnsB"].ToString(); obj.que_AnsC = dr["AnsC"].ToString(); obj.que_AnsD = dr["AnsD"].ToString(); obj.que_CorrtAns = dr["validAns"].ToString(); //obj.que_TestID = dr["mTestDTestId"].ToString(); //obj.totle_Quest = dr["mTestNoOfQuestion"].ToString(); //obj.totle_time = dr["mTestDuration"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //------Insert Bank Setup. [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insTestResult(string ID, string QnsID, string GivenAns, string CorrectAns, string TestID,string query) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); //string ans = ""; //ans += " if not exists (select *from tblstudentAns where Questionid=" + QnsID + " and Studentid=" + ID + " and PaperDetailid=" + TestID + ")"; //ans += " begin insert into tblstudentAns (Questionid,QuestionAns,Studentid,PaperDetailid,QModule)values(" + QnsID + ",'" + GivenAns + "'," + ID + "," + TestID + "," + "1" + ");"; //ans += " end else begin "; //ans += " update tblstudentAns set QuestionAns='" + GivenAns + "' where Questionid=" + QnsID + " and Studentid=" + ID + " and PaperDetailid=" + TestID + "; end "; SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = "spinsStudentAnswer"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@query", query); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //----------------Franchise Report Status---------------// //-Insert [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insFranchiseReportStatus(string detail, string branch) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = "insFranchiseReportStatus"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@frsDetail", detail); cmd.Parameters.AddWithValue("@frsBranchid", branch); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //----------Update Web Status--------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updwebBranchStatus(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = "updwebBranchStatus"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchid", ID); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //--View [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewFranchiseReportDetail(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewFranchiseReportDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchid", ID); SqlDataReader dr = cmd.ExecuteReader(); clsEdit obj; { while (dr.Read()) { obj = new clsEdit(); obj.editdetail = dr["frsdetail"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-----------Find Duplicate Student----------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string findDuplicateMob(string mob) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("findDuplicateMob", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@mob", mob); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-------------------Dashboard Report----------------------// //-------------Actual Branch Report-------------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string BranchDeskDetail(string branch) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("BranchDeskDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchId", branch); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.TotalBranches = dr["TotalBranch"].ToString(); obj.ActiveBranch = dr["ActiveBranch"].ToString(); obj.InActiveBranch = dr["InActiveBranch"].ToString(); obj.PaymentPending = dr["PaymentPending"].ToString(); obj.RegistratinPending = dr["RegistrationPending"].ToString(); obj.branchSecurity = dr["BranchWallet"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-----------Actual Student Student--------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string StudentDeskDetail(string branch) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("StudentDeskDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchId", branch); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.TotalStudent = dr["TotalStudent"].ToString(); obj.PendingStudent = dr["PendingStudent"].ToString(); obj.PendingConfirmation = dr["PendingConfirmation"].ToString(); obj.ConfirmedStudent = dr["ConfirmedStudent"].ToString(); obj.PrintedDiploma = dr["PrintedDiploma"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //---------------Branch Student Report---------------// //-----------Actual Student Student--------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string BranchStudentReport(string branch) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("BranchStudentReport", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchId", branch); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["val"].ToString(); obj.name = dr["name"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------------------------Ankit----------------------------------// //----Insert [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string InsCommDesWise(string branchId, string codeId,string RAmount) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("insCommDegWise", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchid", branchId); cmd.Parameters.AddWithValue("@CommissionId", codeId); cmd.Parameters.AddWithValue("@value", RAmount); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewcommDesWise(string Bid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewcommDesWise", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branch", Bid); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.catID = dr["catId"].ToString(); obj.Organisation = dr["orgName"].ToString(); obj.CourseCategory = dr["catName"].ToString(); obj.branchId = dr["branchCodeId"].ToString(); obj.branchName = dr["branchName"].ToString(); obj.branchMStudentComm = dr["cdValue"].ToString(); obj.codeId = dr["ComId"].ToString(); obj.RAmount = dr["Value"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updMasterFee(string query) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("updMasterFee", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@query", query); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string InsertQueryCom(string query) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("InsertQueryCom", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@query", query); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //----InsTRID---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string InsertTRID(string query) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("InsertTRID", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@query", query); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //----InsBCID---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string InsertBCID(string query) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("InsertBCID", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@query", query); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //---------------------Delete [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delMasterItemCategory(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("delete from MasterItemCategory where micId=@micId", con); cmd.Parameters.AddWithValue("@micId", ID); cmd.ExecuteNonQuery(); string str = "Deleted Successfully!"; cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //------Delete [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delMasterItemMeasurment(string name, string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("delete from MasterItemMeasurment where mimId=@mimId", con); cmd.Parameters.AddWithValue("@mimId", ID); cmd.ExecuteNonQuery(); string str = "Deleted Successfully!"; cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //--------Insert------------------ [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insMasterTaxGroup(string name, string isactive, string taxid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("insert MasterTaxGroup(mtgName,mtgIsActive,mtgTaxId) values(@mtgName,@mtgIsActive,@mtgTaxId)", con); cmd.Parameters.AddWithValue("@mtgName", name); cmd.Parameters.AddWithValue("@mtgIsActive", isactive); cmd.Parameters.AddWithValue("@mtgTaxId", taxid); cmd.ExecuteNonQuery(); string str = "Save Successfully!"; cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //-------Delete [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delMasterTax(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("delete from MasterTax where mTaxId=" + ID + "", con); cmd.Parameters.AddWithValue("@mTaxId", ID); cmd.ExecuteNonQuery(); string str = "Deleted Successfully!"; cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } //------------------------------------------Ankit--------------------------------// //------------ Delete Data-------------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delMasterItem(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("delMasterItem", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@midItemId", ID); cmd.Parameters.AddWithValue("@mItemId", ID); cmd.Parameters.AddWithValue("@tInventoryItemId", ID); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str).ToString(); } //---------view Master Class--- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string currentBalance(string ledgerId, string sessionId, string branchId,string type) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("currentBalance", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ledgerId", ledgerId); cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@branchId", branchId); cmd.Parameters.AddWithValue("@typeId", type); SqlDataReader dr = cmd.ExecuteReader(); mAccount obj; if (dr.HasRows) { while (dr.Read()) { obj = new mAccount(); obj.currenbalance = dr["currenttBal"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } //-------------------View Ledger.---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string sendmail(string total1,string total2,string mailid, string lable,string sessionid,string branchid,string ledgerId,string startdate,string enddate ) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); try { con.Open(); SqlCommand cmd = new SqlCommand("viewLedger", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@sessionId",sessionid ); cmd.Parameters.AddWithValue("@branchId", branchid); cmd.Parameters.AddWithValue("@ledgerId", ledgerId); cmd.Parameters.AddWithValue("@startDate", startdate); cmd.Parameters.AddWithValue("@endDate", enddate); // SqlDataReader dr = cmd.ExecuteReader(); SqlDataAdapter adapter = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); string textBody = ""; adapter.Fill(dt); textBody = " "; for (int loopCount = 0; loopCount < dt.Rows.Count - 1; loopCount++) { textBody += ""; } textBody += "
tdbId masterAccount voucherNo voucherName TransType Credit Debit Date1 Remark mAccountName
" + dt.Rows[loopCount]["tdbId"] + " " + dt.Rows[loopCount]["masterAccount"] + " " + dt.Rows[loopCount]["voucherNo"] + " " + dt.Rows[loopCount]["voucherName"] + " " + dt.Rows[loopCount]["TransType"] + " " + dt.Rows[loopCount]["Credit"] + " " + dt.Rows[loopCount]["Debit"] + " " + dt.Rows[loopCount]["Date1"] + " " + dt.Rows[loopCount]["Remark"] + " " + dt.Rows[loopCount]["mAccountName"] + "
"; BodyMail = @"
BASP
Confirmation Mail
" + textBody + @";
This service is brought to you by -

Copyright @ BASP.com


"; HeadMail = "BASP"; //ToMail = "booking.mij@gmail.com"; //booking.mij@gmail.com ToMail = mailid; //"kmahisarwebsite@gmail.com";//""; //ToMail = "satnam.netkma@gmail.com"; FromMail = "baspharyana@gmail.com"; System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage(); SmtpClient SmtpServer = new SmtpClient(); mail.To.Add(ToMail); mail.From = new System.Net.Mail.MailAddress(FromMail); mail.Subject = HeadMail; mail.Body = BodyMail; mail.IsBodyHtml = true; SmtpServer.Send(mail); // Response.Redirect("contact_us.html?msg=Succssfully-Submit-!"); lable = "Your Request Is Submitted Sucessfully"; } catch { lable = "your request have an error"; } return lable; } //-----------------Delete Course Category---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string del_enquiry(string enqid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("del_enquiry", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@enqid", enqid); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-----------------Delete Subject By Course---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string DelSubjectByCourse(string ID) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("delSubjectByCourse", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@SubId", ID); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string sendforprint(string StuID, string status,string studentregnumber) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("sendforconf", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", StuID); cmd.Parameters.AddWithValue("@status", status); string str = cmd.ExecuteScalar().ToString(); Function inw = new Function(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string sendforprintdeduct(string StuID, string status, string studentregnumber) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("sendforconfdeduct", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", StuID); cmd.Parameters.AddWithValue("@status", status); cmd.Parameters.AddWithValue("@studentregnumber", studentregnumber); string str = cmd.ExecuteScalar().ToString(); Function inw = new Function(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //-------------------View Day Book.---------// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string BalanceSheet1(string sessionId, string schoolId, string status) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("BalanceSheet", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@sessionId", sessionId); cmd.Parameters.AddWithValue("@branchId", schoolId); // cmd.Parameters.AddWithValue("@paymentType", status); SqlDataReader dr = cmd.ExecuteReader(); clsAccount obj; if (dr.HasRows) { while (dr.Read()) { obj = new clsAccount(); obj.id = dr["Id"].ToString(); obj.idtype = dr["IdType"].ToString(); obj.accountName = dr["AccountName"].ToString(); obj.debit = dr["Debit"].ToString(); obj.credit = dr["Credit"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewCoursename_ByUni(string CourseCatid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("BindCourse_ByUnid", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", CourseCatid); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["id"].ToString(); obj.name = dr["name"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insEnqiry(string courseid, string Name, string Email, string Address , string Mobile,string Message) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("ins_enquity", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@enqname", Name); cmd.Parameters.AddWithValue("@enqmail", Email); cmd.Parameters.AddWithValue("@enqmob", Mobile); cmd.Parameters.AddWithValue("@enqaddress", Mobile); cmd.Parameters.AddWithValue("@enqdepartment", courseid); cmd.Parameters.AddWithValue("@enqmsg", Message); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string InsCoursecareer(string courseid, string Precentage, string Career, string type) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("Ins_tblcoursecareer", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@cccourseid", courseid); cmd.Parameters.AddWithValue("@ccpercentage", Precentage); cmd.Parameters.AddWithValue("@ccname", Career); cmd.Parameters.AddWithValue("@type", type); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updCoursecareer(string Precentage, string Career, string Id) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("upd_coursecareer", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", Id); cmd.Parameters.AddWithValue("@ccpercentage", Precentage); cmd.Parameters.AddWithValue("@ccname", Career); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string BindCourseCareer(string Id) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("sel_coursecareer", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", Id); SqlDataReader dr = cmd.ExecuteReader(); clsAccount obj; if (dr.HasRows) { while (dr.Read()) { obj = new clsAccount(); obj.name = dr["ccname"].ToString(); obj.debit = dr["ccpercentage"].ToString(); obj.id = dr["ccid"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string ViewCourseCareer(string type, string courseid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("View_coursecareer", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@type", type); cmd.Parameters.AddWithValue("@courseid", courseid); SqlDataReader dr = cmd.ExecuteReader(); clsAccount obj; if (dr.HasRows) { while (dr.Read()) { obj = new clsAccount(); obj.name = dr["ccname"].ToString(); obj.debit = dr["ccpercentage"].ToString(); obj.id = dr["ccid"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delCourseCareer(string Id) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("delcoursecareeer", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", Id); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } [OperationContract] [WebInvoke(Method = "GET", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string Bind_CourseProspect(string courseid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("bindprospect", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@courseid", courseid); SqlDataReader dr = cmd.ExecuteReader(); clsAccount obj; if (dr.HasRows) { while (dr.Read()) { obj = new clsAccount(); obj.name = dr["ccname"].ToString(); obj.debit = dr["ccpercentage"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string Bind_view_coursetype_new(string CourseCatid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("view_coursetype_new", con); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["ctypeid"].ToString(); obj.name = dr["ctypename"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string Bind_view_courseCategory(string CourseCatid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("view_fullcoursecategory_detail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@catcoursetype", CourseCatid); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["catid"].ToString(); obj.name = dr["catname"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string Bind_view_course(string CourseCatid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("Bind_Course", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", CourseCatid); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["id"].ToString(); obj.name = dr["name"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string BInd_URL(string CourseCatid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("BIndurl", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", CourseCatid); string st = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(st); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string ins_enquity1(string name, string mail, string mob, string msg, string dept, string address, string state, string city ) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("ins_enquity", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@enqname", name); cmd.Parameters.AddWithValue("@enqmail", mail); cmd.Parameters.AddWithValue("@enqmob", mob); cmd.Parameters.AddWithValue("@enqmsg", msg); cmd.Parameters.AddWithValue("@enqdepartment", dept); cmd.Parameters.AddWithValue("@enqaddress", address); cmd.Parameters.AddWithValue("@enqstate", state); cmd.Parameters.AddWithValue("@enqcity", city); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string ViewStudentEnquiryOld(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; RAJ.MaxJsonLength = int.MaxValue; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("view_enquiryold", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@PageNumber", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.srNo = dr["nwrow"].ToString(); obj.id = dr["enqid"].ToString(); obj.name = dr["enqname"].ToString(); obj.address = dr["address"].ToString(); obj.description = dr["enqmsg"].ToString(); obj.mobNo = dr["enqmob"].ToString(); obj.emailID = dr["enqmail"].ToString(); obj.Type = dr["enqdepartment"].ToString(); obj.DOJ = dr["enqdate"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string Queryexec(string Query) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("execquer", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@query", Query); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return str; //RAJ.Serialize(str); //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delCourse(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("delCoursedetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delCoursecateg(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("delCoursecate", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string ViewTrainingCenter(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; RAJ.MaxJsonLength = int.MaxValue; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("TrainingCenterDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@PageNumber", ID); SqlDataReader dr = cmd.ExecuteReader(); Registration obj; if (dr.HasRows) { while (dr.Read()) { obj = new Registration(); obj.ID = Convert.ToInt32(dr["tcid"]); obj.Srno = Convert.ToInt32(dr["Srno"]); obj.Date = dr["Date"].ToString(); obj.Name = dr["tcName"].ToString(); obj.GeoLocation = dr["GeoL"].ToString(); obj.OwnerShip = dr["COwner"].ToString(); obj.Type = dr["tcType"].ToString(); obj.Faculty_Type = dr["Faculty"].ToString(); obj.CreateDate = dr["tccdate"].ToString(); obj.Area = dr["tcArea"].ToString(); obj.TrainingRoom = Convert.ToInt32(dr["TrainingRoom"]); obj.Labs = Convert.ToInt32(dr["Lab"]); obj.Male_WashRoom = Convert.ToInt32(dr["MaleWash"]); obj.Female_WashRoom = Convert.ToInt32(dr["FemaleWash"]); obj.Unisex_WashRoom = Convert.ToInt32(dr["UnisexWash"]); obj.Total_WashRoom = Convert.ToInt32(dr["TotalWashRoom"]); obj.Address = dr["Address"].ToString(); obj.LandMarks = dr["tcLandmark"].ToString(); obj.PinCode = dr["tcPincode"].ToString(); obj.StateName = dr["statename"].ToString(); obj.DistrictName = dr["districtname"].ToString(); obj.Tehsil = dr["tcTehsil"].ToString(); obj.City = dr["tcCity"].ToString(); obj.Costituencey = dr["ParlConstituency"].ToString(); obj.Address_Prooftype = dr["APType"].ToString(); obj.Address_Proof = dr["AddressProof"].ToString(); obj.Document = dr["Document"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string ViewSinglePoint(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; RAJ.MaxJsonLength = int.MaxValue; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("SinglePointDetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@PageNumber", ID); SqlDataReader dr = cmd.ExecuteReader(); Registration obj; if (dr.HasRows) { while (dr.Read()) { obj = new Registration(); obj.Srno = Convert.ToInt32(dr["Srno"]); obj.Name = dr["tcName"].ToString(); obj.SPName = dr["Name"].ToString(); obj.SPMail = dr["spiEmail"].ToString(); obj.SPMobile = dr["spiMobile"].ToString(); obj.SPLandLine = dr["spiLandline"].ToString(); obj.SPDesignation = dr["spiDesignation"].ToString(); obj.SPPhoto = dr["spiPhoto"].ToString(); obj.SPExternal_Photo = dr["ExternalPhoto"].ToString(); obj.SPClassRoom_Photo = dr["ClRoomPhoto"].ToString(); obj.SPLab_Photo = dr["LabPhoto"].ToString(); obj.SPFacility_Photo = dr["FacilityPhoto"].ToString(); obj.ID = Convert.ToInt32(dr["id"]); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string ViewCenterFacility(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; RAJ.MaxJsonLength = int.MaxValue; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("TCFacilit", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); Registration obj; if (dr.HasRows) { while (dr.Read()) { obj = new Registration(); obj.Srno = Convert.ToInt32(dr["Srno"]); obj.Name = dr["name"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string ViewIndustryPartner(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; RAJ.MaxJsonLength = int.MaxValue; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("view_IndustryPartner", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@PageNumber", ID); SqlDataReader dr = cmd.ExecuteReader(); IndustryPartner obj; if (dr.HasRows) { while (dr.Read()) { obj = new IndustryPartner(); obj.Srno = Convert.ToInt32(dr["Srno"]); obj.ipName = dr["Name"].ToString(); obj.Date = dr["Date"].ToString(); obj.ipJobTitle = dr["JobTitle"].ToString(); obj.ipCompanyName = dr["CName"].ToString(); obj.ipCompanyWebsite = dr["CWebsite"].ToString(); obj.ipMobile = dr["Mobile"].ToString(); obj.ipEmail = dr["Email"].ToString(); obj.ipComment = dr["Comment"].ToString(); obj.State = dr["State"].ToString(); obj.NumberEmployee = dr["CEmployee"].ToString(); obj.RequiredEmployee = dr["CREmployee"].ToString(); obj.BusinessSector = dr["BusinessSectore"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public DataSet ViewTCenter_Detail_ID(string Id) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("TrainingCenterDetailById", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@tcid", Id); DataSet ds = new DataSet(); SqlDataAdapter adp = new SqlDataAdapter(cmd); adp.Fill(ds); // SqlDataReader dr = cmd.ExecuteReader(); // PRPSetup obj; //if (dr.HasRows) //{ // while (dr.Read()) // { // obj = new PRPSetup(); // obj.id = dr["id"].ToString(); // obj.name = dr["name"].ToString(); // lst.Add(obj); // } //} //ds.Dispose(); cmd.Dispose(); con.Close(); //} return ds; } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string UpdateTCCode(string ID, string Code, string Status) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("updTCCode", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); cmd.Parameters.AddWithValue("@tccode", Code); cmd.Parameters.AddWithValue("@status", Status); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return str; } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string BindTcStatus(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("bind_TcSts", con); cmd.CommandType = CommandType.StoredProcedure; SqlDataReader dr = cmd.ExecuteReader(); Registration obj; if (dr.HasRows) { while (dr.Read()) { obj = new Registration(); obj.ID = (Int32)dr["id"]; obj.Name = dr["name"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string Bind_TCCode(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("bind_tccode", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); Registration obj; if (dr.HasRows) { while (dr.Read()) { obj = new Registration(); obj.PinCode = dr["tcCode"].ToString(); obj.StateName = dr["tcStatus"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewMainTextCategory(string OrgID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewMainTextCategory", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", OrgID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["id"].ToString(); obj.name = dr["name"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string insTextCategory(string Image, string OrgID, string TCatid, string Title, string Status) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("insTextCategory", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@catName", Title); cmd.Parameters.AddWithValue("@uniID", OrgID); cmd.Parameters.AddWithValue("@mcatid", TCatid); cmd.Parameters.AddWithValue("@isActive", Status); cmd.Parameters.AddWithValue("@img", Image); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updTextCategory(string Image, string TCatid, string Title, string Status) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("updTextCategory", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@catName", Title); cmd.Parameters.AddWithValue("@catID", TCatid); cmd.Parameters.AddWithValue("@isActive", Status); cmd.Parameters.AddWithValue("@img", Image); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delTextCategory(string TCatid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("delTextCategory", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@catID", TCatid); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return str; //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string ins_StudentEnquiry(string name, string mail, string mob, string msg, string dept, string address, string state, string city ) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("ins_Studentenquiry", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@enqname", name); cmd.Parameters.AddWithValue("@enqmail", mail); cmd.Parameters.AddWithValue("@enqmob", mob); cmd.Parameters.AddWithValue("@enqmsg", msg); cmd.Parameters.AddWithValue("@enqdepartment", dept); cmd.Parameters.AddWithValue("@enqaddress", address); cmd.Parameters.AddWithValue("@enqstate", state); cmd.Parameters.AddWithValue("@enqcity", city); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return str; //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string View_StudentEnquiry(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); RAJ.MaxJsonLength = int.MaxValue; //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("view_studentenquiry", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@enqid", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.srNo = dr["nwrow"].ToString(); obj.id = dr["enqid"].ToString(); obj.name = dr["enqname"].ToString(); obj.address = dr["address"].ToString(); obj.description = dr["enqmsg"].ToString(); obj.mobNo = dr["enqmob"].ToString(); obj.emailID = dr["enqmail"].ToString(); obj.Type = dr["enqdepartment"].ToString(); obj.DOJ = dr["enqdate"].ToString(); obj.State = dr["stateName"].ToString(); obj.District = dr["districtName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string del_Studentenquiry(string enqid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("del_stuenquiry", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", enqid); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } // ----------- Lession ,Topic Section [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string InsMasterLession(string lessonname, string lessoncode, string schoolid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("InsMasterLession", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@mLessionName", lessonname); cmd.Parameters.AddWithValue("@mLessioncode", lessoncode); cmd.Parameters.AddWithValue("@mLessionSchoolId", schoolid); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string UpdMasterLession(string ID, string code, string Name, string Schoolid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("UpdMasterLession", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@mLessionId", ID); cmd.Parameters.AddWithValue("@mLessionName", Name); cmd.Parameters.AddWithValue("@mLessioncode", code); cmd.Parameters.AddWithValue("@mLessionSchoolId", Schoolid); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string ViewMasterLession(string ID, string Schoolid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("ViewMasterLession", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@mLessionId", ID); cmd.Parameters.AddWithValue("@mLessionSchoolId", Schoolid); SqlDataReader dr = cmd.ExecuteReader(); clsLession obj; if (dr.HasRows) { while (dr.Read()) { obj = new clsLession(); obj.mLessionId = dr["mLessionId"].ToString(); obj.mLessionName = dr["mLessionName"].ToString(); obj.mLessionCode = dr["mLessionCode"].ToString(); obj.mLessionSchoolId = dr["mLessionSchoolId"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string InsMasterTopic(string Lession, string Name, string ImagePath, string topicUrl, string schoolid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("InsMasterTopic", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@mTopicLessionId", Lession); cmd.Parameters.AddWithValue("@mTopicName", Name); cmd.Parameters.AddWithValue("@mTopicImage", ImagePath); cmd.Parameters.AddWithValue("@turl", topicUrl); cmd.Parameters.AddWithValue("@mTopicSchoolid", schoolid); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string UpdMasterTopic(string ID, string Lession, string Name, string ImagePath, string topicUrl, string schoolid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("UpdMasterTopic", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@mTopicId", ID); cmd.Parameters.AddWithValue("@mTopicLessionId", Lession); cmd.Parameters.AddWithValue("@mTopicName", Name); cmd.Parameters.AddWithValue("@mTopicImage", ImagePath); cmd.Parameters.AddWithValue("@turl", topicUrl); cmd.Parameters.AddWithValue("@mschoolid", schoolid); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string ViewMasterTopic(string ID, string CatID, string Schoolid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); RAJ.MaxJsonLength = int.MaxValue; //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("ViewMasterTopic", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@mTopicId", ID); cmd.Parameters.AddWithValue("@mTopicLessionId", CatID); cmd.Parameters.AddWithValue("@Schoolid", Schoolid); SqlDataReader dr = cmd.ExecuteReader(); clsTopic obj; if (dr.HasRows) { while (dr.Read()) { obj = new clsTopic(); obj.mTopicId = dr["mTopicId"].ToString(); obj.mTopicName = dr["mTopicName"].ToString(); obj.mTopicImage = dr["mTopicImage"].ToString(); obj.turl = dr["turl"].ToString(); // obj.rollNo = dr["mTopicOrderNum"].ToString(); obj.mTopicSchoolid = dr["mTopicSchoolid"].ToString(); obj.mLessionName = dr["mLessionName"].ToString(); obj.mTopicLessionId = dr["mTopicLessionId"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string InsTransCourseSubjectLession(string tcslClassId, string subjectid, string lessionid, string tcslSchoolId) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("InsTransCourseSubjectLession", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@tcslClassId", tcslClassId); cmd.Parameters.AddWithValue("@tcslSubjectId", subjectid); cmd.Parameters.AddWithValue("@tcslLessionId", lessionid); cmd.Parameters.AddWithValue("@tcslSchoolId", tcslSchoolId); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string ViewTransCourseSubjectLession1(string ID, string tcslClassId, string subjectid, string tcslSchoolId) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("ViewTransCourseSubjectLession", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@tcslId", ID); cmd.Parameters.AddWithValue("@tcslClassId", tcslClassId); cmd.Parameters.AddWithValue("@tcslSubjectId", subjectid); cmd.Parameters.AddWithValue("@tcslSchoolId", tcslSchoolId); SqlDataReader dr = cmd.ExecuteReader(); clsTranCourseSubLession obj; if (dr.HasRows) { while (dr.Read()) { obj = new clsTranCourseSubLession(); obj.id = dr["tcslId"].ToString(); obj.tcslClassId = dr["tcslClassId"].ToString(); obj.tcslSubjectId = dr["tcslSubjectId"].ToString(); obj.tcslLessionId = dr["tcslLessionId"].ToString(); obj.name = dr["Name"].ToString(); obj.mClassName = dr["mClassName"].ToString(); obj.mSubjectName = dr["mSubjectName"].ToString(); obj.tcslSchoolId = dr["tcslSchoolId"].ToString(); obj.rollNo = dr["mLessionOrderNo"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewsubcoursewise(string CourseId) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("GetSubjectCourseWise", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@subid", CourseId); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["id"].ToString(); obj.name = dr["name"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updLessionOrder(string ID, string num) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("updLessionOrder", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@lessid", ID); cmd.Parameters.AddWithValue("@lessorder", num); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string delAssingLession(string tcslId) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("delAssingLession", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@tcslId", tcslId); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string lessonclasswiseNew(string subjectid, string sessionId, string classId, string schoolid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("lessonclasswiseNew", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@classId", classId); if (subjectid != null & subjectid != "") { cmd.Parameters.AddWithValue("@subjectid", subjectid); } else { cmd.Parameters.AddWithValue("@subjectid", ""); } cmd.Parameters.AddWithValue("@schoolid", schoolid); SqlDataReader dr = cmd.ExecuteReader(); subjectwiselesson obj; if (dr.HasRows) { while (dr.Read()) { obj = new subjectwiselesson(); obj.tcslId = dr["tcslId"].ToString(); obj.scwId = dr["scwId"].ToString(); obj.mLessionName = dr["mLessionName"].ToString(); obj.mLessionCode = dr["mLessionCode"].ToString(); obj.mLessionId = dr["mLessionId"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string view_MTopicFileDetial(string Courseid, string Lessionid, string schoolid, string sessionid, string topicid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); RAJ.MaxJsonLength = Int32.MaxValue; //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("view_MTopicFileDetial", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@schoolid", schoolid); if (sessionid != null && sessionid != "") cmd.Parameters.AddWithValue("@sessionid", sessionid); cmd.Parameters.AddWithValue("@topicid", topicid); if (Courseid != null && Courseid != "") cmd.Parameters.AddWithValue("@courseid", Courseid); if (Lessionid != null && Lessionid != "") cmd.Parameters.AddWithValue("@Lessionid", Lessionid); SqlDataReader dr = cmd.ExecuteReader(); clsTopicFile obj; if (dr.HasRows) { while (dr.Read()) { obj = new clsTopicFile(); obj.mtfId = dr["mtfId"].ToString(); obj.mtftitles = dr["mtftitles"].ToString(); obj.mClassid = dr["mClassid"].ToString(); obj.mSchoolId = dr["mSchoolId"].ToString(); obj.tcslLessionId = dr["tcslLessionId"].ToString(); obj.mtfTopicId = dr["mtfTopicId"].ToString(); obj.mtfType = dr["mtfType"].ToString(); obj.mtfDescription = dr["mtfDescription"].ToString(); obj.mtfFilePath = dr["mtfFilePath"].ToString(); obj.mtfExtenstion = dr["mtfExtenstion"].ToString(); obj.mtfsessionid = dr["mtfsessionid"].ToString(); obj.tcslSubjectId = dr["tcslSubjectId"].ToString(); obj.mTopicName = dr["mTopicName"].ToString(); obj.CourseType = dr["catCourseType"].ToString(); obj.Coursename = dr["mClassName"].ToString(); obj.mIsActive = dr["mtfisActive"].ToString(); obj.mDataStatus = dr["mtfDatatype"].ToString(); obj.accountId = dr["mtfOrderno"].ToString(); obj.admissionNo = dr["sts"].ToString(); obj.SubjectName = dr["subName"].ToString(); obj.id = dr["catId"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string InsMasterTopicFile(string mtfOrderNo, string mtfschoolid, string topic, string title, string desp, string path, string extn, string filetype, string mtfsessionid, string mtfdatatype, string mtfisactive) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("InsMasterTopicFile", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@mtfschoolid", mtfschoolid); cmd.Parameters.AddWithValue("@mtfTopicId", topic); cmd.Parameters.AddWithValue("@mtftitles", title); cmd.Parameters.AddWithValue("@mtfDescription", desp); cmd.Parameters.AddWithValue("@mtfFilePath", path); cmd.Parameters.AddWithValue("@mtfExtenstion", extn); cmd.Parameters.AddWithValue("@mtfType", filetype); cmd.Parameters.AddWithValue("@mtfsessionid", mtfsessionid); // cmd.Parameters.AddWithValue("@mtfdatatype", mtfdatatype); if (mtfisactive != null && mtfisactive != "") cmd.Parameters.AddWithValue("@mtfisactive", mtfisactive); cmd.Parameters.AddWithValue("@mtfOrderno", mtfOrderNo); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string UpdMasterTopicFile(string mtfOrderNo, string ID, string mtfSchoolid, string topic, string title, string desp, string path, string extn, string filetype, string mtfSessionid, string mtfdatatype, string mtfisactive) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("UpdMasterTopicFileNew", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@mtfid", ID); cmd.Parameters.AddWithValue("@mtfSchoolid", mtfSchoolid); cmd.Parameters.AddWithValue("@mtfTopicId", topic); cmd.Parameters.AddWithValue("@mtftitles", title); cmd.Parameters.AddWithValue("@mtfDescription", desp); cmd.Parameters.AddWithValue("@mtfFilePath", path); cmd.Parameters.AddWithValue("@mtfExtenstion", extn); cmd.Parameters.AddWithValue("@mtfType", filetype); cmd.Parameters.AddWithValue("@mtfSessionid", mtfSessionid); // cmd.Parameters.AddWithValue("@mtfdatatype", mtfdatatype); if (mtfisactive != null && mtfisactive != "") cmd.Parameters.AddWithValue("@mtfisactive", mtfisactive); cmd.Parameters.AddWithValue("@mtfOrderno", mtfOrderNo); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string ViewLoginTypeDetailbyTypeId(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("ViewLoginTypeDetailbyTypeId", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@mTypeId", ID); SqlDataReader dr = cmd.ExecuteReader(); mastertype obj; if (dr.HasRows) { while (dr.Read()) { obj = new mastertype(); obj.TypdId = dr["mTypeId"].ToString(); obj.TypeName = dr["mTypeName"].ToString(); obj.TypeDetailId = dr["mtdid"].ToString(); obj.TypeDetailName = dr["mtdName"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string ViewTrainingCenterPayment(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; RAJ.MaxJsonLength = int.MaxValue; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("Paymentdetail", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@PageNumber", ID); SqlDataReader dr = cmd.ExecuteReader(); Registration obj; if (dr.HasRows) { while (dr.Read()) { obj = new Registration(); obj.ID = Convert.ToInt32(dr["id"]); obj.Srno = Convert.ToInt32(dr["Srno"]); obj.Date = dr["Date"].ToString(); obj.Name = dr["Centername"].ToString(); obj.Address = dr["address"].ToString(); obj.OwnerShip = dr["Amount"].ToString(); obj.Type = dr["referencno"].ToString(); obj.Area = dr["sts"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } // End Lession, Topic [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string del_TrainingCenter(string enqid) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("delTC_Info", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Id", enqid); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return str; //} } //-------------Select [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewteshil(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewteshil", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@DistrictId", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["TehsilId"].ToString(); obj.name = dr["TehsilName"].ToString(); obj.pinCode = dr["TehsilCode"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //-------------Select [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewConstituency(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewConstituency", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@StateId", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["CId"].ToString(); obj.name = dr["CName"].ToString(); obj.pinCode = dr["CCode"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //---------Insert [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string Insstudentregistration(string studentShortName, string studentName, string photo, string studentCountryCode, string studentMobileNo, string studentEmail, string studentSex, string studentDOB, string studentMarital, string studentState, string studentDistrict, string studnetCategory, string studentReligion, string studentDisability, string studentDisabilityProof, string motherName, string studentFatherName, string studentAlternateId, string studentAlternateProof, string studentAdhaarNumber, string studentAddress, string studentState1, string studentDistrict1, string studentTehsil, string studentCity, string studentPinCode, string studentConstituency, string studentAddress1, string studentState2, string studentDistrict2, string studentTehsil1, string studentCity1, string studentPinCode1, string studentConstituency1, string paymentBankUserName, string paymentBankAC, string studentIFSCCode, string paymentBankName, string studentBankAddress, string studentEducation, string courseId, string studentYearOfPassing, string photo1, string studentEducation1, string studentYearOfPassing1, string SupportinDocument, string studentPreTraining, string CTypeId, string NoOfMonthExpeSector, string PreExperienceJob, string NoOfYearPreExperience, string Employed, string HeardAboutUs, string CTypeId1, string catid,string branchid,string EmploymentstatusId,string EmploymentDetail,string disabilityselection, string identityselecion) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); RAJ.MaxJsonLength = int.MaxValue; con.Open(); SqlCommand cmd = new SqlCommand("InsStudentCopy", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@studentShortName", studentShortName); cmd.Parameters.AddWithValue("@studentName", studentName); cmd.Parameters.AddWithValue("@photo", photo); cmd.Parameters.AddWithValue("@studentCountryCode", studentCountryCode); cmd.Parameters.AddWithValue("@studentMobileNo", studentMobileNo); cmd.Parameters.AddWithValue("@studentEmail", studentEmail); cmd.Parameters.AddWithValue("@studentSex", studentSex); cmd.Parameters.AddWithValue("@studentDOB", studentDOB); cmd.Parameters.AddWithValue("@studentMarital", studentMarital); cmd.Parameters.AddWithValue("@studentState", studentState); cmd.Parameters.AddWithValue("@studentDistrict", studentDistrict); cmd.Parameters.AddWithValue("@studnetCategory", studnetCategory); cmd.Parameters.AddWithValue("@studentReligion", studentReligion); cmd.Parameters.AddWithValue("@studentDisability", studentDisability); cmd.Parameters.AddWithValue("@studentDisabilityProof", studentDisabilityProof); cmd.Parameters.AddWithValue("@motherName", motherName); cmd.Parameters.AddWithValue("@studentFatherName", studentFatherName); if(studentAlternateId != null && studentAlternateId != "") cmd.Parameters.AddWithValue("@studentAlternateId ", studentAlternateId); if (studentAlternateProof != null && studentAlternateProof != "") cmd.Parameters.AddWithValue("@studentAlternateProof ", studentAlternateProof); cmd.Parameters.AddWithValue("@studentAdhaarNumber ", studentAdhaarNumber); cmd.Parameters.AddWithValue("@studentAddress", studentAddress); cmd.Parameters.AddWithValue("@studentState1", studentState1); cmd.Parameters.AddWithValue("@studentDistrict1", studentDistrict1); cmd.Parameters.AddWithValue("@studentTehsil", studentTehsil); cmd.Parameters.AddWithValue("@studentCity", studentCity); cmd.Parameters.AddWithValue("@studentPinCode", studentPinCode); cmd.Parameters.AddWithValue("@studentConstituency", studentConstituency); cmd.Parameters.AddWithValue("@studentAddress1", studentAddress1); cmd.Parameters.AddWithValue("@studentState2", studentState2); cmd.Parameters.AddWithValue("@studentDistrict2", studentDistrict2); cmd.Parameters.AddWithValue("@studentTehsil1", studentTehsil1); cmd.Parameters.AddWithValue("@studentCity1", studentCity1); cmd.Parameters.AddWithValue("@studentPinCode1", studentPinCode1); cmd.Parameters.AddWithValue("@studentConstituency1", studentConstituency1); cmd.Parameters.AddWithValue("@paymentBankUserName", paymentBankUserName); cmd.Parameters.AddWithValue("@paymentBankAC", paymentBankAC); cmd.Parameters.AddWithValue("@studentIFSCCode", studentIFSCCode); cmd.Parameters.AddWithValue("@paymentBankName", paymentBankName); cmd.Parameters.AddWithValue("@studentBankAddress", studentBankAddress); cmd.Parameters.AddWithValue("@studentEducation", studentEducation); cmd.Parameters.AddWithValue("@smCourseId", courseId); cmd.Parameters.AddWithValue("@studentYearOfPassing", studentYearOfPassing); cmd.Parameters.AddWithValue("@photo1", photo1); cmd.Parameters.AddWithValue("@studentEducation1", studentEducation1); if (studentYearOfPassing1 != null && studentYearOfPassing1 != "") cmd.Parameters.AddWithValue("@studentYearOfPassing1", studentYearOfPassing1); cmd.Parameters.AddWithValue("@SupportinDocument", SupportinDocument); cmd.Parameters.AddWithValue("@studentPreTraining", studentPreTraining); cmd.Parameters.AddWithValue("@PreExperienceSector", CTypeId1); cmd.Parameters.AddWithValue("@NoOfMonthExpeSector", NoOfMonthExpeSector); cmd.Parameters.AddWithValue("@PreExperienceJob", PreExperienceJob); cmd.Parameters.AddWithValue("@NoOfYearPreExperience", NoOfYearPreExperience); cmd.Parameters.AddWithValue("@Employed", Employed); cmd.Parameters.AddWithValue("@HeardAboutUs", HeardAboutUs); cmd.Parameters.AddWithValue("@SelectSector", CTypeId); cmd.Parameters.AddWithValue("@SelectSubSector", catid); cmd.Parameters.AddWithValue("@SelectJobRole", courseId); cmd.Parameters.AddWithValue("@branchid", branchid); cmd.Parameters.AddWithValue("@EmploymentstatusId", EmploymentstatusId); cmd.Parameters.AddWithValue("@EmploymentDetail", EmploymentDetail); cmd.Parameters.AddWithValue("@studentDisabilitySelection", disabilityselection); cmd.Parameters.AddWithValue("@studentIdentitySelection", identityselecion); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return RAJ.Serialize(str); //} } //----------View coursewie Commission values-------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewCourseCommissionValue_courseWise(string Bid) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; RAJ.MaxJsonLength = Int32.MaxValue; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewCourseCommissionValue_courseWise", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branch", Bid); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.catID = dr["catId"].ToString(); obj.Organisation = dr["orgName"].ToString(); obj.CourseCategory = dr["catName"].ToString(); obj.RAmount = dr["Value"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updPassword(string ID, string OldPwd, string NewPwd) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("updBranchpwd", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); cmd.Parameters.AddWithValue("@oldpwd", OldPwd); cmd.Parameters.AddWithValue("@newpwd", NewPwd); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return str; //} } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewstudentDetailsatewise(string Bid,string sdate,string edate) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); List lst = new List(); con.Open(); SqlCommand cmd = new SqlCommand("viewstudentDetailDateWise", con); cmd.CommandType = CommandType.StoredProcedure; if(Bid!=null&& Bid!="") cmd.Parameters.AddWithValue("@branchId", Bid); if (sdate != null && sdate != "") cmd.Parameters.AddWithValue("@Sdate", sdate); if (edate != null && edate != "") cmd.Parameters.AddWithValue("@edate", edate); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.catID = dr["studentId"].ToString(); obj.Organisation = dr["studentCode"].ToString(); obj.CourseCategory = dr["studentName"].ToString(); obj.RAmount = dr["studentFatherName"].ToString(); obj.abbriviation = dr["studentMobileNo"].ToString(); obj.address = dr["studentMother"].ToString(); obj.address1 = dr["branchCode"].ToString(); obj.adharrno = dr["branchName"].ToString(); obj.Age = dr["branchMobile"].ToString(); obj.alternateid = dr["studentDate"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //---------------Select Student---------- [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string verifyCandidateResult(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("verifyCandidateResult", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@id", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.Studentcode = dr["studentCode"].ToString(); obj.Shortname = dr["studentShortName"].ToString(); obj.countrycode = dr["studentCountryCode"].ToString(); obj.Religion = dr["studentReligion"].ToString(); obj.Disability = dr["studentDisability"].ToString(); obj.DisabilityProof = dr["studentDisabilityProof"].ToString(); obj.alternateid = dr["studentAlternateId"].ToString(); obj.alternateproof = dr["studentAlternateProof"].ToString(); obj.adharrno = dr["studentAdhaarNumber"].ToString(); obj.state1 = dr["studentState1"].ToString(); obj.district1 = dr["studentDistrict1"].ToString(); obj.tehsil = dr["studentTehsil"].ToString(); obj.Constituency = dr["studentConstituency"].ToString(); obj.address1 = dr["studentAddress1"].ToString(); obj.state2 = dr["studentState2"].ToString(); obj.district2 = dr["studentDistrict2"].ToString(); obj.tehsil1 = dr["studentTehsil1"].ToString(); obj.city1 = dr["studentCity1"].ToString(); obj.pincode1 = dr["studentPinCode1"].ToString(); obj.Constituency1 = dr["studentConstituency1"].ToString(); obj.ifsccode = dr["studentIFSCCode"].ToString(); obj.bankaddress = dr["studentBankAddress"].ToString(); obj.education = dr["studentEducation"].ToString(); obj.passingyear = dr["studentYearOfPassing"].ToString(); obj.photo1 = dr["photo1"].ToString(); obj.Education1 = dr["studentEducation1"].ToString(); obj.passingyear1 = dr["studentYearOfPassing1"].ToString(); obj.supportingdocument = dr["SupportinDocument"].ToString(); obj.pretraining = dr["studentPreTraining"].ToString(); obj.ExperieceSector = dr["PreExperienceSector"].ToString(); obj.expeSectorMonth = dr["NoOfMonthExpeSector"].ToString(); obj.Experiecejob = dr["PreExperienceJob"].ToString(); obj.expeSectoryear = dr["NoOfYearPreExperience"].ToString(); obj.EmployeeID = dr["Employed"].ToString(); obj.heardaboutus = dr["HeardAboutUs"].ToString(); obj.sector = dr["SelectSector"].ToString(); obj.subsector = dr["SelectSubSector"].ToString(); obj.jobrole = dr["SelectJobRole"].ToString(); obj.name = dr["studentName"].ToString(); obj.mobNo = dr["studentMobileNo"].ToString(); obj.emailID = dr["studentEmail"].ToString(); obj.sex = dr["studentSex"].ToString(); obj.DOB = dr["studentDOB"].ToString(); obj.marital = dr["studentMarital"].ToString(); obj.State = dr["studentState"].ToString(); obj.District = dr["studentDistrict"].ToString(); obj.categorydetails = dr["studentCategory"].ToString(); obj.MotherName = dr["studentMother"].ToString(); obj.fatherName = dr["studentFatherName"].ToString(); obj.PAddress = dr["studentAddress"].ToString(); obj.city = dr["studentCity"].ToString(); obj.pinCode = dr["studentPinCode"].ToString(); obj.photo = dr["photo"].ToString(); obj.bankusername = dr["paymentBankUserName"].ToString(); obj.BankAccount = dr["paymentBankAC"].ToString(); obj.Bankname = dr["paymentBankName"].ToString(); obj.courseId = dr["smCourseId"].ToString(); obj.EmployeeID = dr["EmploymentstatusId"].ToString(); obj.Employeedetail = dr["EmploymentDetail"].ToString(); obj.DisabilitySelection = dr["studentDisabilitySelection"].ToString(); obj.IdentitySelection = dr["studentIdentitySelection"].ToString(); obj.Stid = dr["pinMaskValue"].ToString(); obj.paperMark = dr["Result"].ToString(); obj.branchname = dr["branchName"].ToString(); obj.branchCodeName = dr["branchCode"].ToString(); obj.branchLimit = dr["branchstateName"].ToString(); obj.branchSecurity = dr["branchCity"].ToString(); obj.ActiveBranch = dr["branchdistrictName"].ToString(); obj.isActive = dr["issueDate"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } //--------view Batch------/// [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string viewBatchTC(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("viewbatch", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@branchid", ID); SqlDataReader dr = cmd.ExecuteReader(); PRPSetup obj; if (dr.HasRows) { while (dr.Read()) { obj = new PRPSetup(); obj.id = dr["mBatchId"].ToString(); obj.branchCodeName = dr["mBatchCode"].ToString(); obj.name = dr["mBatchName"].ToString(); obj.Level = dr["mBatchNSQFLevel"].ToString(); obj.StartDate = dr["mBatchStartDate"].ToString(); obj.Enddate = dr["mBatchEndDate"].ToString(); obj.size = dr["mBatchSize"].ToString(); obj.BCID = dr["BCID"].ToString(); obj.branchName = dr["branchName"].ToString(); obj.AssDate = dr["batchAssessmentDate"].ToString(); obj.TranierName = dr["mTrainerName"].ToString(); obj.TRID = dr["TRID"].ToString(); obj.ActiveBranch = dr["mBatchApprovedActive"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string ViewTrainingCenterbyId(string ID) { System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); //string strConnection = "Data Source=SONY-PC; Initial Catalog = DB_Reveals;Integrated Security=True"; RAJ.MaxJsonLength = int.MaxValue; List lst = new List(); //using (SqlConnection con = new SqlConnection(strConnection)) //{ con.Open(); SqlCommand cmd = new SqlCommand("TrainingCenterDetail_ById", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@tcid", ID); SqlDataReader dr = cmd.ExecuteReader(); Registration obj; if (dr.HasRows) { while (dr.Read()) { obj = new Registration(); obj.ID = Convert.ToInt32(dr["tcid"]); obj.Date = dr["Date"].ToString(); obj.Name = dr["tcName"].ToString(); obj.GeoLocation = dr["tcGeoLocation"].ToString(); obj.OwnerShip = dr["tcOwnership"].ToString(); obj.Type = dr["tcType"].ToString(); obj.Faculty_Type = dr["tcFaculty_Type"].ToString(); obj.CreateDate = dr["tccdate"].ToString(); obj.Area = dr["tcArea"].ToString(); obj.TrainingRoom = Convert.ToInt32(dr["TrainingRoom"]); obj.Labs = Convert.ToInt32(dr["Lab"]); obj.Male_WashRoom = Convert.ToInt32(dr["MaleWash"]); obj.Female_WashRoom = Convert.ToInt32(dr["FemaleWash"]); //obj.Unisex_WashRoom = Convert.ToInt32(dr["UnisexWash"]); //obj.Total_WashRoom = Convert.ToInt32(dr["TotalWashRoom"]); obj.Address = dr["Address"].ToString(); obj.LandMarks = dr["tcLandmark"].ToString(); obj.PinCode = dr["tcPincode"].ToString(); obj.StateName = dr["statename"].ToString(); obj.DistrictName = dr["districtname"].ToString(); obj.Tehsil = dr["tcTehsil"].ToString(); obj.City = dr["tcCity"].ToString(); obj.Costituencey = dr["ParlConstituency"].ToString(); obj.spiName = dr["spiName"].ToString(); obj.spiEmail = dr["spiEmail"].ToString(); obj.spiMobile = dr["spiMobile"].ToString(); obj.spiDesignation = dr["spiDesignation"].ToString(); obj.spiLandLine = dr["spiLandLine"].ToString(); //obj.Address_Prooftype = dr["APType"].ToString(); //obj.Address_Proof = dr["AddressProof"].ToString(); //obj.Document = dr["Document"].ToString(); lst.Add(obj); } } dr.Dispose(); cmd.Dispose(); con.Close(); //} return RAJ.Serialize(lst); } [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] public string updTrainingCenter(string tcId, string tcName, string tcGeoLocation,string tcOwnership,string tcType,string tcFaculty_Type,string tcCreate_date,string tcArea,string tcTrainingRooms, string tcLabs,string tcMale_WashRoom,string tcFemale_WashRoom,string tcAddress,string tcLandMark,string tcPinCode,string tcState,string tcDistrict,string tcTehsil,string tcCity, string tcParliamentary_Constituency, string spiName,string spiEmail,string spiMobile,string spiDesignation,string spiLandLine) { //string strConnection = "Data Source=MS-PC\SQLEXPRESS; Initial Catalog = DB_Reveals;Integrated Security=True"; //List userdetails = new List(); // using (SqlConnection con = new SqlConnection(strConnection)) //{ System.Web.Script.Serialization.JavaScriptSerializer RAJ = new System.Web.Script.Serialization.JavaScriptSerializer(); con.Open(); SqlCommand cmd = new SqlCommand("updTrainingCenter", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@tcId", tcId); cmd.Parameters.AddWithValue("@tcName", tcName); cmd.Parameters.AddWithValue("@tcGeoLocation", tcGeoLocation); cmd.Parameters.AddWithValue("@tcOwnership", tcOwnership); cmd.Parameters.AddWithValue("@tcType", tcType); cmd.Parameters.AddWithValue("@tcFaculty_Type", tcFaculty_Type); cmd.Parameters.AddWithValue("@tcCreate_date", tcCreate_date); cmd.Parameters.AddWithValue("@tcArea", tcArea); cmd.Parameters.AddWithValue("@tcTrainingRooms", tcTrainingRooms); cmd.Parameters.AddWithValue("@tcLabs", tcLabs); cmd.Parameters.AddWithValue("@tcMale_WashRoom", tcMale_WashRoom); cmd.Parameters.AddWithValue("@tcFemale_WashRoom", tcFemale_WashRoom); cmd.Parameters.AddWithValue("@tcAddress", tcAddress); cmd.Parameters.AddWithValue("@tcLandMark", tcLandMark); cmd.Parameters.AddWithValue("@tcPinCode", tcPinCode); cmd.Parameters.AddWithValue("@tcState", tcState); cmd.Parameters.AddWithValue("@tcDistrict", tcDistrict); cmd.Parameters.AddWithValue("@tcTehsil", tcTehsil); cmd.Parameters.AddWithValue("@tcCity", tcCity); cmd.Parameters.AddWithValue("@tcParliamentary_Constituency", tcParliamentary_Constituency); cmd.Parameters.AddWithValue("@spiName", spiName); cmd.Parameters.AddWithValue("@spiEmail", spiEmail); cmd.Parameters.AddWithValue("@spiMobile", spiMobile); cmd.Parameters.AddWithValue("@spiDesignation", spiDesignation); cmd.Parameters.AddWithValue("@spiLandLine", spiLandLine); string str = cmd.ExecuteScalar().ToString(); cmd.Dispose(); con.Close(); return str; //} } }