Пример #1
0
        protected void ucConfirmDialog_Yes(object sender)
        {
            ucConfirmDialog.Hide();

            try
            {

                Admins vcontroller = new Admins();
                Entities.Size vsize = new Entities.Size();
                string errMsg = string.Empty;
                vsize.Masize = Convert.ToInt32(lblsize.Text);
                vsize.Size1 = txttensize.Text;
                int result = vcontroller.save_Size(vsize, ref errMsg);
                if (result > 0)
                {
                    ucNotificationDialog.MessageContent = "Thêm mới size thành công!";
                    ucNotificationDialog.MessageType = 1;
                    ucNotificationDialog.RedirectUrl = "~/Admin/Sizes.aspx";
                    ucNotificationDialog.Show();
                }
                else
                {
                    NotificationMessage("Vui lòng kiểm tra lại.", 0);
                }
            }

            catch (Exception ex)
            {
                Response.Write(ex.Message);
                ucNotificationDialog.MessageContent = "Hệ thống gặp sự cố trong quá trình cập nhật !";
                ucNotificationDialog.MessageType = 0;
                ucNotificationDialog.Show();
            }
        }
Пример #2
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {

            if (string.IsNullOrEmpty(txttensize.Text))
            {
                NotificationMessage("tên size không được để trống", 0);
                return;
            }
            try
            {
                Admins vcontroller = new Admins();
                Entities.Size vsize = new Entities.Size();
                string errMsg = string.Empty;
                vsize.Masize = COMM.Common.GetID_MaxForInsert("[dbo].[Size]", "[MaSize]", "");
                vsize.Size1 = txttensize.Text;
                int result = vcontroller.save_Size(vsize, ref errMsg);
                if (result > 0)
                {
                    ucNotificationDialog.MessageContent = "Thêm mới size thành công!";
                    ucNotificationDialog.MessageType = 1;
                    ucNotificationDialog.RedirectUrl = "~/Admin/Sizes.aspx";
                    ucNotificationDialog.Show();
                }
                else
                {
                    NotificationMessage("Vui lòng kiểm tra lại.", 0);
                }

            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
                NotificationMessage("Hệ thống gặp sự cố trong quá trình thêm user mới!", 0);
            }
        }