Exemplo n.º 1
0
        public string Logout([FromBody] JObject parameter)
        {
            BLReturnObject objBLReturnObject = new BLReturnObject();
            DataTable      dt     = new DataTable();
            string         result = "";
            string         tok    = parameter["token_id"].ToString();

            dt = objmasters.Gettokenuserinfo(tok);
            if (dt != null)
            {
                DataRow dr = dt.Rows[0];
                dr["token_id"] = '0';
                objDS_MemberTables.login_token.ImportRow(dr);
                objBLReturnObject = objmasters.logoutlink(objDS_MemberTables, true);
                if (objBLReturnObject.ExecutionStatus == 1)
                {
                    return("pass");
                }
                else
                {
                    return("fail");
                }
            }
            return("fail");
        }
Exemplo n.º 2
0
        public string gettoken([FromBody] JObject loginData)
        {
            BLReturnObject objBLReturnObject = new BLReturnObject();
            Random         rand    = new Random();
            int            tokenId = rand.Next(1, 100000);
            String         result  = "";

            DataTable userdata = objmasters.getuserdetai_byiphone(loginData["memberid"].ToString());


            userdata.Rows[0]["token_id"] = tokenId.ToString();

            objDS_MemberTables.member_master.ImportRow(userdata.Rows[0]);

            objBLReturnObject = objmasters.saveLinkData(objDS_MemberTables, true);
            if (objBLReturnObject.ExecutionStatus == 1)
            {
                result = GetJson1(userdata);
            }
            else
            {
                result = "";
            }

            return(result);
        }
        public String UnreadCount([FromBody] JObject parameter)
        {
            String AppName     = parameter["AppName"].ToString();
            String RepId       = parameter["RepId"].ToString();
            String DeviceId    = parameter["DeviceId"].ToString();
            int    UnreadCount = Convert.ToInt16(parameter["UnreadCount"].ToString());

            //ResponseObjectInfo objResponseObjectInfo = new ResponseObjectInfo();

            BLReturnObject objBLReturnObject = new BLReturnObject();
            String         Message           = String.Empty;
            Masters        objmasters        = new Masters();

            try
            {
                //ServerLog.MgmtExceptionLog("UnreadCount(" + Convert.ToString(AppName) + ", " + Convert.ToString(RepId) + ", " + Convert.ToString(DeviceId) + ", " + Convert.ToString(UnreadCount) + ")");
                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 (UnreadCount < 0)
                {
                    objBLReturnObject.ExecutionStatus   = 2;
                    objBLReturnObject.ServerMessage     = "Please supplied Valid UnreadCount.";
                    objBLReturnObject.dt_ReturnedTables = null;
                }
                else
                {
                    Byte result = objmasters.UpdateUnreadCount(AppName, RepId, DeviceId, UnreadCount, 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.MgmtExceptionLog("UnreadCount(" + Convert.ToString(AppName) + ", " + Convert.ToString(RepId) + ", " + Convert.ToString(DeviceId) + ", " + Convert.ToString(UnreadCount) + ")");
                //    ServerLog.MgmtExceptionLog(ex.Message + Environment.NewLine + ex.StackTrace);
            }
            return(JsonConvert.SerializeObject(objBLReturnObject));
        }
Exemplo n.º 4
0
        public string updateForEmailVerification([FromBody] UpdateForEmailVerification emailVerificationData)
        {
            BLReturnObject objBLReturnObject = new BLReturnObject();
            bool           flag = false;
            bool           alreadyVerifiedFLAG = false;
            //get already exists data
            DataTable dtMemberMst = objmasters.GetMemberMstData(emailVerificationData.QS_emailId, emailVerificationData.QS_randomNo);

            if (dtMemberMst == null || dtMemberMst.Rows.Count == 0)
            {
                flag = false;
                alreadyVerifiedFLAG = true;
            }
            else
            {
                try
                {
                    DataRow dr = dtMemberMst.Rows[0];
                    dr["email_rand_no"] = 0;
                    dr["is_active"]     = "Y";

                    objDS_MemberTables.member_master.ImportRow(dr);
                    objBLReturnObject = objmasters.saveLinkData(objDS_MemberTables, true); //second parameter indicates that its a update method call
                    if (objBLReturnObject.ExecutionStatus == 1)
                    {
                        flag = true;
                    }
                }

                catch (Exception ex)
                {
                    flag = false;
                }
            }
            if (flag == true)
            {
                string result = GetJson1(dtMemberMst);
                return(result);
            }
            else
            {
                if (alreadyVerifiedFLAG == true)
                {
                    return("AlreadyVerified");
                }
                else
                {
                    return("Fail");
                }
            }
        }
Exemplo n.º 5
0
        public void RegisterAndUpdateBlobIdFromConfigMaster([FromBody] JObject parameter)
        {
            //  ResponseObjectInfo objResponseObjectInfo = new ResponseObjectInfo();
            try
            {
                BLReturnObject objBLReturnObject = new BLReturnObject();
                // ServerLog.MgmtExceptionLog("RegisterAndUpdateBlobIdFromConfigMaster()");

                String Message = String.Empty, AccountTypeList = String.Empty;


                DataTable dtUserDetailsWithBlobIdNull = objmasters.get_member_id_allnull();

                if (dtUserDetailsWithBlobIdNull != null && dtUserDetailsWithBlobIdNull.Rows.Count > 0)
                {
                    DataRow[] drBlobId = dtUserDetailsWithBlobIdNull.Select("BlobId is null");


                    int bcount = 0;
                    foreach (DataRow dr in drBlobId)
                    {
                        // DataRow dr = drBlobId[0];
                        string FetchedRepId = dr["member_code"].ToString();

                        //user quickblox registration
                        string BlobId = DoUserRegistrationQuickBlox(dr["first_name"].ToString(), dr["email_id"].ToString(), "admin@123");
                        if (BlobId == null)
                        {
                        }
                        else
                        {
                            drBlobId[bcount]["BlobId"] = BlobId;
                            objgeneral.member_master.ImportRow(drBlobId[bcount]);
                            objBLReturnObject = objmasters.update_member(objgeneral);
                        }
                        if (objBLReturnObject.ExecutionStatus == 1)
                        {
                        }
                        bcount++;
                    }
                }
                else
                {
                }
            }
            catch (Exception ex)
            {
            }
        }
        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));
        }
Exemplo n.º 7
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"));
            }
        }
Exemplo n.º 8
0
        public string update_password([FromBody] JObject parameter)
        {
            BLReturnObject objBLReturnObject = new BLReturnObject();

            try
            {
                string pwd = parameter["password"].ToString();
                pwd = pwd.Trim();
                EncryptPassword encrpt = new EncryptPassword();

                string encrpt_password = encrpt.Encrypt(pwd.ToString().Trim());

                string    member_code = parameter["member_code"].ToString();
                DataTable dt          = new DataTable();
                dt = objmasters.getuserinfo(member_code);

                DataRow dr = dt.Rows[0];
                dr["password"] = encrpt_password;
                objDS_MemberTables.member_master.ImportRow(dr);

                objBLReturnObject = objmasters.saveLinkData(objDS_MemberTables, true);

                if (objBLReturnObject.ExecutionStatus == 1)
                {
                    ServerLog.Log((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + "Pass");
                    return("pass");
                }
                else
                {
                    ServerLog.Log((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + "Fail");
                    return("fail");
                }
            }
            catch (Exception ex)
            {
                ServerLog.Log((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + parameter.ToString() + "status" + ex.StackTrace);

                return("fail");
            }
        }
Exemplo n.º 9
0
        public string SaveRelation([FromBody] JObject Parameter)
        {
            var tempkey = Parameter.Properties().Select(p => p.Name).ToList();

            BLReturnObject objBLReturnObject = new BLReturnObject();
            Master         SvRelation        = new Master();

            owner_truck_details truck_Owner_data     = new owner_truck_details();
            driver_truck_detail drivertruck          = new driver_truck_detail();
            owner_driver_detail ownerDriverData      = new owner_driver_detail();
            LoginCheck          login_data           = new LoginCheck();
            owner_truck_details ownerTruckDetailData = new owner_truck_details();

            if (tempkey.Contains("login_data"))
            {
                login_data = Parameter["login_data"].ToObject <LoginCheck>();
            }
            if (tempkey.Contains("truck_owner"))
            {
                truck_Owner_data = Parameter["truck_owner"].ToObject <owner_truck_details>();
            }
            if (tempkey.Contains("truck_driver"))
            {
                drivertruck = Parameter["truck_driver"].ToObject <driver_truck_detail>();
            }
            if (tempkey.Contains("owner_driver"))
            {
                ownerDriverData = Parameter["owner_driver"].ToObject <owner_driver_detail>();
            }


            #region Truck Owner Data
            if (truck_Owner_data != null)
            {
                if (truck_Owner_data.owner_id != null && truck_Owner_data.truck_id != null)
                {
                    try
                    {
                        //owid = truck_Owner_data.owner_id;
                        DS_Truck_Mst.owner_truck_detailsRow owrow = objtruck.owner_truck_details.Newowner_truck_detailsRow();
                        owrow.owner_id     = truck_Owner_data.owner_id;
                        owrow.truck_id     = truck_Owner_data.truck_id;
                        owrow.active_flag  = "Y";
                        owrow.created_by   = login_data.user_id;
                        owrow.created_date = System.DateTime.UtcNow;
                        owrow.created_host = "1111";
                        owrow.device_id    = login_data.device_id;
                        owrow.device_type  = login_data.device_type;
                        objtruck.owner_truck_details.Addowner_truck_detailsRow(owrow);
                    }
                    catch (Exception ex)
                    {
                        ServerLog.Log("Truck Owner Relation: " + ex.Message.ToString() + ex.StackTrace.ToString());
                        return(ex.Message.ToString());
                    }
                }
            }
            #endregion

            #region Truck Driver Details
            if (drivertruck != null)
            {
                if (drivertruck.driver_id != null && drivertruck.truck_id != null)
                {
                    try
                    {
                        DS_Truck_Mst.driver_truck_detailsRow trkdrvrow = objtruck.driver_truck_details.Newdriver_truck_detailsRow();
                        trkdrvrow.driver_id    = drivertruck.driver_id;
                        trkdrvrow.truck_id     = drivertruck.truck_id;
                        trkdrvrow.active_flag  = "Y";
                        trkdrvrow.created_by   = login_data.user_id;
                        trkdrvrow.created_date = System.DateTime.UtcNow;
                        trkdrvrow.created_host = "1111";
                        trkdrvrow.device_id    = login_data.device_id;
                        trkdrvrow.device_type  = login_data.device_type;
                        objtruck.driver_truck_details.Adddriver_truck_detailsRow(trkdrvrow);
                    }
                    catch (Exception ex)
                    {
                        ServerLog.Log("Truck Driver Relation : " + ex.Message.ToString());
                        return(ex.Message.ToString());
                    }
                }
            }

            #endregion

            #region Owner Driver Details
            try
            {
                if (tempkey.Contains("owner_driver"))
                {
                    ownerDriverData = Parameter["owner_driver"].ToObject <owner_driver_detail>();
                    if (ownerDriverData != null)
                    {
                        if (ownerDriverData.owner_id != null && ownerDriverData.driver_id != null)
                        {
                            try
                            {
                                DS_Owner_Mst.owner_driver_detailsRow owndrvrow = objowner.owner_driver_details.Newowner_driver_detailsRow();
                                owndrvrow.owner_id     = ownerDriverData.owner_id;
                                owndrvrow.driver_id    = ownerDriverData.driver_id;
                                owndrvrow.active_flag  = "Y";
                                owndrvrow.created_by   = login_data.user_id;
                                owndrvrow.created_date = System.DateTime.UtcNow;
                                owndrvrow.created_host = "1111";
                                owndrvrow.device_id    = login_data.device_id;
                                owndrvrow.device_type  = login_data.device_type;
                                objowner.owner_driver_details.Addowner_driver_detailsRow(owndrvrow);
                            }
                            catch (Exception ex)
                            {
                                ServerLog.Log("Owner Driver Relation: " + ex.Message.ToString());
                                responsecls.status  = "0";
                                responsecls.Message = ex.Message;
                                return(jser.Serialize(responsecls));
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ServerLog.Log(ex.Message);
                responsecls.status  = "0";
                responsecls.Message = ex.Message;
                return(jser.Serialize(responsecls));
            }
            #endregion


            DataSet[] dsall = new DataSet[2];
            dsall[0] = objtruck;
            dsall[1] = objowner;

            // objBLReturnObject = ownermst.Save_Owner_Mst(objowner, objOwnerDriver);
            objBLReturnObject = SvRelation.SaveOwnerTruckDriverRelation(dsall);
            if (objBLReturnObject.ExecutionStatus == 1)
            {
                return(objBLReturnObject.ServerMessage);
            }
            else
            {
                ServerLog.Log(objBLReturnObject.ServerMessage.ToString());
                return(objBLReturnObject.ServerMessage);
            }
        }
Exemplo n.º 10
0
        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));
        }
Exemplo n.º 11
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"));
            }
        }
Exemplo n.º 12
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"));
            }
        }
Exemplo n.º 13
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));
        }
Exemplo n.º 14
0
        public string saveUserLinkData([FromBody] EmailLink emailLinkData)
        {
            BLReturnObject objBLReturnObject = new BLReturnObject();
            string         flag            = "";
            bool           resultSendEmail = false;

            Random rand     = new Random();
            int    randomNo = rand.Next(1, 1000000);


            //pooja bhadania on 18/4/16
            DataTable dtAlreadyExistsEmailId = objmasters.LoginCheck(emailLinkData.email_id);  //LoginCheck method has same parameter that we need.So directly use it but name is differ

            if (dtAlreadyExistsEmailId != null && dtAlreadyExistsEmailId.Rows.Count == 1)
            {
                flag = "EmailExists";
                return(flag);
            }


            emailLinkData.password = emailLinkData.password.Trim();
            EncryptPassword encrpt          = new EncryptPassword();
            string          encrpt_password = encrpt.Encrypt(emailLinkData.password.ToString().Trim());

            try
            {
                DataTable dtAlreadyExistsButNotVerified = objmasters.GetMemberDataFromEmailId(emailLinkData.email_id);
                if (dtAlreadyExistsButNotVerified != null && dtAlreadyExistsButNotVerified.Rows.Count == 1)
                {
                    DataRow dr = dtAlreadyExistsButNotVerified.Rows[0];
                    dr["first_name"]    = emailLinkData.userName;
                    dr["university"]    = emailLinkData.university;
                    dr["password"]      = encrpt_password;
                    dr["email_rand_no"] = randomNo;
                    dr["created_date"]  = System.DateTime.Now;
                    dr["created_host"]  = HttpContext.Current.Request.UserHostName;

                    objDS_MemberTables.member_master.ImportRow(dr);
                    objBLReturnObject = objmasters.saveLinkData(objDS_MemberTables, true); //update flag true
                }
                else
                {
                    DS_MemberTables.member_masterRow memMstRow = objDS_MemberTables.member_master.Newmember_masterRow();

                    memMstRow.member_code   = randomNo.ToString(); //It is just passing the primary which will not store in db.
                    memMstRow.first_name    = emailLinkData.userName;
                    memMstRow.university    = emailLinkData.university;
                    memMstRow.email_id      = emailLinkData.email_id;
                    memMstRow.password      = encrpt_password;
                    memMstRow.email_rand_no = randomNo;  //randomly generated number
                    memMstRow.is_active     = "N";
                    memMstRow.created_by    = emailLinkData.email_id;
                    memMstRow.created_date  = System.DateTime.Now;
                    memMstRow.created_host  = HttpContext.Current.Request.UserHostName;


                    objDS_MemberTables.member_master.Addmember_masterRow(memMstRow);
                    objBLReturnObject = objmasters.saveLinkData(objDS_MemberTables, false);
                }

                if (objBLReturnObject.ExecutionStatus == 1)
                {
                    //resultSendEmail = sendEmail(emailLinkData.email_id, emailLinkData.userName, randomNo, emailLinkData.university, emailLinkData.university_icon);

                    //try
                    //{
                    //    DS_Transtration.fn_token_balanceRow book_row = objDs_transtration.fn_token_balance.Newfn_token_balanceRow();

                    //    book_row.doc_no = "1";
                    //    book_row.member_id = emailLinkData.email_id;
                    //    book_row.total_credit = 0;
                    //    book_row.total_debit = 0;
                    //    book_row.balance_amount = 0;
                    //    book_row.is_active = "Y";
                    //    book_row.created_by = emailLinkData.email_id;
                    //    book_row.created_date = System.DateTime.Now;
                    //    book_row.created_host = HttpContext.Current.Request.UserHostName;

                    //    objDs_transtration.fn_token_balance.Addfn_token_balanceRow(book_row);

                    //    objBLReturnObject = objmasters.savetokenbooking(objDs_transtration, false);

                    //}
                    //catch (Exception e)
                    //{


                    //}
                }
                else
                {
                    flag = "Fail";
                    return(flag);
                }
            }

            catch (Exception ex)
            {
                flag = "Fail";
                return(flag);
            }

            if (resultSendEmail == true)
            {
                flag = "Pass";
            }
            else
            {
                flag = "Fail";
            }

            return(flag);
        }
Exemplo n.º 15
0
        public string LoginCheckprofile([FromBody] LoginData loginData)
        {
            BLReturnObject objBLReturnObject = new BLReturnObject();
            DataTable      dtMemberDetails   = new DataTable();
            string         result            = "";
            string         encrpt_password   = "";

            dtMemberDetails = objmasters.LoginCheckProfilecreation(loginData.userName);
            if (dtMemberDetails == null || dtMemberDetails.Rows.Count == 0)
            {
                return("NotExists");
            }
            else
            {
                if (loginData.pass_encrpted_flag != "true")
                {
                    loginData.password = loginData.password.Trim();
                    EncryptPassword encrpt = new EncryptPassword();
                    encrpt_password = encrpt.Encrypt(loginData.password.ToString().Trim());
                }
                else
                {
                    encrpt_password = loginData.password;
                }

                if (dtMemberDetails.Rows[0]["password"].ToString() != encrpt_password)
                {
                    return("WrongPass");
                }
                else
                {
                    Random rand    = new Random();
                    int    tokenId = rand.Next(1, 100000);

                    DataRow dr = dtMemberDetails.Rows[0];
                    //dr["token_id"] = tokenId.ToString();

                    objDS_MemberTables.member_master.ImportRow(dr);

                    objBLReturnObject = objmasters.saveLinkData(objDS_MemberTables, true);
                    if (objBLReturnObject.ExecutionStatus == 1)
                    {
                        //var session = HttpContext.Current.Session;
                        //if (session != null)
                        //{
                        //    if (session["token_id"] == null)
                        //    {
                        //        session["token_id"] = dtMemberDetails.Rows[0]["token_id"].ToString();
                        //    }
                        //}


                        //string str = HttpContext.Current.Session["token_id"].ToString();
                        //result = str;
                        result = GetJson1(dtMemberDetails);
                    }
                    else
                    {
                        return("TokenIssue");
                    }
                }
            }
            return(result);
        }
Exemplo n.º 16
0
        public string LoginCheck([FromBody] LoginData loginData)
        {
            int            flg = 0;
            BLReturnObject objBLReturnObject = new BLReturnObject();
            DataTable      dtMemberDetails   = new DataTable();
            string         result            = "";
            string         encrpt_password   = "";

            dtMemberDetails = objmasters.LoginCheck(loginData.userName);
            try
            {
                ServerLog.Log((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + loginData.dives + " " + loginData.password + " " + loginData.userName + "status" + "pass");
                if (dtMemberDetails == null || dtMemberDetails.Rows.Count == 0)
                {
                    ServerLog.Log((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + loginData.ToString() + "status" + "NotExists");
                    return("NotExists");
                }
                if (dtMemberDetails.Rows[0]["university"].ToString() != loginData.university_id)
                {
                    ServerLog.Log((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + loginData.ToString() + "status" + "Wronguniversity");
                    return("Wronguniversity");
                }
                else
                {
                    if (loginData.pass_encrpted_flag != "true")
                    {
                        loginData.password = loginData.password.Trim();
                        EncryptPassword encrpt = new EncryptPassword();

                        encrpt_password = encrpt.Encrypt(loginData.password.ToString().Trim());
                    }
                    else
                    {
                        encrpt_password = loginData.password;
                    }

                    if (dtMemberDetails.Rows[0]["password"].ToString() != encrpt_password)
                    {
                        ServerLog.Log((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + loginData.ToString() + "status" + "WrongPass");
                        return("WrongPass");
                    }
                    if (dtMemberDetails.Rows[0]["default_role"].ToString() == "TT")
                    {
                        DataTable dtrole = objmasters.checkmemberrole(loginData.userName);
                        for (int i = 0; i < dtrole.Rows.Count; i++)
                        {
                            if (dtrole.Rows[i]["role_id"].ToString() == "ST")
                            {
                                break;
                            }
                            else if (dtrole.Rows[i]["role_id"].ToString() == "TT")
                            {
                                if (dtrole.Rows[i]["is_approved"].ToString() == "Y" && dtrole.Rows[i]["approved_by_whome"].ToString() != "" && dtrole.Rows[i]["approved_by_whome"].ToString() != null)
                                {
                                    break;
                                }
                                else
                                {
                                    flg++;
                                }
                            }
                        }

                        if (dtrole.Rows.Count == flg)
                        {
                            ServerLog.Log((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + loginData.ToString() + "status" + "notApproved");
                            return("notApproved");
                        }
                    }

                    //Random rand = new Random();
                    //int tokenId = rand.Next(1, 100000);
                    Guid tokenId = Guid.NewGuid();

                    DataRow dr = dtMemberDetails.Rows[0];
                    //dr["token_id"] = tokenId.ToString();

                    objDS_MemberTables.member_master.ImportRow(dr);
                    DS_MemberTables.login_tokenRow rowtoken = objDS_MemberTables.login_token.Newlogin_tokenRow();
                    rowtoken.member_id = loginData.userName;
                    rowtoken.device_id = loginData.dives;
                    rowtoken.token_id  = tokenId.ToString();

                    if (rowtoken.device_id.Trim().Length == 0)
                    {
                        ServerLog.Log((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + loginData.ToString() + "status" + "Device not null");
                        return("Device not null");
                    }
                    else
                    {
                        objDS_MemberTables.login_token.Addlogin_tokenRow(rowtoken);


                        objBLReturnObject = objmasters.saveLinkData_login(objDS_MemberTables, true);
                        if (objBLReturnObject.ExecutionStatus == 1)
                        {
                            dtMemberDetails.Columns.Add("token_id");
                            dtMemberDetails.Rows[0]["token_id"] = tokenId.ToString();;
                            result = GetJson1(dtMemberDetails);
                        }
                        else
                        {
                            ServerLog.Log((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + loginData.ToString() + "status" + "TokenIssue");
                            return("TokenIssue");
                        }
                    }
                }
            }
            catch (Exception e)
            {
                ServerLog.Log((System.Web.HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath).ToString() + " " + loginData.ToString() + "status" + e.StackTrace);
                return(result);
            }
            return(result);
        }