Ejemplo n.º 1
0
    protected void btnCreateStudio_Click(object sender, EventArgs e)
    {
        tbl_Studio objStudio = new tbl_Studio();

        if (txtStudio.Text.Trim() == "")
        {
            MessageBox.Show("Please Provide Name!!");
            txtStudio.Focus();
            mpStudio.Show();
            return;
        }

        objStudio.Studio_Name = txtStudio.Text.Trim();
        if (new DataLayer().Studio_savebtn(objStudio))
        {
            MessageBox.Show("Created Successfully");
            txtStudio.Text = "";
            fill_Studio();
        }
        else
        {
            MessageBox.Show("Error");
            mpStudio.Show();
        }
    }
Ejemplo n.º 2
0
    public bool Studio_savebtn(tbl_Studio objStudio)
    {
        bool   flag    = false;
        string strQuer = "";

        strQuer = "set dateformat dmy; insert into tbl_Studio([Studio_Name],[Studio_Status])values('" + objStudio.Studio_Name + "','" + objStudio.Studio_Status + "');select @@Identity";
        try
        {
            ExecuteSelectQuery(strQuer);
            flag = true;
        }
        catch (Exception ee)
        {
            flag = false;
        }
        return(flag);
    }