public string GetParameter(string paramcode, string paramvalue) { DataTable dtPostLoadOrders = new DataTable(); String query1 = "SELECT * FROM param_mst where param_code = @parcode and param_value = @parvalue "; DBConnection.Open(); DBDataAdpterObject.SelectCommand.Parameters.Clear(); DBDataAdpterObject.SelectCommand.CommandText = query1; DBDataAdpterObject.SelectCommand.Parameters.Add(BLGeneralUtil.MakeParameter("parcode", DbType.String, paramcode)); DBDataAdpterObject.SelectCommand.Parameters.Add(BLGeneralUtil.MakeParameter("parvalue", DbType.String, paramvalue)); DataSet ds = new DataSet(); DBDataAdpterObject.Fill(ds); if (ds != null && ds.Tables.Count > 0) { if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { dtPostLoadOrders = ds.Tables[0]; } } DBConnection.Close(); if (dtPostLoadOrders != null && dtPostLoadOrders.Rows.Count > 0) { return(BLGeneralUtil.return_ajax_data("1", SendReceiveJSon.GetJson(dtPostLoadOrders))); } else { return(BLGeneralUtil.return_ajax_string("0", "No Data Found")); } }
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")); } }