Exemple #1
0
        public ActionResult AddToFavorite(int Id, int CustomerId)
        {
            PDBC db = new PDBC("PandaMarketCMS", true);

            db.Connect();
            Encryption           ENC   = new Encryption();
            List <ExcParameters> parss = new List <ExcParameters>();
            ExcParameters        par   = new ExcParameters()
            {
                _KEY   = "@UId",
                _VALUE = CustomerId
            };

            parss.Add(par);
            par = new ExcParameters()
            {
                _KEY   = "@ProId",
                _VALUE = Id
            };
            parss.Add(par);
            if (db.Select("SELECT [CustomerId],[ProductId] FROM [tbl_Customer_Favorites] where [CustomerId]=@UId AND ProductId=@ProId", parss).Rows.Count == 0)
            {
                db.Script("INSERT INTO [tbl_Customer_Favorites]([CustomerId],[ProductId])VALUES(@UId,@ProId)", parss);
                db.DC();
                return(Content("1"));
            }
            else
            {
                db.Script("DELETE FROM [tbl_Customer_Favorites]WHERE CustomerId=@UId AND ProductId=@ProId", parss);
                db.DC();
                return(Content("0"));
            }
        }
        public string Add_Update_ProType(string Action, string Name, int id = 0)
        {
            PDBC db = new PDBC("PandaMarketCMS", true);

            List <ExcParameters> paramss = new List <ExcParameters>();
            ExcParameters        parameters;

            parameters = new ExcParameters()
            {
                _KEY   = "@PTname",
                _VALUE = Name
            };
            paramss.Add(parameters);

            parameters = new ExcParameters()
            {
                _KEY   = "@id_P",
                _VALUE = id
            };
            paramss.Add(parameters);

            db.Connect();
            if (Action == "insert")
            {
                db.Script("INSERT INTO [tbl_Product_Type]([PTname],[ISDESABLED],[ISDelete])VALUES(@PTname,0,0)", paramss);
            }
            else if (Action == "Update")
            {
                db.Script("UPDATE [tbl_Product_Type] SET [PTname] = @PTname WHERE id_PT =@id_P", paramss);
            }
            db.DC();
            return("Success");
        }
Exemple #3
0
        public string Add_Update_AdType_(string ActToDo, string Ad_Name, string Routes, int id = 0)
        {
            PDBC db = new PDBC("PandaMarketCMS", true);

            db.Connect();

            if (ActToDo == "insert")
            {
                string Ad_id_ = db.Script("INSERT INTO [tbl_ADMIN_types] output inserted.ad_typeID VALUES(N'" + Ad_Name + "')");
                var    ids    = Routes.Split(',');
                for (int i = 0; i < ids.Length; i++)
                {
                    db.Script("INSERT INTO [tbl_ADMIN_types_ruleRoute_Connection] VALUES(" + Ad_id_ + "," + ids[i] + ",1)");
                }
            }
            else if (ActToDo == "update")
            {
                db.Script("UPDATE[tbl_ADMIN_types] SET [ad_type_name] =N'" + Ad_Name + "' WHERE ad_typeID=" + id);
                db.Script("DELETE FROM [tbl_ADMIN_types_ruleRoute_Connection] WHERE ad_typeID=" + id);
                var ids = Routes.Split(',');
                for (int i = 0; i < ids.Length; i++)
                {
                    db.Script("INSERT INTO [tbl_ADMIN_types_ruleRoute_Connection] VALUES(" + id + "," + ids[i] + ",1)");
                }
            }
            return("success");
        }
Exemple #4
0
        public ActionResult MainTag_Add_Update(string ActTodo, string Name, string Description, int id = 0)
        {
            string SSSession = "";   CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                PDBC db = new PDBC("PandaMarketCMS", true);
                db.Connect();

                if (ActTodo == "insert")
                {
                    db.Script("INSERT INTO [tbl_Product_MainStarTags]VALUES(N'" + Description + "',N'" + Name + "')");
                }
                else if (ActTodo == "update")
                {
                    db.Script("UPDATE [tbl_Product_MainStarTags] SET [MST_Description] =N'" + Description + "' ,[MST_Name] =N'" + Name + "' WHERE id_MainStarTag=" + id);
                }
                else if (ActTodo == "delete")
                {
                    db.Script("DELETE FROM [tbl_Product_MainStarTags]WHERE id_MainStarTag=" + id);
                }

                return(Content("Success"));
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
Exemple #5
0
        public ActionResult Tag_Add_Update(string ActTodo, int SubId, string Name, int id = 0)
        {
            string SSSession = "";   CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                PDBC db = new PDBC("PandaMarketCMS", true);
                db.Connect();

                if (ActTodo == "insert")
                {
                    db.Script("INSERT INTO [tbl_Product_TagEnums]VALUES (N'" + Name + "'," + SubId + ")");
                }
                else if (ActTodo == "update")
                {
                    db.Script("UPDATE [tbl_Product_TagEnums] SET [TE_name] = N'' WHERE id_TE=" + id);
                }
                else if (ActTodo == "delete")
                {
                    db.Script("DELETE FROM [tbl_Product_tagConnector] WHERE id_TE=" + id);
                    db.Script("DELETE FROM [tbl_Product_TagEnums] WHERE id_TE=" + id);
                }

                return(Content("Success"));
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
Exemple #6
0
        public ActionResult Op_delete_edit(string action, int id, string Key = "", string value = "")
        {
            string SSSession = "";   CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                PDBC db = new PDBC("PandaMarketCMS", true);
                db.Connect();
                if (action == "edit")
                {
                    if (Key != "" && value != "")
                    {
                        db.Script("UPDATE[tbl_Product_tblOptions] SET [KeyName] = N'" + Key + "',[Value] = N'" + value + "' WHERE id_Op=" + id);
                    }
                }
                else if (action == "delete")
                {
                    db.Script("DELETE FROM[tbl_Product_tblOptions] WHERE id_Op=" + id);
                }
                else if (action == "new")
                {
                    if (Key != "" && value != "")
                    {
                        db.Script("INSERT INTO[tbl_Product_tblOptions]VALUES(" + id + ",N'" + Key + "',N'" + value + "')");
                    }
                }


                return(Content("done"));
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
Exemple #7
0
        public ActionResult Save_Step5(string ActTodo, int id)
        {
            string SSSession = "";   CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                PDBC db = new PDBC("PandaMarketCMS", true);
                db.Connect();

                if (ActTodo == "delete")
                {
                    db.Script("UPDATE [tlb_Product_MainProductConnector] SET [ISDELETE] = 1 WHERE id_MPC=" + id);
                }
                else if (ActTodo == "restore")
                {
                    db.Script("UPDATE [tlb_Product_MainProductConnector] SET [ISDELETE] = 0 WHERE id_MPC=" + id);
                }


                return(Content("success"));
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
Exemple #8
0
        public ActionResult Product_Actions(string ActToDo, int id)
        {
            string SSSession = ""; CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                PDBC db = new PDBC("PandaMarketCMS", true);
                db.Connect();
                if (ActToDo == "Delete")
                {
                    db.Script("UPDATE [tbl_Product] SET [ISDELETE] = 1 WHERE id_MProduct=" + id);
                }
                else if (ActToDo == "Active")
                {
                    db.Script("UPDATE [tbl_Product] SET [IS_AVAILABEL] = 1 WHERE id_MProduct=" + id);
                }
                else if (ActToDo == "DeActive")
                {
                    db.Script("UPDATE [tbl_Product] SET [IS_AVAILABEL] = 0 WHERE id_MProduct=" + id);
                }
                return(Content("Success"));
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
Exemple #9
0
        public ActionResult SCKPage(string action, string value, string id, string data_SCK)
        {
            string query_new, query_edit;
            string res = " ";


            PDBC db = new PDBC("PandaMarketCMS", true);

            db.Connect();

            List <ExcParameters> paramss    = new List <ExcParameters>();
            ExcParameters        parameters = new ExcParameters();

            if (action == "new")
            {
                query_new = "INSERT INTO [tbl_Product_SubCategoryOptionKey]([id_SC],[SCOKName],[ISDESABLED],[ISDelete])VALUES(@data_SCK,@value,0,0)";

                parameters = new ExcParameters()
                {
                    _KEY   = "@value",
                    _VALUE = value
                };
                paramss.Add(parameters);

                parameters = new ExcParameters()
                {
                    _KEY   = "@data_SCK",
                    _VALUE = data_SCK
                };
                paramss.Add(parameters);

                res = db.Script(query_new, paramss);
            }

            else if (action == "edit")
            {
                query_edit = "UPDATE [tbl_Product_SubCategoryOptionKey] SET [SCOKName] = @value WHERE id_SCOK =@id";

                parameters = new ExcParameters()
                {
                    _KEY   = "@id",
                    _VALUE = id
                };

                paramss.Add(parameters);

                parameters = new ExcParameters()
                {
                    _KEY   = "@value",
                    _VALUE = value
                };

                paramss.Add(parameters);


                res = db.Script(query_edit, paramss);
            }

            return(Content(res));
        }
Exemple #10
0
        public ActionResult SmsRegister(string MobileNum, string Pass)
        {
            PDBC db = new PDBC("PandaMarketCMS", true);

            db.Connect();
            if (Convert.ToInt32(db.Select("SELECT COUNT(*) FROM [tbl_Customer_Main] WHERE C_Mobile LIKE N'" + MobileNum + "'").Rows[0][0]) == 0)
            {
                Encryption           ENC   = new Encryption();
                List <ExcParameters> parss = new List <ExcParameters>();
                ExcParameters        par   = new ExcParameters()
                {
                    _KEY   = "@Mobile",
                    _VALUE = MobileNum
                };
                parss.Add(par);
                par = new ExcParameters()
                {
                    _KEY   = "@PassWord",
                    _VALUE = ENC.MD5Hash(Pass)
                };
                parss.Add(par);
                int    UserId        = Convert.ToInt32(db.Script("INSERT INTO [tbl_Customer_Main] OUTPUT inserted.id_Customer VALUES(GETDATE(),@Mobile,N'',N'',N'',0,0,NULL,@PassWord)", parss));
                Random generator     = new Random();
                string GeneratedCode = generator.Next(100000, 999999).ToString("D6");
                parss = new List <ExcParameters>();
                par   = new ExcParameters()
                {
                    _KEY   = "@id_Customer",
                    _VALUE = UserId
                };
                parss.Add(par);
                par = new ExcParameters()
                {
                    _KEY   = "@sms_irKeyType",
                    _VALUE = 2
                };
                parss.Add(par);
                par = new ExcParameters()
                {
                    _KEY   = "@sms_irSentKey",
                    _VALUE = GeneratedCode
                };
                parss.Add(par);
                par = new ExcParameters()
                {
                    _KEY   = "@sms_irIsKeyAlive",
                    _VALUE = 1
                };
                parss.Add(par);
                string result = db.Script("INSERT INTO [dbo].[tbl_sms_ir_CustomerKeys]([id_Customer],[sms_irKeyType],[sms_irSentKey],[sms_irKeyGeneratedDate],[sms_irIsKeyAlive]) VALUES(@id_Customer ,@sms_irKeyType ,@sms_irSentKey ,GETDATE(),@sms_irIsKeyAlive)", parss);
                SMS_ir sms    = new SMS_ir();
                db.DC();
                return(Json(sms.SendVerificationCodeWithTemplate(UserId, "VelvetRegister", 2)));
            }
            else
            {
                db.DC();
                return(Content("Reapited Num"));
            }
        }
Exemple #11
0
        public ActionResult TypePage(string action, string value, string id)
        {
            string query_new, query_edit;
            string res = " ";


            PDBC db = new PDBC("PandaMarketCMS", true);

            db.Connect();

            List <ExcParameters> paramss    = new List <ExcParameters>();
            ExcParameters        parameters = new ExcParameters();

            if (action == "new")
            {
                query_new = "INSERT INTO [dbo].[tbl_Product_Type]([PTname],[ISDESABLED],[ISDelete])VALUES(@PTname,0,0)";

                parameters = new ExcParameters()
                {
                    _KEY   = "@PTname",
                    _VALUE = value
                };
                paramss.Add(parameters);

                res = db.Script(query_new, paramss);
            }

            else if (action == "edit")
            {
                query_edit = "UPDATE [dbo].[tbl_Product_Type] SET [PTname] = @PTname WHERE id_PT =@id_PT";

                parameters = new ExcParameters()
                {
                    _KEY   = "@id_PT",
                    _VALUE = id
                };

                paramss.Add(parameters);

                parameters = new ExcParameters()
                {
                    _KEY   = "@PTname",
                    _VALUE = value
                };

                paramss.Add(parameters);

                res = db.Script(query_edit, paramss);
            }

            return(Content(res));
        }
Exemple #12
0
        public ActionResult get_Opinion(string id, string value)
        {
            string res = " ", query_edit;


            PDBC db = new PDBC("PandaMarketCMS", true);

            db.Connect();

            List <ExcParameters> paramss    = new List <ExcParameters>();
            ExcParameters        parameters = new ExcParameters();

            parameters = new ExcParameters()
            {
                _KEY   = "@id",
                _VALUE = id
            };

            paramss.Add(parameters);

            if (value == "delete")
            {
                query_edit = "UPDATE [dbo].[tbl_Product_Opinion] SET [ISDELETE] = @value WHERE [id_Opinion] = @id";

                parameters = new ExcParameters()
                {
                    _KEY   = "@value",
                    _VALUE = "1"
                };

                paramss.Add(parameters);


                res = db.Script(query_edit, paramss);
            }
            else if (value == "on")
            {
                query_edit = "UPDATE [dbo].[tbl_Product_Opinion] SET [Is_Accepted] = @value ,[DateAccepted] = GETDATE() WHERE  [id_Opinion] = @id";

                parameters = new ExcParameters()
                {
                    _KEY   = "@value",
                    _VALUE = "1"
                };

                paramss.Add(parameters);


                res = db.Script(query_edit, paramss);
            }
            return(RedirectToAction("Opinion"));
        }
        public ActionResult UpdateCustomerPass(string CurrentPass, string Pass)
        {
            if (HttpContext.Request.Cookies[StaticLicense.LicName + "Active"] != null)
            {
                string     SSSession = "";
                HttpCookie cookie    = HttpContext.Request.Cookies.Get(StaticLicense.LicName + "Active");
                if (cookie != null)
                {
                    Encryption ENC = new Encryption();
                    SSSession = ENC.DecryptText(cookie.Value, "OMD_Token");
                    ActivationModel act = JsonConvert.DeserializeObject <ActivationModel>(SSSession);

                    PDBC db = new PDBC("PandaMarketCMS", true);

                    List <ExcParameters> parss = new List <ExcParameters>();
                    ExcParameters        par   = new ExcParameters()
                    {
                        _KEY   = "@CurrentPass",
                        _VALUE = ENC.MD5Hash(CurrentPass)
                    };
                    parss.Add(par);

                    par = new ExcParameters()
                    {
                        _KEY   = "@Pass",
                        _VALUE = ENC.MD5Hash(Pass)
                    };
                    parss.Add(par);

                    par = new ExcParameters()
                    {
                        _KEY   = "@CustomerId",
                        _VALUE = act.CustomerId
                    };
                    parss.Add(par);

                    db.Connect();

                    if (Convert.ToInt32(db.Select("SELECT COUNT(*) FROM [tbl_Customer_Main] WHERE id_Customer= @CustomerId AND C_Password = @CurrentPass", parss).Rows[0][0]) != 0)
                    {
                        db.Script("UPDATE [tbl_Customer_Main] SET[C_Password] =@Pass  WHERE id_Customer= @CustomerId", parss);
                        db.DC();
                        return(Content("Success"));
                    }
                    else
                    {
                        db.DC();
                        return(Content("WrongPass"));
                    }
                }
                else
                {
                    return(Content("Error"));
                }
            }
            else
            {
                return(Content("Login"));
            }
        }
        public ActionResult GetUser(CustomerStruct viewModel)
        {
            //INSERT INTO [tblUsers]([id],[un],[password]) VALUES (1111,@un,@password)
            if (ModelState.IsValid)
            {
                PDBC db = new PDBC("MVCCNS", true);
                List <ExcParameters> paramss    = new List <ExcParameters>();
                ExcParameters        parameters = new ExcParameters()
                {
                    _KEY   = "@password",
                    _VALUE = viewModel.password
                };
                paramss.Add(parameters);
                parameters = new ExcParameters()
                {
                    _KEY   = "@un",
                    _VALUE = viewModel.name
                };

                paramss.Add(parameters);
                db.Connect();
                string res = db.Script("INSERT INTO [tblUsers]([id],[un],[password]) VALUES (1111,@un,@password)", paramss);
                return(Content(res));
            }
            else
            {
                ModelState.Values.ToString();
                return(Content("0"));
            }
        }
        public ActionResult AddCustomerAddress(string CityId, string FullAddress, string CodePosti)
        {
            tbl_Customer_Main tcm = new tbl_Customer_Main();
            var coockie           = HttpContext.Request.Cookies.Get(ProjectProperies.AuthCustomerCode());

            if (coockie != null)
            {
                tcm = CoockieController.SayWhoIsHE(coockie.Value);
                var Id = tcm.id_Customer;

                PDBC db = new PDBC();
                List <ExcParameters> parss = new List <ExcParameters>();
                ExcParameters        par   = new ExcParameters()
                {
                    _KEY   = "@Id",
                    _VALUE = Id
                };
                parss.Add(par);

                par = new ExcParameters()
                {
                    _KEY   = "@CityId",
                    _VALUE = CityId
                };
                parss.Add(par);

                par = new ExcParameters()
                {
                    _KEY   = "@FullAddress",
                    _VALUE = FullAddress
                };
                parss.Add(par);

                par = new ExcParameters()
                {
                    _KEY   = "@CodePosti",
                    _VALUE = CodePosti
                };
                parss.Add(par);

                db.Connect();
                string result = db.Script("INSERT INTO [tbl_Customer_Address]([id_Customer],[ID_Shahr],[C_AddressHint],[C_FullAddress])VALUES(@Id,@CityId,@CodePosti,@FullAddress)", parss);


                db.DC();

                if (result == "1")
                {
                    return(Content("Success"));
                }
                else
                {
                    return(Content("Error"));
                }
            }
            else
            {
                return(Content("Error"));
            }
        }
        public void AddNewTemplate(string TempName, string Html)
        {
            PDBC db = new PDBC("DBConnectionString", true);

            db.Connect();
            db.Script("INSERT INTO [dbo].[EmailTemplate_tbl]VALUES('" + TempName + "','" + Html + "')");
        }
Exemple #17
0
        public string Add_Update_Tag(string Action, string Name, int CatId, int id = 0)
        {
            PDBC db = new PDBC("PandaMarketCMS", true);

            db.Connect();
            if (Action == "insert")
            {
                db.Script("INSERT INTO [tbl_BLOG_Tags] VALUES (N'" + Name + "'," + CatId + ",0,0)");
            }
            else if (Action == "Update")
            {
                db.Script("UPDATE [tbl_BLOG_Tags] SET [Name] = N'" + Name + "',[CtegoryId] = " + CatId + " WHERE Id=" + id);
            }
            db.DC();
            return("Success");
        }
        public ActionResult AddCustomerAddress(int cityId, string Address, string CodePosti)
        {
            if (HttpContext.Request.Cookies[StaticLicense.LicName + "Active"] != null)
            {
                string     SSSession = "";
                HttpCookie cookie    = HttpContext.Request.Cookies.Get(StaticLicense.LicName + "Active");
                if (cookie != null)
                {
                    Encryption ENC = new Encryption();
                    SSSession = ENC.DecryptText(cookie.Value, "OMD_Token");
                    ActivationModel act = JsonConvert.DeserializeObject <ActivationModel>(SSSession);

                    PDBC db = new PDBC("PandaMarketCMS", true);
                    db.Connect();
                    List <ExcParameters> parss = new List <ExcParameters>();

                    ExcParameters par = new ExcParameters()
                    {
                        _KEY   = "@cityId",
                        _VALUE = cityId
                    };
                    parss.Add(par);

                    par = new ExcParameters()
                    {
                        _KEY   = "@Address",
                        _VALUE = Address
                    };
                    parss.Add(par);

                    par = new ExcParameters()
                    {
                        _KEY   = "@CodePosti",
                        _VALUE = CodePosti
                    };
                    parss.Add(par);

                    par = new ExcParameters()
                    {
                        _KEY   = "@CustomerId",
                        _VALUE = act.CustomerId
                    };
                    parss.Add(par);
                    string AddresId = db.Script("INSERT INTO [tbl_Customer_Address] output inserted.id_CAddress VALUES( @CustomerId ,@cityId ,@CodePosti,@Address)", parss);
                    db.DC();

                    return(Content("Success"));
                }
                else
                {
                    return(Content("Error"));
                }
            }
            else
            {
                return(Content("Login"));
            }
        }
Exemple #19
0
        public ActionResult SubKey_Actions(string ActToDo, int id)
        {
            string SSSession = ""; if (HttpContext.Request.Cookies["TSHPANDAControll" + StaticLicense.LicName] != null)

            {
                HttpCookie cookie = HttpContext.Request.Cookies.Get("TSHPANDAControll" + StaticLicense.LicName); if (cookie != null)
                {
                    SSSession = cookie.Value;
                }
                else
                {
                    SSSession = "N.A";
                }
            }
            else
            {
                SSSession = "N.A";
            }
            CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                PDBC db = new PDBC("PandaMarketCMS", true);
                db.Connect();
                if (ActToDo == "Delete")
                {
                    db.Script("UPDATE[tbl_Product_SubCategoryOptionKey] SET [ISDelete] = 1, [DateDeleted] = GETDATE()  WHERE id_SCOK =" + id);
                    db.Script("DELETE FROM [tbl_Product_SubCategoryOptionValue] WHERE id_SCOK=" + id);
                }
                else if (ActToDo == "Active")
                {
                    db.Script("UPDATE [tbl_Product_SubCategoryOptionKey] SET [ISDESABLED] = 0, [DateDesabled] = GETDATE() WHERE id_SCOK=" + id);
                }
                else if (ActToDo == "DeActive")
                {
                    db.Script("UPDATE [tbl_Product_SubCategoryOptionKey] SET [ISDESABLED] = 1 , [DateDesabled] = GETDATE() WHERE id_SCOK=" + id);
                }
                db.DC();
                return(Content("Success"));
            }
            else
            {
                return(Content("NotAccess"));
            }
        }
        public ActionResult Admin_Actions(string ActToDo, int id)
        {
            string SSSession = ""; if (HttpContext.Request.Cookies["TSHPANDAControll" + StaticLicense.LicName] != null)

            {
                HttpCookie cookie = HttpContext.Request.Cookies.Get("TSHPANDAControll" + StaticLicense.LicName); if (cookie != null)
                {
                    SSSession = cookie.Value;
                }
                else
                {
                    SSSession = "N.A";
                }
            }
            else
            {
                SSSession = "N.A";
            }
            CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                PDBC db = new PDBC("PandaMarketCMS", true);
                db.Connect();
                if (ActToDo == "Delete")
                {
                    db.Script("UPDATE [tbl_ADMIN_main] SET [ad_isDelete] = 1 WHERE id_Admin=" + id);
                }
                else if (ActToDo == "Active")
                {
                    db.Script("UPDATE [tbl_ADMIN_main] SET [ad_isActive] = 1 WHERE id_Admin=" + id);
                }
                else if (ActToDo == "DeActive")
                {
                    db.Script("UPDATE [tbl_ADMIN_main] SET [ad_isActive] = 0 WHERE id_Admin=" + id);
                }
                db.DC();
                return(Content("Success"));
            }
            else
            {
                return(RedirectToAction("NotAccess", "MS"));
            }
        }
        public string insertsToTUBUSER(string posted)
        {
            tblUserStruct obj = JsonConvert.DeserializeObject <tblUserStruct>(posted);

            sessionCaptcha = obj.captcha;
            PDBC db = new PDBC("honarjoo");

            db.Connect();
            return(db.Script($"INSERT INTO tblUsers (id ,un ,email ,password ,destxt ) VALUES ({new Random().Next()},N'{obj.un}',N'{obj.email}',N'{obj.password}',N'{obj.destxt}' )"));
        }
        public string InsertsToTUBUSER(string posted)
        {
            tblusers obj = JsonConvert.DeserializeObject <tblusers>(posted);

            sessionCaptcha = obj.Captcha;
            PDBC db = new PDBC("WebForm1");

            db.Connect();
            return(db.Script($"INSERT INTO [tblusers] ([FirstName] ,[LastName],[UserName],[Email],[Password]) VALUES (N'{obj.FirstName}', N'{obj.LastName}', N'{obj.UserName}', N'{obj.Email}',N'{obj.Password}')"));
        }
        public ActionResult SubmitComment(Comment viewModel)
        {
            PDBC db = new PDBC("DBConnectionString", true);

            db.Connect();
            var dateTimeStamp = new Date_TimeStamp();

            db.Script(
                "INSERT INTO [Comment_tbl]VALUES(N'" + viewModel.Email + "',N'" + viewModel.message + "',N'" + viewModel.Name + "'," + viewModel.PostId + ",N'https://localhost:44331//Resources/Images/photo_2019-10-25_15-12-57.jpg',N''," + dateTimeStamp.GetTime_Soconds(DateTime.Now) + ")");
            return(Content("1"));
        }
        public void AddToEmailList(DataTable dt)
        {
            PDBC db = new PDBC("DBConnectionString", true);

            db.Connect();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                db.Script("INSERT INTO [dbo].[EmailModule_tbl]VALUES('" + dt.Rows[i]["Email"] + "')");
            }
            db.DC();
        }
        public ActionResult submitContact(Customer viewModel)
        {
            PDBC db = new PDBC("DBConnectionString", true);

            db.Connect();
            db.Script("INSERT INTO [dbo].[REQForm_SocialNormalForms]VALUES(N'" + viewModel.name + "',N'" + viewModel.email + "',N'" + viewModel.phone + "',N'" + viewModel.subject + "',N'" + viewModel.message + "')");

            db.DC();


            return(Content("1"));
        }
Exemple #26
0
        public ActionResult User_Actions(string ActToDo, int id)
        {
            string SSSession = ""; if (HttpContext.Request.Cookies["TSHPANDAControll"] != null)

            {
                HttpCookie cookie = HttpContext.Request.Cookies.Get("TSHPANDAControll"); if (cookie != null)
                {
                    SSSession = cookie.Value;
                }
                else
                {
                    SSSession = "N.A";
                }
            }
            else
            {
                SSSession = "N.A";
            }
            CheckAccess check = new CheckAccess(SSSession);

            if (check.HasAccess)
            {
                PDBC db = new PDBC("PandaMarketCMS", true);
                db.Connect();
                if (ActToDo == "Active")
                {
                    db.Script("UPDATE [tbl_Customer_Main] SET [C_ISActivate] = 1 WHERE id_Customer=" + id);
                }
                else if (ActToDo == "DeActive")
                {
                    db.Script("UPDATE [tbl_Customer_Main] SET [C_ISActivate] = 0 WHERE id_Customer=" + id);
                }
                db.DC();
                return(Content("Success"));
            }
            else
            {
                return(Content("NotAccess"));
            }
        }
        public string Add_Update_ProSubCat(string Action, string Name, int MainId, int id = 0)
        {
            PDBC db = new PDBC("PandaMarketCMS", true);

            List <ExcParameters> paramss    = new List <ExcParameters>();
            ExcParameters        parameters = new ExcParameters();

            parameters = new ExcParameters()
            {
                _KEY   = "@value",
                _VALUE = Name
            };
            paramss.Add(parameters);

            parameters = new ExcParameters()
            {
                _KEY   = "@id",
                _VALUE = id
            };
            paramss.Add(parameters);

            parameters = new ExcParameters()
            {
                _KEY   = "@data_Sub",
                _VALUE = MainId
            };
            paramss.Add(parameters);

            db.Connect();
            if (Action == "insert")
            {
                db.Script("INSERT INTO [tbl_Product_SubCategory]([id_MC],[SCName],[ISDESABLED],[ISDelete])VALUES (@data_Sub,@value,0,0)", paramss);
            }
            else if (Action == "Update")
            {
                db.Script("UPDATE [tbl_Product_SubCategory]SET [SCName] = @value WHERE id_SC = @id ", paramss);
            }
            db.DC();
            return("Success");
        }
        public string Add_Update_MainTags(string Action, string Name, string discription, int id = 0)
        {
            PDBC db = new PDBC("PandaMarketCMS", true);

            List <ExcParameters> paramss    = new List <ExcParameters>();
            ExcParameters        parameters = new ExcParameters();

            parameters = new ExcParameters()
            {
                _KEY   = "@value",
                _VALUE = Name
            };
            paramss.Add(parameters);

            parameters = new ExcParameters()
            {
                _KEY   = "@id",
                _VALUE = id
            };
            paramss.Add(parameters);

            parameters = new ExcParameters()
            {
                _KEY   = "@discription",
                _VALUE = discription
            };
            paramss.Add(parameters);
            db.Connect();

            if (Action == "insert")
            {
                db.Script("INSERT INTO [tbl_Product_MainStarTags]VALUES( @discription , @value )", paramss);
            }
            else if (Action == "Update")
            {
                db.Script("UPDATE [tbl_Product_MainStarTags] SET [MST_Description] = @discription ,[MST_Name] =@value WHERE id_MainStarTag= @id", paramss);
            }
            db.DC();
            return("Success");
        }
        public string Add_Update_ProTags(string Action, string Name, int SCKId, int id = 0)
        {
            PDBC db = new PDBC("PandaMarketCMS", true);

            List <ExcParameters> paramss    = new List <ExcParameters>();
            ExcParameters        parameters = new ExcParameters();

            parameters = new ExcParameters()
            {
                _KEY   = "@value",
                _VALUE = Name
            };
            paramss.Add(parameters);

            parameters = new ExcParameters()
            {
                _KEY   = "@id",
                _VALUE = id
            };
            paramss.Add(parameters);

            parameters = new ExcParameters()
            {
                _KEY   = "@data_SCK",
                _VALUE = SCKId
            };
            paramss.Add(parameters);

            db.Connect();
            if (Action == "insert")
            {
                db.Script("INSERT INTO [tbl_Product_TagEnums]VALUES (@Value , @data_SCK)", paramss);
            }
            else if (Action == "Update")
            {
                db.Script("UPDATE [tbl_Product_TagEnums] SET [TE_name] = @value  WHERE id_TE=@id", paramss);
            }
            db.DC();
            return("Success");
        }
        public JsonResult User_deActivate(string idTodeActive)
        {
            PDBC db = new PDBC();
            uint id = 0;

            if (UInt32.TryParse(idTodeActive, out id))
            {
                List <ExcParameters> parss = new List <ExcParameters>();
                ExcParameters        par   = new ExcParameters()
                {
                    _KEY   = "@id_PT",
                    _VALUE = idTodeActive
                };
                parss.Add(par);
                db.Connect();
                string result = db.Script("UPDATE [tbl_Customer_Main] SET [C_ISActivate] = 0 WHERE id_Customer= @id_PT", parss);

                db.DC();
                if (result == "1")
                {
                    var ModelSender = new ErrorReporterModel
                    {
                        ErrorID      = "SX106",
                        Errormessage = $"این مشتری با موفقیت غیر فعال شد!",
                        Errortype    = "Success"
                    };
                    return(Json(ModelSender));
                }
                else
                {
                    PPBugReporter rep         = new PPBugReporter(BugTypeFrom.SQL, result);
                    var           ModelSender = new ErrorReporterModel
                    {
                        ErrorID      = "EX115",
                        Errormessage = $"عدم توانایی در ثبت اطلاعات!",
                        Errortype    = "Error"
                    };
                    return(Json(ModelSender));
                }
            }
            else
            {
                PPBugReporter rep         = new PPBugReporter(BugTypeFrom.SQL, "sher o ver e L326");
                var           ModelSender = new ErrorReporterModel
                {
                    ErrorID      = "EX115",
                    Errormessage = $"عدم توانایی در ثبت اطلاعات!",
                    Errortype    = "Error"
                };
                return(Json(ModelSender));
            }
        }