Beispiel #1
0
    private void Binds()
    {
        ddlMajorId.DataSource     = MajorBLL.AllData("", "MajorId", "");
        ddlMajorId.DataTextField  = "MajorName";
        ddlMajorId.DataValueField = "MajorId";
        ddlMajorId.DataBind();

        rpView.DataSource = ClassBLL.AllData("", "ClassId", "asc");
        rpView.DataBind();
    }
Beispiel #2
0
    //添加、修改
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        if (btnAdd.Text == "添加")
        {
            Class model = new Class();
            model.ClassName = txtClassName.Value.Trim();
            model.MajorId   = Convert.ToInt32(ddlMajorId.SelectedValue);

            if (ClassBLL.IsTrue(model.ClassName))
            {
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('该班级名称已存在,不能重复!');</script>");
                return;
            }
            else
            {
                if (ClassBLL.AddClass(model) > 0)
                {
                    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('添加成功!');window.location.replace('ClassManage.aspx');</script>");
                    return;
                }
                else
                {
                    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('添加失败!');</script>");
                    return;
                }
            }
        }
        else
        {
            Class model = ClassBLL.GetIdByClass(Convert.ToInt32(Request.QueryString["uid"]));
            model.ClassName = txtClassName.Value.Trim();
            model.MajorId   = Convert.ToInt32(ddlMajorId.SelectedValue);

            if (ClassBLL.IsTrue(model.ClassName, model.ClassId))
            {
                this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('该班级名称已存在,不能重复!');</script>");
                return;
            }
            else
            {
                if (ClassBLL.UpdateClass(model) > 0)
                {
                    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('修改成功!');window.location.replace('ClassManage.aspx');</script>");
                    return;
                }
                else
                {
                    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('修改失败!');</script>");
                    return;
                }
            }
        }
    }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ClassBLL classBLL = new ClassBLL();

                DropDownList_class.DataSource     = classBLL.getAll();
                DropDownList_class.DataTextField  = "name";
                DropDownList_class.DataValueField = "ID";
                DropDownList_class.DataBind();
            }
        }
        //加载下拉框的类别
        private void LoadClassInfo()
        {
            ClassBLL     bll  = new ClassBLL();
            List <Class> list = bll.GetClasses();

            list.Insert(0, new Class()
            {
                CLName = "请选择", CLID = ""
            });
            cmbClass.DataSource    = list;
            cmbClass.DisplayMember = "CLName";
            cmbClass.ValueMember   = "CLID";
        }
Beispiel #5
0
    private void BindsTypes()
    {
        ddlMajorId.DataSource     = MajorBLL.AllData("", "MajorId", "asc");
        ddlMajorId.DataTextField  = "MajorName";
        ddlMajorId.DataValueField = "MajorId";
        ddlMajorId.DataBind();


        ddlClassId.DataSource     = ClassBLL.AllData(" and MajorId =" + ddlMajorId.SelectedValue, "ClassId", "asc");
        ddlClassId.DataTextField  = "ClassName";
        ddlClassId.DataValueField = "ClassId";
        ddlClassId.DataBind();
    }
Beispiel #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ddlClassId.DataSource     = ClassBLL.AllData("", "ClassId", "");
            ddlClassId.DataTextField  = "ClassName";
            ddlClassId.DataValueField = "ClassId";
            ddlClassId.DataBind();
            ddlClassId.Items.Insert(0, new ListItem("全部", "0"));

            Binds();
        }
    }
Beispiel #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ClassBLL classBLL = new ClassBLL();
         //绑定页面查询条件的数据
         DropDownList_class.DataSource    = classBLL.getAll();
         DropDownList_class.DataTextField = "name";
         DropDownList_class.DataBind();
         DropDownList_class.Items.Insert(0, "全院");
         bind();
     }
 }
        //Botao Inserir Dados no Pedido
        private void Botao_Inserir_Click(object sender, EventArgs e)
        {
            int IDLinha = int.Parse(GRID_Procurar.CurrentRow.Cells["Coluna_ID_Procurar"].Value.ToString());

            if (IDLinha != 0)
            {
                objCliente = ClassBLL.BuscarCliente_ID(IDLinha);

                DialogResult = DialogResult.OK;

                Close();
            }
        }
Beispiel #9
0
//EVENTOS DO FORM PEDIDO------------------------------------------------------------------------------------------------

        //Botao Cadastrar Novo Cliente
        private void Botao_Cadastrar_Click(object sender, EventArgs e)
        {
            int Resposta;

            if (MessageBox.Show("Confirmar Novo Cadastro ?", "Mensagem", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
            {
                ClienteDTO objNovoCliente = new ClienteDTO
                {
                    NomeCLiente1        = txtNome.Text,
                    ContatoCliente1     = txtContato.Text,
                    EnderecoCliente1    = txtEndereco.Text,
                    CepCliente1         = txtCep.Text,
                    NumeroCliente1      = txtNumero.Text,
                    ComplementoCliente1 = txtComplemento.Text
                };

                Resposta = ClassBLL.InserirNovoCadastroBLL(objNovoCliente);

                if (Resposta == 1)
                {
                    FormPedido NovoPedido = new FormPedido(objNovoCliente);
                    NovoPedido.Show();
                    this.Hide();
                    DialogResult = DialogResult.OK;
                }
                if (Resposta == -1)
                {
                    MessageBox.Show("Preencha Nome do Cliente !", "Oops!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return;
                }
                if (Resposta == -2)
                {
                    MessageBox.Show("Preencha Contato do Cliente !", "Oops!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return;
                }
                if (Resposta == -3)
                {
                    MessageBox.Show("Preencha Endereço do Cliente !", "Oops!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return;
                }
                if (Resposta == -4)
                {
                    MessageBox.Show("Preencha Cep do Cliente !", "Oops!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return;
                }
                if (Resposta == -5)
                {
                    MessageBox.Show("Preencha Numero da Residencia do Cliente !", "Oops!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return;
                }
                else if (Resposta != 1 && Resposta != -1 && Resposta != -2 && Resposta != -3 && Resposta != -4)
                {
                    MessageBox.Show("Houve erro ao Cadastrar", "ERRO", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int    result = 1;//0.获取验证码成功,1.获取验证码失败,2.系统错误  11.手机号码为空
                string yzm    = "";
                string phone  = Request.QueryString["phone"];
                if (phone == null || phone == "")
                {
                    result = 11;
                }
                else
                {
                    ClassBLL  bll = new ClassBLL();
                    DataSet   ds  = bll.getDataSet("select * from t_custom where phone='" + phone + "' ");
                    DataTable tb  = ds.Tables[0];
                    if (tb == null || tb.Rows.Count < 1)
                    {
                        result = 12;//手机号码已注册
                    }
                    else
                    {
                        try
                        {
                            //这里生成6位数的密码,并通过短信接口发送到手机
                            Random ran     = new Random();
                            int    RandKey = ran.Next(100000, 999999);

                            //发送短信到手机
                            string serverHtml = "http://106.ihuyi.cn/webservice/sms.php?";
                            string strUrl     = "method=Submit&account=" + ConfigurationManager.AppSettings["account"] + "&password="******"password"] + "&mobile=" + phone + "&content=您的密码是:【" + RandKey.ToString() + "】。请妥善保存您的密码,不要泄露给其他人。";
                            string name       = GetReturn(serverHtml, strUrl);

                            if (name.IndexOf("提交成功") != -1)
                            {
                                result = 0;
                                yzm    = RandKey.ToString();
                            }
                        }
                        catch
                        {
                            result = 2;
                        }
                    }
                }

                string jsonStr = "{\"result\":" + result + ",\"yzm\":\"" + yzm + "\"}";
                Response.Write(jsonStr);
                Response.End();
            }
        }
Beispiel #11
0
        //Botao Filtrar Produtos no Pedido
        private void Botao_Filtrar_Click(object sender, EventArgs e)
        {
            GRID_Produtos.Rows.Clear();

            string[] FiltroUser = { txtFiltroCategoria.Text, txtFiltroProduto.Text };

            List <ProdutoDTO> Produtos = ClassBLL.BuscarProduto_2Filtros(FiltroUser);

            foreach (var FORpass in Produtos)
            {
                string[] linhaContato = { FORpass.IDProduto1.ToString(), FORpass.Categoria1, FORpass.NomeProduto1, FORpass.Valor1.ToString() };
                GRID_Produtos.Rows.Add(linhaContato);
            }
        }
Beispiel #12
0
        //Pesquisar Pizza pelo FILTRO
        private void Botao_ProcurarPizza_Click_1(object sender, EventArgs e)
        {
            GRID_Produtos.Rows.Clear();

            string[] FiltroUser = { txtProduto.Text };

            List <ProdutoDTO> Produtos = ClassBLL.Buscar_Pizza_1Filtro_Cat(FiltroUser);

            foreach (var FORpass in Produtos)
            {
                string[] linhaContato = { FORpass.IDProduto1.ToString(), FORpass.Categoria1, FORpass.NomeProduto1, FORpass.Ingredientes1, FORpass.Valor1.ToString() };
                GRID_Produtos.Rows.Add(linhaContato);
            }
        }
        //Botao Procurar Cliente FILTRO
        private void Botao_ProcurarCliente_Click(object sender, EventArgs e)
        {
            GRID_Procurar.Rows.Clear();

            List <ClienteDTO> Contatos = ClassBLL.BuscarCliente_1Filtro_Contato(txtContato.Text);

            foreach (var FORpass in Contatos)
            {
                string[] linhaContato = { FORpass.IDCliente1.ToString(), FORpass.NomeCLiente1, FORpass.ContatoCliente1, FORpass.EnderecoCliente1, FORpass.CepCliente1, FORpass.NumeroCliente1, FORpass.ComplementoCliente1 };
                GRID_Procurar.Rows.Add(linhaContato);
            }

            txtContato.Text = string.Empty;
        }
Beispiel #14
0
        public void bind()
        {
            courTableID = Request.QueryString["courTableID"];

            User user = Session["User"] as User;

            TeacherBLL     teachBLL = new TeacherBLL();
            StudentBLL     studBLL  = new StudentBLL();
            CourseTableBLL ctBLL    = new CourseTableBLL();
            CourseTable    ct       = ctBLL.get(courTableID);

            ClassBLL classBll = new ClassBLL();
            Class    cla      = classBll.get(ct.ClassID);

            className.Text = cla.Name;

            dt = studBLL.getByClassId(ct.ClassID).Tables[0];

            if (Session["attenList"] != null)
            {
                attenList = Session["attenList"] as List <Attendance>;
            }
            else
            {
                attenList = new List <Attendance>();
                foreach (DataRow dr in dt.Rows)
                {
                    Attendance attend = new Attendance();
                    attend.Status      = "正常";
                    attend.Remark      = "";
                    attend.Recorder    = "教师";
                    attend.RecorderID  = teachBLL.getByUserId(user.Id).Id;
                    attend.StudID      = dr["ID"].ToString();
                    attend.CourTableID = courTableID;

                    attenList.Add(attend);
                }
            }

            AspNetPager1.RecordCount = dt.Rows.Count;

            int from = (AspNetPager1.CurrentPageIndex - 1) * AspNetPager1.PageSize + 1;
            int to   = from + AspNetPager1.PageSize - 1 > AspNetPager1.RecordCount ? AspNetPager1.RecordCount : from + AspNetPager1.PageSize - 1;

            GridView1.DataSource = PageUtil.resort(PageUtil.getPaged(dt, from, to));
            GridView1.DataBind();

            initStatusAndRemark();
        }
Beispiel #15
0
        public FormClientesEDIT()
        {
            InitializeComponent();
            GRID_Clientes.DataSource = null;

            List <ClienteDTO> LISTA = ClassBLL.BuscarClientes();

            GRID_Clientes.Rows.Clear();

            foreach (var FORpass in LISTA)
            {
                string[] linhaContato = { FORpass.IDCliente1.ToString(), FORpass.NomeCLiente1, FORpass.ContatoCliente1, FORpass.EnderecoCliente1, FORpass.CepCliente1, FORpass.NumeroCliente1, FORpass.ComplementoCliente1 };
                GRID_Clientes.Rows.Add(linhaContato);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable tb = Session["users"] as DataTable;

            name = tb.Rows[0]["name"].ToString();
            if (tb.Rows[0]["imgUrl"].ToString() != "")
            {
                logo = VirturlPath + tb.Rows[0]["imgUrl"].ToString();
            }
            else
            {
                logo = VirturlPath + "/Upload/logo/zw.png";
            }
            ClassBLL bll = new ClassBLL();
        }
Beispiel #17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["uid"] != null)
            {
                Class model = ClassBLL.GetIdByClass(Convert.ToInt32(Request.QueryString["uid"]));

                txtClassName.Value       = model.ClassName.Trim();
                ddlMajorId.SelectedValue = model.MajorId.ToString();
                btnAdd.Text = "修改";
            }
            Binds();
        }
    }
Beispiel #18
0
    protected void lnkbDel_Click(object sender, EventArgs e)
    {
        LinkButton lnkbDel = (LinkButton)sender;

        if (ClassBLL.DeleteClass(Convert.ToInt32(lnkbDel.CommandArgument)) > 0)
        {
            this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('删除成功!');window.location.replace('ClassManage.aspx');</script>");
            return;
        }
        else
        {
            this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('删除失败!');</script>");
            return;
        }
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            string   res        = "";
            JsonData jsonResult = new JsonData();

            try
            {
                List <FileInfos> fs = UploadFile(Request, rootDirectory, Menus);
                if (fs.Count > 0)
                {
                    JsonData data = new JsonData();
                    for (int i = 0; i < fs.Count; i++)
                    {
                        FileInfos fsw  = fs[i];
                        JsonData  json = new JsonData();
                        json["type"]         = fsw.type;
                        json["length"]       = fsw.length;
                        json["filename"]     = fsw.filename;
                        json["datafilename"] = fsw.datafilename;
                        data.Add(json);
                    }
                    jsonResult["res"]   = (int)MyEnum.ResultEnum.成功;
                    jsonResult["msg"]   = "成功";
                    jsonResult["count"] = fs.Count;
                    jsonResult["code"]  = "";
                    jsonResult["Data"]  = data;

                    ClassBLL bll = new ClassBLL();
                    int      jg  = bll.Execute("update System_Config set value='" + fs[0].datafilename + "' where toid='78AF3EF9-5676-4EFD-86EB-808BF05518CD'");
                }
                else
                {
                    jsonResult["res"]  = (int)MyEnum.ResultEnum.失败;
                    jsonResult["msg"]  = "类型有误";
                    jsonResult["code"] = "";
                }
            }
            catch (Exception ex)
            {
                jsonResult["res"]  = (int)MyEnum.ResultEnum.系统错误;
                jsonResult["msg"]  = "服务器繁忙,请稍后再试";
                jsonResult["code"] = ex.Message;
            }
            res = JsonMapper.ToJson(jsonResult);
            res = MyString.UnicodeToString(res);
            //log.setlog("返回值", res);
            Response.Write(res);
        }
Beispiel #20
0
        //Salvar Edição
        private void Botao_IncluirProduto_Click(object sender, EventArgs e)
        {
            int Resposta;

            if (objProduto == null)
            {
                objProduto = new ProdutoDTO();
            }

            objProduto.IDProduto1    = int.Parse(txtID.Text);
            objProduto.NomeProduto1  = txtNomeProduto.Text;
            objProduto.Ingredientes1 = txtIngrediente.Text;
            objProduto.Categoria1    = txtCategoria.Text;

            Resposta = ClassBLL.AtualizarProduto(objProduto, txtValor.Text);

            if (Resposta == 1)
            {
                MessageBox.Show("Produto editado com Sucesso !", "Sucesso", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            if (Resposta == -1)
            {
                MessageBox.Show("Preencha Nome do Produto !", "Oops!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return;
            }
            if (Resposta == -2)
            {
                MessageBox.Show("Preencha Ingredientes do Produto !", "Oops!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return;
            }
            if (Resposta == -3)
            {
                MessageBox.Show("Preencha Valor do Produto !", "Oops!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return;
            }
            if (Resposta == -4)
            {
                MessageBox.Show("Preencha Categoria do Produto !", "Oops!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return;
            }
            else if (Resposta != 1 && Resposta != -1 && Resposta != -2 && Resposta != -3 && Resposta != -4)
            {
                MessageBox.Show("Houve erro ao atualizar o Produto", "ERRO", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            GroupEdit.Visible = false;
            Opacidade.Visible = false;

            string[] linhaContato = { objProduto.IDProduto1.ToString(), objProduto.Categoria1, objProduto.NomeProduto1, objProduto.Ingredientes1, objProduto.Valor1.ToString(), };

            GRID_Produtos.Rows[GRID_Produtos.CurrentRow.Index].SetValues(linhaContato);
        }
Beispiel #21
0
        protected void ImageButton_delete_Click(object sender, ImageClickEventArgs e)
        {
            ImageButton imageButton = sender as ImageButton;

            string id = imageButton.CommandArgument;

            Class clazz = new Class();

            clazz.Id = id;

            ClassBLL classBLL = new ClassBLL();

            classBLL.delete(clazz);

            Response.Write("<script>alert('删除成功!');location.href='showClasses.aspx';</script>");
        }
Beispiel #22
0
        public FormPedidoEDIT()
        {
            InitializeComponent();

            GRID_Pedidos.DataSource = null;

            List <ClassPedido> LISTA = ClassBLL.BuscarPedidos();

            GRID_Pedidos.Rows.Clear();

            foreach (var FORpass in LISTA)
            {
                string[] linhaContato = { FORpass.IDCliente1.ToString(), FORpass.NomeCliente1, FORpass.ContatoCliente1, FORpass.CategoriaProduto1, FORpass.NomeProduto1, FORpass.ValorProduto1.ToString() };
                GRID_Pedidos.Rows.Add(linhaContato);
            }
        }
Beispiel #23
0
        //Editar Produto pelo ID ao selecionar com o mouse
        private void Botao_Editar_Click(object sender, EventArgs e)
        {
            GroupEdit.Visible = true;
            Opacidade.Visible = true;
            int IDLinha = int.Parse(GRID_Produtos.CurrentRow.Cells["Coluna_ID_Produto"].Value.ToString());

            if (IDLinha != 0)
            {
                objProduto = ClassBLL.BuscarProduto_ID(IDLinha);

                txtID.Text          = objProduto.IDProduto1.ToString();
                txtNomeProduto.Text = objProduto.NomeProduto1;
                txtIngrediente.Text = objProduto.Ingredientes1;
                txtValor.Text       = objProduto.Valor1.ToString();
                txtCategoria.Text   = objProduto.Categoria1;
            }
        }
Beispiel #24
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            #region //

            //ClassBLL objClass1BLL = new ClassBLL();
            //ClassModel objClass = new ClassModel();
            //objClass.ClaNum = txtbClassNum.Text;
            //objClass.ClaName = txtbClass.Text;
            //objClass.DeptNum = txtbDeptNum.Text;
            //objClass.ProNum = txtbProNum.Text;

            //if (objClass1BLL.AddClass(objClass) == true)
            //    MessageBox.Show("数据添加成功");
            //else
            //    MessageBox.Show("数据添加成功");
            //dgvClass.DataSource = objClass1BLL.ShowClass();
            #endregion

            #region 使用实体类在各层传递数据:

            if (txtClaNum.Text == "" || txtClaName.Text == "")
            {
                MessageBox.Show("班号、班名都不能为空!\n 请重新输入!");
            }
            else
            {
                ClassBLL objClassBLL = new ClassBLL();

                SchoolMolel objClassModel = new SchoolMolel();

                objClassModel.ClaName = txtClaName.Text;
                objClassModel.SchNum = txtClaNum.Text;
                objClassModel.DeptNum = txtDeptNum.Text;
                objClassModel.ProNum = txtProNum.Text;

                if (objClassBLL.AddClass(objClassModel)==true)
                {
                    MessageBox.Show("添加成功!");
                }
                else
                    MessageBox.Show("添加失败!");
            }
            #endregion

            ShowClass();
        }
 public ActionResult Create(ClassBLL collection)
 {
     try
     {
         // TODO: Add insert logic here
         using (ContextBLL ctx = new ContextBLL())
         {
             ctx.CreateClass(collection);
         }
         return(RedirectToAction("Index"));
     }
     catch (Exception ex)
     {
         ViewBag.Exception = ex;
         return(View("Error"));
     }
 }
Beispiel #26
0
    public static bool resimKaydet(this System.Web.UI.WebControls.FileUpload fileupload, string yol, int boyut, out string resim, out string mesaj)
    {
        mesaj = "";
        resim = yol;


        if (fileupload.HasFile)
        {
            string tamponresim = fileupload.FileName.ToLower();

            if (!tamponresim.EndsWith("jpeg") && !tamponresim.EndsWith("gif") && !tamponresim.EndsWith("png") && !tamponresim.EndsWith("image/pjpeg") && !tamponresim.EndsWith("jpg"))
            {
                mesaj = "jpeg, jpg , png, gif formatlarından birini seçiniz...";
                return(false);
            }

            try
            {
                string resimurl = ClassBLL.ZamanaGoreResimAdiGetir();

                string[] kelimeler = tamponresim.Split(new string[] { "." }, StringSplitOptions.RemoveEmptyEntries);
                string   uzanti    = kelimeler[kelimeler.Length - 1];

                resimurl += "." + uzanti;
                resim    += "/" + resimurl;

                string yeniyol = System.Web.HttpContext.Current.Server.MapPath(yol) + "\\" + resimurl;

                fileupload.SaveAs(yeniyol);

                ImageFormat imgformat = uzanti.resimFormati();

                ResimBoyutlandir(yeniyol, yeniyol, boyut, imgformat);

                return(true);
            }
            catch (Exception exc)
            {
                mesaj = exc.Message;
            }

            return(false);
        }
        return(false);
    }
Beispiel #27
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string resim = "", mesaj = "";

        if (!FileUpload1.HasFile)
        {
            Labelbilgi.Text = "<p class='msg warning'><b>Resim Seçmelisiniz</b></p>";
            return;
        }

        if (ClassBLL.resimKaydet(FileUpload1, "~/panel/imgUrun", out resim, out mesaj))
        {
            Image1.ImageUrl = resim;
        }
        if (FileUpload1.HasFile && mesaj != "")
        {
            Labelbilgi.Text = mesaj;
            return;
        }
        hizmet yeni = new hizmet();

        yeni.Adi = adiTextBox.Text;

        yeni.Resim = Image1.ImageUrl;

        yeni.Aciklama = aciklamaCKEditorControl.Text;

        yeni.Sira = Convert.ToInt32(DropDownList1.SelectedValue);

        yeni.MetaKeyword     = KeywordsDonustur(KeywordTxt.Text.Trim());
        yeni.MetaDescription = KeywordsDonustur(DescriptionTxt.Text.Trim());
        yeni.MetaTitle       = TitleTxt.Text.Trim();
        yeni.SeoYazisi       = UrlDonustur(adiTextBox.Text.Trim());
        Result <int> sonuc = yeni.Insert();

        if (sonuc.HasError)
        {
            Labelbilgi.Text = "<p class='msg error'><b>Hata :" + sonuc.CustomErrorMessage + "</b></p>";
            return;
        }
        else
        {
            Response.Redirect("hizmetler.aspx");
        }
    }
Beispiel #28
0
        //Abrir o Formulario Com Grid Cheio
        public FormProdutosEDIT()
        {
            InitializeComponent();

            GRID_Produtos.DataSource = null;

            List <ProdutoDTO> LISTA = ClassBLL.BuscarProdutos();

            GRID_Produtos.Rows.Clear();

            foreach (var FORpass in LISTA)
            {
                string[] linhaContato = { FORpass.IDProduto1.ToString(), FORpass.Categoria1, FORpass.NomeProduto1, FORpass.Ingredientes1, FORpass.Valor1.ToString(), };
                GRID_Produtos.Rows.Add(linhaContato);
            }

            GRID_Produtos.Visible = true;
        }
Beispiel #29
0
        private void Botao_IncluirProduto_Click(object sender, EventArgs e)
        {
            int Resposta;

            int IDLinha = int.Parse(GRID_Clientes.CurrentRow.Cells["Coluna_ID_Cliente"].Value.ToString());

            if (objCliente == null)
            {
                objCliente = new ClienteDTO();
            }

            objCliente.IDCliente1          = int.Parse(txtID.Text);
            objCliente.NomeCLiente1        = txtNome.Text;
            objCliente.ContatoCliente1     = txtContato.Text;
            objCliente.EnderecoCliente1    = txtEndereco.Text;
            objCliente.CepCliente1         = txtCep.Text;
            objCliente.NumeroCliente1      = txtNumero.Text;
            objCliente.ComplementoCliente1 = txtComplemento.Text;

            Resposta = ClassBLL.AtualizarCliente(objCliente, IDLinha);


            if (Resposta == 1)
            {
                MessageBox.Show("Cliente editado com Sucesso !", "Sucesso", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            /*if (Resposta == -1) { MessageBox.Show("Preencha Nome do Cliente !", "Oops!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; }
             * if (Resposta == -2) { MessageBox.Show("Preencha Contato do Cliente !", "Oops!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; }
             * if (Resposta == -3) { MessageBox.Show("Preencha Endereco do Cliente !", "Oops!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; }
             * if (Resposta == -4) { MessageBox.Show("Preencha Cep do Cliente !", "Oops!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; }
             * if (Resposta == -5) { MessageBox.Show("Preencha Numero do Cliente !", "Oops!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; }
             * else if (Resposta != 1 && Resposta != -1 && Resposta != -2 && Resposta != -3 && Resposta != -4 && Resposta != -5)
             * {
             *  MessageBox.Show("Houve erro ao atualizar o Produto", "ERRO", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             * }*/

            GroupEdit.Visible = false;
            Opacidade.Visible = false;

            string[] linhaContato = { objCliente.IDCliente1.ToString(), objCliente.NomeCLiente1, objCliente.ContatoCliente1, objCliente.EnderecoCliente1, objCliente.CepCliente1, objCliente.NumeroCliente1, objCliente.NumeroCliente1, objCliente.ComplementoCliente1 };

            GRID_Clientes.Rows[GRID_Clientes.CurrentRow.Index].SetValues(linhaContato);
        }
Beispiel #30
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        int id = Convert.ToInt32(Request["Id"].ToString());

        hizmet duzenle = hizmet.Select(id);


        string resim = "", mesaj = "";

        if (FileUpload1.HasFile)
        {
            if (ClassBLL.resimKaydet(FileUpload1, "~/panel/imgUrun", out resim, out mesaj))
            {
                Image1.ImageUrl = resim;
            }
            if (FileUpload1.HasFile && mesaj != "")
            {
                Labelbilgi.Text = mesaj;
                return;
            }
            resim = Image1.ImageUrl;
        }


        duzenle.Adi             = adiTextBox.Text;
        duzenle.Resim           = Image1.ImageUrl;
        duzenle.Aciklama        = aciklamaCKEditorControl.Text;
        duzenle.Sira            = Convert.ToInt32(DropDownList1.SelectedValue);
        duzenle.MetaKeyword     = KeywordsDonustur(KeywordTxt.Text.Trim());
        duzenle.MetaDescription = KeywordsDonustur(DescriptionTxt.Text.Trim());
        duzenle.MetaTitle       = TitleTxt.Text.Trim();
        duzenle.SeoYazisi       = UrlDonustur(adiTextBox.Text.Trim());
        Result <int> sonuc = duzenle.Update();

        if (sonuc.HasError)
        {
            Labelbilgi.Text = "<p class='msg error'><b>Hata :" + sonuc.CustomErrorMessage + "</b></p>";
            return;
        }
        else
        {
            Labelbilgi.Text = "<p class='msg done'><b>Kayıt Başarılı...</b></p>";
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        int id = Convert.ToInt32(Request["Id"].ToString());

        urun duzenle = urun.Select(id);


        string resim = "", mesaj = "";

        if (FileUpload1.HasFile)
        {
            if (ClassBLL.resimKaydet(FileUpload1, "~/panel/imgUrun", out resim, out mesaj))
            {
                Image1.ImageUrl = resim;
            }
            if (FileUpload1.HasFile && mesaj != "")
            {
                Labelbilgi.Text = mesaj;
                return;
            }
            resim = Image1.ImageUrl;
        }


        duzenle.Adi      = adiTextBox.Text;
        duzenle.Resim    = Image1.ImageUrl;
        duzenle.Aciklama = " ";
        // duzenle.FkKategori = Convert.ToInt32(DropDownList2.SelectedValue);

        //duzenle.Aciklama = aciklamaCKEditorControl.Text;


        Result <int> sonuc = duzenle.Update();

        if (sonuc.HasError)
        {
            Labelbilgi.Text = "<p class='msg error'><b>Hata :" + sonuc.CustomErrorMessage + "</b></p>";
            return;
        }
        else
        {
            Labelbilgi.Text = "<p class='msg done'><b>Kayıt Başarılı...</b></p>";
        }
    }
Beispiel #32
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            #region //
            //ClassBLL objClass1BLL = new ClassBLL();
            //ClassModel objClass = new ClassModel();
            ////objClass.ClaNum = dgvClass[0, dgvClass.CurrentRow.Index].Value.ToString();
            //objClass.ClaNum = txtClassNum.Text;
            //objClass.ClaName = txtClassName.Text;
            //objClass.DeptNum = txtDeptNum.Text;
            //objClass.ProNum = txtProNum.Text;
            //if (objClass1BLL.ChangeClass(objClass) == true)
            //    MessageBox.Show("数据修改成功");
            //else
            //    MessageBox.Show("数据修改失败");

            //dgvClass.DataSource = objClass1BLL.ShowClass();
            #endregion

            #region 使用实体类在各层传递数据
            //if (txtStuNum.Text == "")
            if (txtClaNum.Text=="" || txtClaName.Text=="")
            {
                MessageBox.Show("班号、班名不能为空!\n 请重新输入!");
            }
            else
            {

                ClassBLL objClassBLL = new ClassBLL();

                SchoolMolel objClassModel = new SchoolMolel();

                objClassModel.ClaName = txtClaName.Text;
                objClassModel.SchNum = txtClaNum.Text;
                objClassModel.DeptNum = txtDeptNum.Text;
                objClassModel.ProNum = txtProNum.Text;

                if(objClassBLL.ChangeClass(objClassModel)==true)
                {
                    MessageBox.Show("修改成功!");
                }
                else
                    MessageBox.Show("修改失败!");
            }
            #endregion

            ShowClass();
        }
Beispiel #33
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            #region 使用实体类在各层传递数据
            ClassBLL objClass1BLL = new ClassBLL();
            SchoolMolel objClassModel = new SchoolMolel();

            objClassModel.SchNum = txtClaNum.Text;

            if (objClass1BLL.DeleteClass(objClassModel) == true)
            {
                objClass1BLL.DeleteClass(objClassModel);
                MessageBox.Show("数据删除成功");

            }
            else
            {
                MessageBox.Show("数据删除失败");
            }
            #endregion

            ShowClass();
        }
Beispiel #34
0
        private void ShowClass()
        {
            ClassBLL objClass1BLL = new ClassBLL();

            dgvClass.DataSource = objClass1BLL.ShowClass();
        }
Beispiel #35
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            #region 使用实体类在三层中传递数据
            ClassBLL objClass1BLL = new ClassBLL();
            SchoolMolel objClassModel = new SchoolMolel();

            DataBaseOperaClass objDataBase = new DataBaseOperaClass();

            objClassModel.SchNum = txtClaNum.Text;
            dgvClass.DataSource = objClass1BLL.SearchClass(objClassModel);
            #endregion

            ShowClass();
        }