예제 #1
0
        private void SaveGroupCat(int GroupId)
        {
            try
            {
                var gcdel = (from gp in DB.ESHOP_GROUP_CATs
                             where gp.GROUP_ID == GroupId
                             select gp);
                DB.ESHOP_GROUP_CATs.DeleteAllOnSubmit(gcdel);
                DB.SubmitChanges();
                for (int i = 0; i < Rplistcate.Items.Count; i++)
                {
                    HtmlInputCheckBox check = new HtmlInputCheckBox();
                    check = (HtmlInputCheckBox)Rplistcate.Items[i].FindControl("chkSelect");
                    HiddenField Hdid   = Rplistcate.Items[i].FindControl("Hdcatid") as HiddenField;
                    int         _catid = Utils.CIntDef(Hdid.Value);

                    if (check.Checked)
                    {
                        ESHOP_GROUP_CAT grinsert = new ESHOP_GROUP_CAT();
                        grinsert.CAT_ID   = _catid;
                        grinsert.GROUP_ID = GroupId;

                        DB.ESHOP_GROUP_CATs.InsertOnSubmit(grinsert);
                        DB.SubmitChanges();
                    }
                }
            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
        }
예제 #2
0
        private void SaveGroupCat(int GroupId)
        {
            try
            {
                int i = 0;
                HtmlInputCheckBox check = new HtmlInputCheckBox();

                var gcdel = (from gp in DB.ESHOP_GROUP_CATs
                             where gp.GROUP_ID == GroupId
                             select gp);
                DB.ESHOP_GROUP_CATs.DeleteAllOnSubmit(gcdel);

                foreach (RepeaterItem item in rptList.Items)
                {
                    check = new HtmlInputCheckBox();
                    check = (HtmlInputCheckBox)item.FindControl("chkSelect");
                    Label lblID = (Label)item.FindControl("lblID");

                    if (check.Checked)
                    {
                        int             _Id      = Utils.CIntDef(lblID.Text, 0);
                        ESHOP_GROUP_CAT grinsert = new ESHOP_GROUP_CAT();
                        grinsert.CAT_ID   = _Id;
                        grinsert.GROUP_ID = GroupId;

                        DB.ESHOP_GROUP_CATs.InsertOnSubmit(grinsert);
                    }

                    i++;
                }

                //DB.SubmitChanges();
            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
        }
        private void SaveGroupCat(int GroupId)
        {
            try
            {
                int i = 0;
                HtmlInputCheckBox check = new HtmlInputCheckBox();

                var gcdel = (from gp in DB.ESHOP_GROUP_CATs
                             where gp.GROUP_ID == GroupId
                             select gp);
                DB.ESHOP_GROUP_CATs.DeleteAllOnSubmit(gcdel);

                foreach (DataGridItem item in GridItemList.Items)
                {
                    check = new HtmlInputCheckBox();
                    check = (HtmlInputCheckBox)item.Cells[1].FindControl("chkSelect");

                    if (check.Checked)
                    {
                        ESHOP_GROUP_CAT grinsert = new ESHOP_GROUP_CAT();
                        grinsert.CAT_ID   = Utils.CIntDef(GridItemList.DataKeys[i]);
                        grinsert.GROUP_ID = GroupId;

                        DB.ESHOP_GROUP_CATs.InsertOnSubmit(grinsert);
                    }

                    i++;
                }

                //DB.SubmitChanges();
            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
        }
        private void SaveGroupCat(int GroupId)
        {
            try
            {
                int i = 0;
                HtmlInputCheckBox check = new HtmlInputCheckBox();

                var gcdel = (from gp in DB.ESHOP_GROUP_CATs
                              where gp.GROUP_ID == GroupId
                              select gp);
                DB.ESHOP_GROUP_CATs.DeleteAllOnSubmit(gcdel);

                foreach (DataGridItem item in GridItemList.Items)
                {
                    check = new HtmlInputCheckBox();
                    check = (HtmlInputCheckBox)item.Cells[1].FindControl("chkSelect");

                    if (check.Checked)
                    {
                        ESHOP_GROUP_CAT grinsert = new ESHOP_GROUP_CAT();
                        grinsert.CAT_ID=Utils.CIntDef(GridItemList.DataKeys[i]);
                        grinsert.GROUP_ID = GroupId;

                        DB.ESHOP_GROUP_CATs.InsertOnSubmit(grinsert);
                    }

                    i++;
                }

                //DB.SubmitChanges();

            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
        }
예제 #5
0
        private void SaveGroupCat(int GroupId)
        {
            try
            {
                int i = 0;
                HtmlInputCheckBox check = new HtmlInputCheckBox();

                var gcdel = (from gp in DB.ESHOP_GROUP_CATs
                             where gp.GROUP_ID == GroupId
                             select gp);
                DB.ESHOP_GROUP_CATs.DeleteAllOnSubmit(gcdel);

                foreach (RepeaterItem item in rptList.Items)
                {
                    check = new HtmlInputCheckBox();
                    check = (HtmlInputCheckBox)item.FindControl("chkSelect");
                    Label lblID = (Label)item.FindControl("lblID");

                    if (check.Checked)
                    {
                        int _Id = Utils.CIntDef(lblID.Text, 0);
                        ESHOP_GROUP_CAT grinsert = new ESHOP_GROUP_CAT();
                        grinsert.CAT_ID = _Id;
                        grinsert.GROUP_ID = GroupId;

                        DB.ESHOP_GROUP_CATs.InsertOnSubmit(grinsert);
                    }

                    i++;
                }

                //DB.SubmitChanges();

            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
        }
예제 #6
0
        private void SaveGroupCat(int GroupId)
        {
            try
            {
                
                var gcdel = (from gp in DB.ESHOP_GROUP_CATs
                             where gp.GROUP_ID == GroupId
                             select gp);
                DB.ESHOP_GROUP_CATs.DeleteAllOnSubmit(gcdel);
                DB.SubmitChanges();
                for (int i = 0; i < Rplistcate.Items.Count; i++)
                {
                    HtmlInputCheckBox check  = new HtmlInputCheckBox();
                    check = (HtmlInputCheckBox)Rplistcate.Items[i].FindControl("chkSelect");
                    HiddenField Hdid = Rplistcate.Items[i].FindControl("Hdcatid") as HiddenField;
                    int _catid = Utils.CIntDef(Hdid.Value);

                    if (check.Checked)
                    {
                        ESHOP_GROUP_CAT grinsert = new ESHOP_GROUP_CAT();
                        grinsert.CAT_ID = _catid;
                        grinsert.GROUP_ID = GroupId;

                        DB.ESHOP_GROUP_CATs.InsertOnSubmit(grinsert);
                        DB.SubmitChanges();
                    }

                }
               
            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
        }