protected void btnAgree_Click(object sender, EventArgs e)
        {
            Guid BlogGroupID = new Guid(ViewState["BlogGroupID"].ToString());

            using (VaranegarEntities db = new VaranegarEntities())
            {
                var n = (from u in db.BlogGroups where u.BlogGroupID == BlogGroupID select u).FirstOrDefault();

                n.IsDelete   = true;
                n.DeleteDate = DateTime.Now;

                var m = (from a in db.Blogs
                         where a.fk_BlogGroupID == BlogGroupID && a.IsDelete == false
                         select a).ToList();

                foreach (var item in m)
                {
                    item.IsDelete   = true;
                    item.DeleteDate = DateTime.Now;
                    db.SaveChanges();
                }

                db.SaveChanges();
                mvSetting.SetActiveView(vwList);

                LoadForm();
                pnlSuccess.Visible = true;
            }
        }
        public void InsertForm()
        {
            string new_filename = string.Empty;

            if (fuImage.PostedFile.ContentLength != 0)
            {
                string original_filename = Path.GetFileName(fuImage.PostedFile.FileName);

                new_filename =
                    Guid.NewGuid().ToString() +
                    Path.GetExtension(original_filename);

                string new_filepath = Server.MapPath("~/Uploads/Slider/" + new_filename);
                fuImage.PostedFile.SaveAs(new_filepath);


                ViewState["GImage"] = new_filename;
            }
            using (VaranegarEntities db = new VaranegarEntities())
            {
                Sliders p = new Sliders();

                p.SliderTitle    = txtTitle.Text;
                p.Priority       = Convert.ToInt32(txtPrio.Text);
                p.BigText        = txtBigText.Text;
                p.IsActive       = chbActiveSlider.Checked;
                p.LinkAddress    = txtLinkAddress.Text;
                p.LinkText       = txtLinkTitle.Text;
                p.SliderImageUrl = new_filename;
                p.SmallText      = txtSmallText.Text;
                p.IsDelete       = false;
                db.Sliders.Add(p);
                db.SaveChanges();
            }
        }
        public void UpdateForm()
        {
            Guid   ServiceID    = new Guid(ViewState["ServiceID"].ToString());
            string new_filename = string.Empty;

            if (fuImage.PostedFile.ContentLength != 0)
            {
                string original_filename = Path.GetFileName(fuImage.PostedFile.FileName);

                new_filename =
                    Guid.NewGuid().ToString() +
                    Path.GetExtension(original_filename);

                string new_filepath = Server.MapPath("~/Uploads/Service/" + new_filename);
                fuImage.PostedFile.SaveAs(new_filepath);
                ViewState["GImage"] = new_filename;
            }
            using (VaranegarEntities db = new VaranegarEntities())
            {
                var n = (from u in db.Services where u.ServiceID == ServiceID select u).FirstOrDefault();

                n.ServiceTitle    = txtTitle.Text;
                n.En_ServiceTitle = txtEN_Title.Text;
                n.ServiceName     = txtName.Text;
                n.SmallDesc       = txtHeader.Text;
                n.En_SmallDesc    = txtHeaderEn.Text;
                n.ServiceDesc     = reDesc.Text;
                n.En_ServiceDesc  = reEN_Desc.Text;
                n.Priority        = Convert.ToInt32(txtPrio.Text);
                n.LastUpdateDate  = DateTime.Now;
                n.HeaderImg       = ViewState["GImage"].ToString();
                db.SaveChanges();
            }
        }
Пример #4
0
        public void Log_ErrorInsert(string searchQuery)
        {
            using (VaranegarEntities db = new VaranegarEntities())
            {
                Log_SearchQueries leIn = new Log_SearchQueries();

                leIn.SearchQuery = searchQuery;
                leIn.SearchDate  = DateTime.Now;
                leIn.SearchIp    = Request.UserHostAddress;
                leIn.OS          = FindUserInfo.UserOS();
                if (Request.UrlReferrer != null)
                {
                    leIn.RefrallPage = Request.UrlReferrer.ToString();
                }
                else
                {
                    leIn.RefrallPage = "ورود مستقیم";
                }
                System.Web.HttpBrowserCapabilities browser = Request.Browser;
                leIn.browser = browser.Type;

                db.Log_SearchQueries.Add(leIn);
                db.SaveChanges();
            }
        }
Пример #5
0
        protected void btnSubmitProvince_OnClick(object sender, EventArgs e)
        {
            Guid cusID = new Guid(ViewState["CustomersID"].ToString());

            using (VaranegarEntities db = new VaranegarEntities())
            {
                var n = (from a in db.Rel_Customer_Province
                         where a.fk_CustomerID == cusID
                         select a).ToList();

                foreach (var item in n)
                {
                    db.Rel_Customer_Province.Remove(item);
                }
                foreach (ListItem chk in cblProvince.Items)
                {
                    if (chk.Selected)
                    {
                        int ProvinceID = Convert.ToInt32(chk.Value);

                        Rel_Customer_Province RelEnter = new Rel_Customer_Province();

                        RelEnter.fk_CustomerID = cusID;

                        RelEnter.fk_ProvinceID = ProvinceID;

                        db.Rel_Customer_Province.Add(RelEnter);
                        db.SaveChanges();
                    }
                }
            }
            mvSetting.SetActiveView(vwList);
        }
Пример #6
0
        protected void lbNewsLetter_Click(object sender, EventArgs e)
        {
            pnlSuccess.Visible = false;
            if (Page.IsValid)
            {
                //if (IsValidUser())
                //{
                if (IsFirstTimeEmail())

                {
                    using (VaranegarEntities db = new VaranegarEntities())
                    {
                        NewsLetters nlEnter = new NewsLetters();
                        nlEnter.email    = txtNewsletter.Text;
                        nlEnter.IsDelete = false;
                        nlEnter.OS       = FindUserInfo.UserOS();
                        nlEnter.SubmitIP = Request.UserHostAddress;
                        System.Web.HttpBrowserCapabilities browser = Request.Browser;
                        nlEnter.Browser    = browser.Type;
                        nlEnter.SubmitDate = DateTime.Now;

                        db.NewsLetters.Add(nlEnter);
                        db.SaveChanges();
                        pnlSuccess.Visible = true;
                    }
                }
                //}
                //else
                //{
                //    pnlCaptcha.Visible = true;
                //    imgCaptcha.ImageUrl = "~/Captcha/CaptchaGeneratorForNewsletter.aspx";
                //    ViewState["cp"] = "1";
                //}
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string new_filename = string.Empty;

            if (fuImage.PostedFile.ContentLength != 0)
            {
                string original_filename = Path.GetFileName(fuImage.PostedFile.FileName);

                new_filename =
                    Guid.NewGuid().ToString() +
                    Path.GetExtension(original_filename);

                string new_filepath = Server.MapPath("~/Uploads/Resume/" + new_filename);
                fuImage.PostedFile.SaveAs(new_filepath);
                ViewState["GImage"] = new_filename;
            }

            using (VaranegarEntities db = new VaranegarEntities())
            {
                Resumes re = new Resumes();
                re.resumeid   = Guid.NewGuid();
                re.IsDelete   = false;
                re.resumeFile = new_filename;
                re.SubmitDate = DateTime.Now;
                re.submitIP   = Request.UserHostAddress;

                db.Resumes.Add(re);
                db.SaveChanges();

                pnlsuccess.Visible = true;
            }
        }
Пример #8
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (Request.QueryString["id"] != null)
            {
                Guid id = new Guid(Request.QueryString["id"]);
                using (VaranegarEntities db = new VaranegarEntities())
                {
                    ServiceStepItems a = new ServiceStepItems();
                    a.En_ServiceStepItemTitle = txtItemEn.Text;
                    a.fk_ServiceStepID        = id;
                    a.IsDelete = false;
                    if (!string.IsNullOrEmpty(txtPrio.Text))
                    {
                        a.Priority = Convert.ToInt32(txtPrio.Text);
                    }

                    a.ServiceStepItemID    = Guid.NewGuid();
                    a.ServiceStepItemTitle = txtItem.Text;
                    a.SubmitDate           = DateTime.Now;

                    db.ServiceStepItems.Add(a);
                    db.SaveChanges();

                    LoadForm();
                    ResetForm();
                    pnlSuccess.Visible = true;
                }
            }
        }
Пример #9
0
        public void UpdateForm()
        {
            Guid Id = new Guid(ViewState["Id"].ToString());

            using (VaranegarEntities db = new VaranegarEntities())
            {
                string new_filename = string.Empty;

                if (fuImage.PostedFile.ContentLength != 0)
                {
                    string original_filename = Path.GetFileName(fuImage.PostedFile.FileName);

                    new_filename =
                        Guid.NewGuid().ToString() +
                        Path.GetExtension(original_filename);

                    string new_filepath = Server.MapPath("~/Uploads/Gallery/" + new_filename);
                    fuImage.PostedFile.SaveAs(new_filepath);
                    ViewState["GImage"] = new_filename;
                }
                var n = (from u in db.GalleryGroups where u.Id == Id select u).FirstOrDefault();

                n.ImageUrl = ViewState["GImage"].ToString();
                n.Title    = txtTitle.Text;
                n.Priority = Convert.ToInt32(txtPri.Text);
                db.SaveChanges();
            }
        }
Пример #10
0
        public void InsertForm()
        {
            using (VaranegarEntities db = new VaranegarEntities())
            {
                string new_filename = string.Empty;

                if (fuImage.PostedFile.ContentLength != 0)
                {
                    string original_filename = Path.GetFileName(fuImage.PostedFile.FileName);

                    new_filename =
                        Guid.NewGuid().ToString() +
                        Path.GetExtension(original_filename);

                    string new_filepath = Server.MapPath("~/Uploads/Gallery/" + new_filename);
                    fuImage.PostedFile.SaveAs(new_filepath);
                    ViewState["GImage"] = new_filename;
                }

                GalleryGroups pg = new GalleryGroups();
                pg.Id       = Guid.NewGuid();
                pg.ImageUrl = new_filename;
                pg.Title    = txtTitle.Text;
                pg.Priority = Convert.ToInt32(txtPri.Text);
                pg.IsDelete = false;
                db.GalleryGroups.Add(pg);
                db.SaveChanges();
            }
        }
Пример #11
0
        public void UpdateForm()
        {
            int ImageID = int.Parse(ViewState["ImageID"].ToString());

            string new_filename = string.Empty;

            if (fuImage.PostedFile.ContentLength != 0)
            {
                string original_filename = Path.GetFileName(fuImage.PostedFile.FileName);

                new_filename =
                    Guid.NewGuid().ToString() +
                    Path.GetExtension(original_filename);

                string new_filepath = Server.MapPath("~/Uploads/Images/" + new_filename);
                fuImage.PostedFile.SaveAs(new_filepath);
                ViewState["GImage"] = new_filename;
            }

            using (VaranegarEntities db = new VaranegarEntities())
            {
                var n = (from u in db.Images where u.ImageID == ImageID select u).FirstOrDefault();

                n.ImageTitle        = txtTitle.Text;
                n.LastUpdateUserID  = FindUserInfo.OnlineUserID();
                n.ImgLastUpdateDate = DateTime.Now;
                n.ImgUrlAddress     = ViewState["GImage"].ToString();
                n.Priority          = Convert.ToInt32(txtPrio.Text);
                n.IsActive          = chkActive.Checked;
                db.SaveChanges();
            }
        }
        public void UpdateForm()
        {
            string new_filename = string.Empty;

            if (fuImage.PostedFile.ContentLength != 0)
            {
                string original_filename = Path.GetFileName(fuImage.PostedFile.FileName);

                new_filename =
                    Guid.NewGuid().ToString() +
                    Path.GetExtension(original_filename);

                string new_filepath = Server.MapPath("~/Uploads/Customers/" + new_filename);
                fuImage.PostedFile.SaveAs(new_filepath);
                ViewState["GImage"] = new_filename;
            }

            Guid CustomersID = new Guid(ViewState["CustomersID"].ToString());

            using (VaranegarEntities db = new VaranegarEntities())
            {
                var p = (from u in db.Customers where u.CustomersID == CustomersID select u).FirstOrDefault();

                p.CustomerTitle      = txtTitle.Text;
                p.En_CustomerTitle   = txtENTitle.Text;
                p.CustomerName       = txtName.Text;
                p.En_SuccessHistory  = reEN_Desc.Text;
                p.SuccessHistory     = reDesc.Text;
                p.fk_CustomerGroupID = new Guid(ddlProductGroup.SelectedValue);
                p.LastUpdateDate     = DateTime.Now;
                p.IsInHome           = chkInHome.Checked;
                p.ImgLogo            = ViewState["GImage"].ToString();
                db.SaveChanges();
            }
        }
Пример #13
0
        public void UpdateForm()
        {
            int EmailRecieverRoleID = Convert.ToInt32(ViewState["EmailRecieverRoleID"].ToString());

            using (VaranegarEntities db = new VaranegarEntities())
            {
                var n = (from u in db.EmailRecieverRoles where u.EmailRecieverRoleID == EmailRecieverRoleID select u).FirstOrDefault();

                n.Title = txtTitle.Text;

                db.SaveChanges();
            }
        }
Пример #14
0
        public void SubmitData()
        {
            if (Page.IsValid)
            {
                using (VaranegarEntities db = new VaranegarEntities())
                {
                    DemoRequests drEnter = new DemoRequests();
                    drEnter.Name                = txtName.Text;
                    drEnter.CompanyName         = txtCompanyName.Text;
                    drEnter.Post                = txtPost.Text;
                    drEnter.Field               = txtField.Text;
                    drEnter.Phone               = txtPost.Text;
                    drEnter.Mobile              = txtMobile.Text;
                    drEnter.Email               = txtEmail.Text;
                    drEnter.fk_FamiliarMethodID = Convert.ToInt32(ddlfamiliar.SelectedValue);
                    drEnter.FinalDesc           = txtDesc.Text;
                    drEnter.IsDelete            = false;
                    drEnter.Ip = Request.UserHostName;

                    System.Web.HttpBrowserCapabilities browser = Request.Browser;
                    drEnter.Browser       = browser.Type;
                    drEnter.Os            = FindUserInfo.UserOS();
                    drEnter.RegisterDate  = DateTime.Now;
                    drEnter.IsVisited     = false;
                    drEnter.fk_RecieverID = Convert.ToInt32(ddlProduct.SelectedValue);
                    db.DemoRequests.Add(drEnter);
                    db.SaveChanges();



                    string emailBody = @"<table><tr><td>تاریخ</td><td>" + drEnter.RegisterDate + @"</td></tr>
<tr><td>Ip</td><td>" + drEnter.Ip + @"</td></tr>
<tr><td>نام</td><td>" + drEnter.Name + @"</td></tr>
<tr><td>نام شرکت / سازمان</td><td>" + drEnter.CompanyName + @"</td></tr>
<tr><td>پست</td><td>" + drEnter.Post + @"</td></tr>
<tr><td>زمینه فعالیت</td><td>" + drEnter.Field + @"</td></tr>
<tr><td>تلفن ثابت</td><td>" + drEnter.Phone + @"</td></tr>
<tr><td>نحوه آشنایی با ورانگر</td><td>" + ddlfamiliar.SelectedItem.Text + @"</td></tr>
<tr><td>نام نرم افزار</td><td>" + ddlProduct.SelectedItem.Text + @"</td></tr>
<tr><td>ایمیل</td><td>" + drEnter.Email + @"</td></tr>
<tr><td>تلفن همراه</td><td>" + drEnter.Mobile + @"</td></tr>
<tr><td>توضیحات</td><td>" + drEnter.FinalDesc + @"</td></tr></table>";

                    List <string> emailList = SendEmail.ReturnEmailList(Convert.ToInt32(ddlProduct.SelectedValue));

                    SendEmail.Send(emailList, "درخواست دمو", emailBody);

                    SendEmail.SendToUser_User(txtEmail.Text, "درخواست دمو");
                }
            }
        }
        protected void btnYes_Click(object sender, EventArgs e)
        {
            Guid AgentId = new Guid(ViewState["AgentId"].ToString());

            using (VaranegarEntities db = new VaranegarEntities())
            {
                var n = (from u in db.AgentQuestionaries where u.Id == AgentId select u).FirstOrDefault();

                n.IsDelete   = true;
                n.DeleteDate = DateTime.Now;
                db.SaveChanges();
            }
            LoadForm();
        }
Пример #16
0
        protected void btnYes_Click(object sender, EventArgs e)
        {
            Guid contactid = new Guid(ViewState["contactid"].ToString());

            using (VaranegarEntities db = new VaranegarEntities())
            {
                var n = (from u in db.ContactUsForm where u.contactid == contactid select u).FirstOrDefault();

                n.IsDelete   = true;
                n.DeleteDate = DateTime.Now;
                db.SaveChanges();
            }
            LoadForm();
        }
Пример #17
0
        public void InsertForm()
        {
            string new_filename = string.Empty;

            //    string thumbnailUrl = string.Empty;

            if (fuImage.PostedFile.ContentLength != 0)
            {
                string original_filename = Path.GetFileName(fuImage.PostedFile.FileName);

                new_filename =
                    Guid.NewGuid().ToString() +
                    Path.GetExtension(original_filename);

                string new_filepath = Server.MapPath("~/Uploads/Customers/" + new_filename);
                fuImage.PostedFile.SaveAs(new_filepath);
                //      thumbnailUrl = Utils.CreateThumbnail(new_filepath, "~/Uploads/Customers/Thumbs/",115,115);
                //      ViewState["GImage_thubm"] = thumbnailUrl;
                ViewState["GImage"] = new_filename;
            }

            using (VaranegarEntities db = new VaranegarEntities())
            {
                Customers p = new Customers();

                p.CustomersID        = Guid.NewGuid();
                p.CustomerTitle      = txtTitle.Text;
                p.En_CustomerTitle   = txtENTitle.Text;
                p.CustomerName       = txtName.Text;
                p.En_SuccessHistory  = reEN_Desc.Text;
                p.SuccessHistory     = reDesc.Text;
                p.fk_CustomerGroupID = new Guid(ddlProductGroup.SelectedValue);
                p.LastUpdateDate     = DateTime.Now;
                p.IsInHome           = chkInHome.Checked;
                p.ImgLogo            = new_filename;
                //  p.ImgLogo_Thumb = thumbnailUrl;
                p.IsDelete   = false;
                p.submitDate = DateTime.Now;
                p.Priority   = Convert.ToInt32(txtPri.Text);
                p.StartMonth = Convert.ToInt32(ddlStartMonth.SelectedValue);
                p.StartYear  = Convert.ToInt32(ddlStartYear.SelectedValue);

                p.FinishMonth  = Convert.ToInt32(ddlFinishMonth.SelectedValue);
                p.FinishYear   = Convert.ToInt32(ddlFinishYear.SelectedValue);
                p.BranchNumber = Convert.ToInt32(txtBranchNumber.Text);

                db.Customers.Add(p);
                db.SaveChanges();
            }
        }
        public void UpdateForm()
        {
            int EmailId = Convert.ToInt32(ViewState["EmailId"].ToString());

            using (VaranegarEntities db = new VaranegarEntities())
            {
                var n = (from u in db.Emails where u.EmailId == EmailId select u).FirstOrDefault();

                n.EmailTitle        = txtTitle.Text;
                n.fk_RecieverRoleID = Convert.ToInt32(ddlGroup.SelectedValue);

                db.SaveChanges();
            }
        }
        public void InsertForm()
        {
            using (VaranegarEntities db = new VaranegarEntities())
            {
                Emails pg = new Emails();

                pg.EmailTitle        = txtTitle.Text;
                pg.IsDelete          = false;
                pg.fk_RecieverRoleID = Convert.ToInt32(ddlGroup.SelectedValue);

                db.Emails.Add(pg);
                db.SaveChanges();
            }
        }
Пример #20
0
        public void InsertForm()
        {
            string new_filename = string.Empty;

            if (fuImage.PostedFile.ContentLength != 0)
            {
                string original_filename = Path.GetFileName(fuImage.PostedFile.FileName);

                new_filename =
                    Guid.NewGuid().ToString() +
                    Path.GetExtension(original_filename);

                string new_filepath = Server.MapPath("~/Uploads/Gallery/" + new_filename);
                fuImage.PostedFile.SaveAs(new_filepath);
                ViewState["GImage"] = new_filename;
            }

            using (VaranegarEntities db = new VaranegarEntities())
            {
                GalleryImages pg = new GalleryImages();

                pg.Id    = Guid.NewGuid();
                pg.Title = txtTitle.Text;
                if (!string.IsNullOrEmpty(txtVideoLink.Text))
                {
                    pg.VideoLink = txtVideoLink.Text;
                }
                else
                {
                    pg.VideoLink = null;
                }
                pg.ImageUrl = new_filename;
                pg.Priority = Convert.ToInt32(txtPrio.Text);
                pg.Summery  = txtSummery.Text;

                if (ddlGroup.SelectedValue != "-1")
                {
                    pg.fk_GalleryId = new Guid(ddlGroup.SelectedValue);
                }
                else
                {
                    pg.fk_GalleryId = null;
                }

                pg.SubmitDate = DateTime.Now;
                pg.IsDelete   = false;
                db.GalleryImages.Add(pg);
                db.SaveChanges();
            }
        }
Пример #21
0
        protected void btnYes_Click(object sender, EventArgs e)
        {
            Guid ServiceStepID = new Guid(ViewState["ServiceStepID"].ToString());

            using (VaranegarEntities db = new VaranegarEntities())
            {
                var n = (from u in db.ServiceSteps where u.ServiceStepID == ServiceStepID select u).FirstOrDefault();

                n.IsDelete   = true;
                n.DeleteDate = DateTime.Now;
                db.SaveChanges();
            }
            LoadForm();
        }
        protected void btnYes_Click(object sender, EventArgs e)
        {
            int RequestID = Convert.ToInt32(ViewState["RequestID"].ToString());

            using (VaranegarEntities db = new VaranegarEntities())
            {
                var n = (from u in db.DemoRequests where u.RequestID == RequestID select u).FirstOrDefault();

                n.IsDelete   = true;
                n.DeleteDate = DateTime.Now;
                db.SaveChanges();
            }
            LoadForm();
        }
        public void UpdateForm()
        {
            Guid BlogGroupID = new Guid(ViewState["BlogGroupID"].ToString());

            using (VaranegarEntities db = new VaranegarEntities())
            {
                var n = (from u in db.BlogGroups where u.BlogGroupID == BlogGroupID select u).FirstOrDefault();

                n.BlogGroupTitle    = txtTitle.Text;
                n.En_BlogGroupTitle = txtEN_Title.Text;
                n.BlogGroupName     = txtName.Text;
                n.Priority          = Convert.ToInt32(txtPri.Text);
                db.SaveChanges();
            }
        }
        public void UpdateForm()
        {
            int RecieverID = Convert.ToInt32(ViewState["RecieverID"].ToString());

            using (VaranegarEntities db = new VaranegarEntities())
            {
                var p = (from u in db.ContactUsFormRecievers where u.RecieverID == RecieverID select u).FirstOrDefault();

                p.RecieverTitle = txtTitle.Text;
                p.RecieverEmail = txtEmail.Text;
                p.Priority      = Convert.ToInt32(txtPrio.Text);

                db.SaveChanges();
            }
        }
        protected void btnAgree_Click(object sender, EventArgs e)
        {
            int UserID = Convert.ToInt32(ViewState["UserID"].ToString());

            using (VaranegarEntities db = new VaranegarEntities())
            {
                var n = (from u in db.Users where u.UserID == UserID select u).FirstOrDefault();

                n.IsDelete   = true;
                n.DeleteDate = DateTime.Now;
                db.SaveChanges();

                LoadForm();
                pnlSuccess.Visible = true;
            }
        }
Пример #26
0
        protected void btnYes_Click(object sender, EventArgs e)
        {
            Guid ServiceStepItemID = new Guid(ViewState["ServiceStepItemID"].ToString());

            using (VaranegarEntities db = new VaranegarEntities())
            {
                var n = (from a in db.ServiceStepItems
                         where a.ServiceStepItemID == ServiceStepItemID
                         select a).FirstOrDefault();
                db.ServiceStepItems.Remove(n);
                db.SaveChanges();
                LoadForm();
                pnlSuccess.Visible = true;
                pnlDelete.Visible  = false;
            }
        }
        public void InsertForm()
        {
            using (VaranegarEntities db = new VaranegarEntities())
            {
                BlogGroups pg = new BlogGroups();

                pg.BlogGroupID       = Guid.NewGuid();
                pg.BlogGroupTitle    = txtTitle.Text;
                pg.En_BlogGroupTitle = txtEN_Title.Text;
                pg.BlogGroupName     = txtName.Text;
                pg.Priority          = Convert.ToInt32(txtPri.Text);
                pg.IsDelete          = false;
                db.BlogGroups.Add(pg);
                db.SaveChanges();
            }
        }
Пример #28
0
        public void UpdateForm()
        {
            Guid CustomerGroupID = new Guid(ViewState["CustomerGroupID"].ToString());

            using (VaranegarEntities db = new VaranegarEntities())
            {
                var n = (from u in db.CustomerGroups where u.CustomerGroupID == CustomerGroupID select u).FirstOrDefault();

                n.CustomerGroupTitle    = txtTitle.Text;
                n.En_CustomerGroupTitle = txtEN_Title.Text;
                n.CustomerGroupName     = txtName.Text;


                db.SaveChanges();
            }
        }
Пример #29
0
        protected void btnAgree_Click(object sender, EventArgs e)
        {
            Guid CustomerGroupID = new Guid(ViewState["CustomerGroupID"].ToString());

            using (VaranegarEntities db = new VaranegarEntities())
            {
                var n = (from u in db.CustomerGroups where u.CustomerGroupID == CustomerGroupID select u).FirstOrDefault();

                n.IsDelete   = true;
                n.DeleteDate = DateTime.Now;

                db.SaveChanges();

                LoadForm();
                pnlSuccess.Visible = true;
            }
        }
Пример #30
0
        public void InsertForm()
        {
            using (VaranegarEntities db = new VaranegarEntities())
            {
                CustomerGroups pg = new CustomerGroups();

                pg.CustomerGroupID       = Guid.NewGuid();
                pg.CustomerGroupTitle    = txtTitle.Text;
                pg.En_CustomerGroupTitle = txtEN_Title.Text;
                pg.CustomerGroupName     = txtName.Text;

                pg.IsDelete = false;

                db.CustomerGroups.Add(pg);
                db.SaveChanges();
            }
        }