public String unregistr([FromBody] JObject parameter) { ServerLog.Log_QUA((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + "call"); String AppName = parameter["AppName"].ToString(); String DeviceId = parameter["DeviceId"].ToString(); BLReturnObject objBLReturnObject = new BLReturnObject(); String Message = String.Empty; Masters objmasters = new Masters(); Byte result = objmasters.RemoveDeviceInfo(AppName, DeviceId, ref Message); objBLReturnObject.ExecutionStatus = result; objBLReturnObject.ServerMessage = Message; objBLReturnObject.dt_ReturnedTables = null; return(JsonConvert.SerializeObject(objBLReturnObject)); }
public string sendmailforinvitefriend([FromBody] JObject parameter) { ServerLog.Log_QUA((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + "call"); //JavaScriptSerializer js = new JavaScriptSerializer(); //string[] persons = js.Deserialize<string[]>(parameter["dataemail"]["email_list_send"].ToString()); emailSendFrined objsendmail = new emailSendFrined(); string result = ""; bool resultSendEmail = false; bool security_flag = false; try { if (parameter["dataemail"]["email_list_send"].ToString() != "") { objsendmail = parameter["dataemail"].ToObject <emailSendFrined>(); } if (objsendmail.email_list_send != null && objsendmail.email_list_send.Length > 0) { for (int i = 0; i < objsendmail.email_list_send.Length; i++) { resultSendEmail = sendinvitemail(objsendmail.email_list_send[i]); } } if (resultSendEmail == true) { ServerLog.Log_QUA((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + "Pass"); return(BLGeneralUtil.return_ajax_string("1", "Thanks for your referral")); } else { ServerLog.Log_QUA((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + "Fail"); return(BLGeneralUtil.return_ajax_string("0", "please Enter Email ID")); } } catch (Exception ex) { ServerLog.Log_QUA((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + ex.StackTrace); return(BLGeneralUtil.return_ajax_string("0", "some thing went wrong")); } //return result; }
public string forgotpassword([FromBody] JObject parameter) { BLReturnObject objBLReturnObject = new BLReturnObject(); bool flag = false; Random rand = new Random(); int randomNo = rand.Next(1, 1000000); ServerLog.Log_QUA((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + "call"); if (parameter["email_id"] == null || parameter["email_id"].ToString() == "") { return(BLGeneralUtil.return_ajax_string("0", "Email id not found")); } try { DataTable dt = objmasters.LoginCheck(parameter["email_id"].ToString()); if (dt == null) { return(BLGeneralUtil.return_ajax_string("0", "No Datails Found")); } else { flag = forgotpassword(dt.Rows[0]["email_id"].ToString(), dt.Rows[0]["university"].ToString()); } } catch (Exception ex) { ServerLog.Log_QUA((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + ex.ToString() + "status" + ""); return(BLGeneralUtil.return_ajax_string("0", ex.Message)); } if (flag == true) { return(BLGeneralUtil.return_ajax_string("1", "please check mail to update new password")); } else { return(BLGeneralUtil.return_ajax_string("0", "some thing went wrong")); } }
public String RegisterDeviceAndroid([FromBody] JObject parameter) { //ResponseObjectInfo objResponseObjectInfo = new ResponseObjectInfo(); BLReturnObject objBLReturnObject = new BLReturnObject(); String AppName = parameter["AppName"].ToString(); String RepId = parameter["RepId"].ToString(); String DeviceId = parameter["DeviceId"].ToString(); String TokenId = parameter["TokenId"].ToString(); String DeviceInfo = parameter["DeviceInfo"].ToString(); String OS = parameter["OS"].ToString(); String IMEINo = parameter["IMEINo"].ToString(); try { ServerLog.Log_QUA((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + "RegisterDeviceAndroid(" + Convert.ToString(AppName) + ", " + Convert.ToString(RepId) + ", " + Convert.ToString(DeviceId) + ", " + Convert.ToString(TokenId) + ", " + Convert.ToString(DeviceInfo) + ", " + Convert.ToString(OS) + ", " + Convert.ToString(IMEINo) + ")"); // ServerLog.ExceptionLog("RegisterDeviceAndroid(" + Convert.ToString(AppName) + ", " + Convert.ToString(RepId) + ", " + Convert.ToString(DeviceId) + ", " + Convert.ToString(TokenId) + ", " + Convert.ToString(DeviceInfo) + ", " + Convert.ToString(OS) + ", " + Convert.ToString(IMEINo) + ")"); if (AppName == null || AppName.Trim() == String.Empty) { objBLReturnObject.ExecutionStatus = 2; objBLReturnObject.ServerMessage = "Please supplied AppName."; objBLReturnObject.dt_ReturnedTables = null; } else if (RepId == null || RepId.Trim() == String.Empty) { objBLReturnObject.ExecutionStatus = 2; objBLReturnObject.ServerMessage = "Please supplied RepId."; objBLReturnObject.dt_ReturnedTables = null; } else if (DeviceId == null || DeviceId.Trim() == String.Empty) { objBLReturnObject.ExecutionStatus = 2; objBLReturnObject.ServerMessage = "Please supplied DeviceId."; objBLReturnObject.dt_ReturnedTables = null; } else if (TokenId == null || TokenId.Trim() == String.Empty) { objBLReturnObject.ExecutionStatus = 2; objBLReturnObject.ServerMessage = "Please supplied TokenId."; objBLReturnObject.dt_ReturnedTables = null; } else if (OS == null || OS.Trim() == String.Empty) { objBLReturnObject.ExecutionStatus = 2; objBLReturnObject.ServerMessage = "Please supplied OS."; objBLReturnObject.dt_ReturnedTables = null; } else if (IMEINo == null || IMEINo.Trim() == String.Empty) { objBLReturnObject.ExecutionStatus = 2; objBLReturnObject.ServerMessage = "Please supplied IMEINo."; objBLReturnObject.dt_ReturnedTables = null; } else { String Message = String.Empty; Masters objmasters = new Masters(); Byte result = objmasters.AddDeviceInfo(AppName, RepId, DeviceId, TokenId, DeviceInfo, OS, IMEINo, ref Message); objBLReturnObject.ExecutionStatus = result; objBLReturnObject.ServerMessage = Message; objBLReturnObject.dt_ReturnedTables = null; } } catch (Exception ex) { objBLReturnObject.ExecutionStatus = 2; objBLReturnObject.ServerMessage = ex.Message; objBLReturnObject.dt_ReturnedTables = null; // ServerLog.ExceptionLog("RegisterDeviceAndroid(" + Convert.ToString(AppName) + ", " + Convert.ToString(RepId) + ", " + Convert.ToString(DeviceId) + ", " + Convert.ToString(TokenId) + ", " + Convert.ToString(DeviceInfo) + ", " + Convert.ToString(OS) + ")"); ServerLog.Log((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + ex.StackTrace); } return(JsonConvert.SerializeObject(objBLReturnObject)); }
public string save_registrationquantina([FromBody] JObject parameter) { BLReturnObject objBLReturnObject = new BLReturnObject(); bool flag = false; Random rand = new Random(); int randomNo = rand.Next(1, 1000000); ServerLog.Log_QUA((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + "call"); if (parameter["university"] == null || parameter["university"].ToString() == "") { return(BLGeneralUtil.return_ajax_string("0", "university not found")); } else if (parameter["email_id"] == null || parameter["email_id"].ToString() == "") { return(BLGeneralUtil.return_ajax_string("0", "Email id not found")); } else if (parameter["password"] == null || parameter["password"].ToString() == "") { return(BLGeneralUtil.return_ajax_string("0", "password not found")); } else if (parameter["app_name"] == null || parameter["app_name"].ToString() == "") { return(BLGeneralUtil.return_ajax_string("0", "app name not found")); } //check if exites user DataTable user = objmasters.ismemberexits(parameter["email_id"].ToString().ToLower()); if (user != null && user.Rows.Count > 0) { return(BLGeneralUtil.return_ajax_string("0", "this email Id is already registered ")); } try { DS_General.member_masterRow objmember_maste = objgeneral.member_master.Newmember_masterRow(); objmember_maste.member_code = "1"; objmember_maste.app_name = parameter["app_name"].ToString(); objmember_maste.university = parameter["university"].ToString(); objmember_maste.first_name = parameter["name"].ToString(); objmember_maste.email_id = parameter["email_id"].ToString().ToLower(); EncryptPassword encrpt = new EncryptPassword(); string encrpt_password = encrpt.Encrypt(parameter["password"].ToString()); objmember_maste.email_rand_no = randomNo; objmember_maste.password = encrpt_password; objmember_maste.is_active = "N"; objmember_maste.is_quantina = "Y"; objmember_maste.created_by = parameter["email_id"].ToString(); objmember_maste.created_date = System.DateTime.Now; objmember_maste.created_host = HttpContext.Current.Request.UserHostName; string BlobId = DoUserRegistrationQuickBlox(parameter["name"].ToString(), parameter["email_id"].ToString(), "admin@123"); if (BlobId == null || BlobId == "") { return(BLGeneralUtil.return_ajax_string("0", "some thing went wrong")); } else { objmember_maste.BlobId = BlobId; objgeneral.member_master.Addmember_masterRow(objmember_maste); } DS_Transtration.fn_token_balanceRow token_bal_row = objDs_trastration.fn_token_balance.Newfn_token_balanceRow(); token_bal_row.doc_no = "1"; token_bal_row.member_id = parameter["email_id"].ToString().ToLower(); token_bal_row.total_debit = Convert.ToInt16(0.0); token_bal_row.total_credit = Convert.ToInt16(0.0); token_bal_row.balance_token = Convert.ToInt16(0.0); token_bal_row.balance_amount = Convert.ToInt16(0.0); token_bal_row.is_active = "Y"; token_bal_row.created_by = parameter["email_id"].ToString().ToLower(); token_bal_row.created_date = System.DateTime.Now; token_bal_row.created_host = HttpContext.Current.Request.UserHostName; objDs_trastration.fn_token_balance.Addfn_token_balanceRow(token_bal_row); objBLReturnObject = objmasters.save_regstration(objgeneral, objDs_trastration); if (objBLReturnObject.ExecutionStatus == 1) { try { // bool resultSendEmail = false; bool resultSendEmail = profliecreationsendEmail(parameter["email_id"].ToString(), parameter["name"].ToString(), randomNo, parameter["university"].ToString(), ""); if (resultSendEmail == true) { flag = true; } } catch (Exception ex) { ServerLog.Log_QUA((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + ex.StackTrace); return(BLGeneralUtil.return_ajax_string("0", ex.ToString())); } } } catch (Exception ex) { ServerLog.Log_QUA((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + ex.StackTrace); return(BLGeneralUtil.return_ajax_string("0", ex.ToString())); } if (flag == true) { ServerLog.Log_QUA((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + "1"); return(BLGeneralUtil.return_ajax_string("1", "Thanks for signing up! Please click on the link sent to your email to confirm your account")); } else { return(BLGeneralUtil.return_ajax_string("0", "some things goes to wrong")); } }
public string logincheck([FromBody] JObject parameter) { BLReturnObject objBLReturnObject = new BLReturnObject(); bool flag = false; Random rand = new Random(); int randomNo = rand.Next(1, 1000000); ServerLog.Log_QUA((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + "call"); if (parameter["email_id"] == null || parameter["email_id"].ToString() == "") { return(BLGeneralUtil.return_ajax_string("0", "Email id not found")); } else if (parameter["password"] == null || parameter["password"].ToString() == "") { return(BLGeneralUtil.return_ajax_string("0", "password not found")); } else if (parameter["app_name"] == null || parameter["app_name"].ToString() == "") { return(BLGeneralUtil.return_ajax_string("0", "app name not found")); } try { EncryptPassword encrpt = new EncryptPassword(); string encrpt_password = encrpt.Encrypt(parameter["password"].ToString()); //check DataTable user = objmasters.ismemberexits(parameter["email_id"].ToString().ToLower()); if (user == null || user.Rows.Count < 0) { return(BLGeneralUtil.return_ajax_string("0", "this email Id is not registered ")); } if (user.Rows[0]["email_rand_no"].ToString() != "0") { return(BLGeneralUtil.return_ajax_string("0", "This email ID has not yet been confirmed ")); } else if (user.Rows[0]["is_quantina"].ToString() == null || user.Rows[0]["is_quantina"].ToString() == "") { return(BLGeneralUtil.return_ajax_string("0", "this email Id is not allowed in this app ")); } else if (user.Rows[0]["BlobId"].ToString() == null || user.Rows[0]["BlobId"].ToString() == "") { return(BLGeneralUtil.return_ajax_string("0", "Blob ID not Found ")); } else if (user.Rows[0]["password"].ToString() != encrpt_password) { return(BLGeneralUtil.return_ajax_string("0", " password is wrong")); } else if (user.Rows[0]["password"].ToString() == encrpt_password) { if (user.Rows[0]["is_quantina"].ToString() == "Y") { return(BLGeneralUtil.return_ajax_data("1", GetJson1(user))); } } else { } } catch (Exception ex) { ServerLog.Log_QUA((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + ex.StackTrace); return(BLGeneralUtil.return_ajax_string("0", ex.ToString())); } if (flag == true) { ServerLog.Log_QUA((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + "1"); return(BLGeneralUtil.return_ajax_string("1", "saved successfully")); } else { return(BLGeneralUtil.return_ajax_string("0", "some things goes to wrong")); } }