コード例 #1
0
        public string Unlock()
        {
            try
            {
                DBConnection.Open();
                DBCommand.Transaction = DBConnection.BeginTransaction();

                DBCommand.Transaction.Commit();
                if (DBConnection.State == ConnectionState.Open)
                {
                    DBConnection.Close();
                }

                return(BLGeneralUtil.return_ajax_string("1", "Done"));
            }
            catch (Exception ex)
            {
                DBCommand.Transaction.Rollback();
                if (DBConnection.State == ConnectionState.Open)
                {
                    DBConnection.Close();
                }
                return(BLGeneralUtil.return_ajax_string("0", ex.Message));
            }
        }
コード例 #2
0
        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"));
            }
        }
コード例 #3
0
        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;
        }
コード例 #4
0
        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"));
            }
        }
コード例 #5
0
        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"));
            }
        }
コード例 #6
0
        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"));
            }
        }
コード例 #7
0
        public string SaveAppLog([FromBody]  JObject jobj)
        {
            AppLog         jobjdata = new AppLog();
            Document       doc = new Document();
            BLReturnObject objBLReturnObject = new BLReturnObject(); Master master = new Master();
            string         message = "";
            DS_AppLog      ds_app  = new DS_AppLog();
            List <AppLog>  tload   = new List <AppLog>();

            tload = jobj["log"].ToObject <List <AppLog> >();
            DataTable dt_log = new DataTable(); string LogDocID = "";

            dt_log = BLGeneralUtil.ToDataTable(tload);
            try
            {
                if (jobj != null)
                {
                    if (dt_log != null && dt_log.Rows.Count > 0)
                    {
                        DBConnection.Open();
                        DBCommand.Transaction     = DBConnection.BeginTransaction();
                        ds_app.EnforceConstraints = false;
                        if (!doc.W_GetNextDocumentNo(ref DBCommand, "APL", "", "", ref LogDocID, ref message)) // New Driver Notification ID
                        {
                            return(BLGeneralUtil.return_ajax_string("0", message));
                        }
                        ds_app.AppLog.ImportRow(dt_log.Rows[0]);
                        ds_app.AppLog[0].log_id       = LogDocID;
                        ds_app.AppLog[0].log_date     = System.DateTime.UtcNow;
                        ds_app.AppLog[0].created_date = System.DateTime.UtcNow;
                        ds_app.AppLog[0].AcceptChanges();
                        ds_app.AppLog[0].SetAdded();
                        ds_app.EnforceConstraints = true;
                        objBLReturnObject         = master.UpdateTables(ds_app.AppLog, ref DBCommand);
                        if (objBLReturnObject.ExecutionStatus != 1)
                        {
                            ServerLog.Log(objBLReturnObject.ServerMessage.ToString());
                            DBCommand.Transaction.Rollback();
                            if (DBConnection.State == ConnectionState.Open)
                            {
                                DBConnection.Close();
                            }
                            return(BLGeneralUtil.return_ajax_string("0", objBLReturnObject.ServerMessage));
                        }
                        DBCommand.Transaction.Commit();
                        if (DBConnection.State == ConnectionState.Open)
                        {
                            DBConnection.Close();
                        }
                        objBLReturnObject.ExecutionStatus = 1;
                        ServerLog.SuccessLog("App Log Entry Saved : " + LogDocID);
                    }
                }
            }
            catch (Exception ex)
            {
                ServerLog.Log(ex.Message + ex.StackTrace);
                DBCommand.Transaction.Rollback();
                if (DBConnection.State == ConnectionState.Open)
                {
                    DBConnection.Close();
                }
                return(BLGeneralUtil.return_ajax_string("0", ex.Message));
            }
            return(BLGeneralUtil.return_ajax_string("1", "App Log Entry Saved : " + LogDocID));
        }