protected void Button1_Click(object sender, EventArgs e)
    {
        string str1 = "select * from MasterPageMaster where MasterPageName='" + txtMasterPageName.Text + "'  and  WebsiteSectionId='" + ddlWebsiteSection.SelectedValue + "'";

        SqlCommand     cmd1 = new SqlCommand(str1, con);
        SqlDataAdapter da1  = new SqlDataAdapter(cmd1);
        DataTable      dt1  = new DataTable();

        da1.Fill(dt1);
        if (dt1.Rows.Count > 0)
        {
            lblmsg.Visible = true;
            lblmsg.Text    = "Record already exists";
        }

        else
        {
            string     MasterInsert = "Insert Into MasterPageMaster (MasterPageName,MasterPageDescription,WebsiteSectionId) values ('" + txtMasterPageName.Text + "','" + txtDes.Text + "','" + ddlWebsiteSection.SelectedValue + "')";
            SqlCommand cmd          = new SqlCommand(MasterInsert, con);
            con.Open();
            cmd.ExecuteNonQuery();
            con.Close();
            clearall();
            Fillgrid();
            lblmsg.Visible = true;
            lblmsg.Text    = "Record inserted successfully";
            ModernpopSync.Show();
        }

        addnewpanel.Visible = true;
        pnladdnew.Visible   = false;
        lbllegend.Text      = "";
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        string str1 = "select * from MasterPageMaster where MasterPageName='" + txtMasterPageName.Text + "' and WebsiteSectionId='" + ddlWebsiteSection.SelectedValue + "'   and MasterPageId<>'" + ViewState["update"] + "'  ";

        SqlCommand     cmd1 = new SqlCommand(str1, con);
        SqlDataAdapter da1  = new SqlDataAdapter(cmd1);
        DataTable      dt1  = new DataTable();

        da1.Fill(dt1);
        if (dt1.Rows.Count > 0)
        {
            lblmsg.Visible = true;
            lblmsg.Text    = "Record already exists";
        }
        else
        {
            string     sr51   = ("update MasterPageMaster set MasterPageName='" + txtMasterPageName.Text + "',MasterPageDescription='" + txtDes.Text + "',WebsiteSectionId='" + ddlWebsiteSection.SelectedValue + "'  where MasterPageId='" + ViewState["update"] + "' ");
            SqlCommand cmd801 = new SqlCommand(sr51, con);

            con.Open();
            cmd801.ExecuteNonQuery();
            con.Close();
            GridView1.EditIndex = -1;
            Fillgrid();
            clearall();
            lblmsg.Visible = true;
            lblmsg.Text    = "Record updated successfully";
            ModernpopSync.Show();
        }
        Button3.Visible     = false;
        Button1.Visible     = true;
        addnewpanel.Visible = true;
        pnladdnew.Visible   = false;
        lbllegend.Text      = "";
    }
Example #3
0
 protected void CheckBox12_CheckedChanged(object sender, EventArgs e)
 {
     if (CheckBox12.Checked == true)
     {
         CheckBox11.Checked = false;
         CheckBox1.Checked  = false;
         string         strcln1 = "  select *   from ProductCodeDetailTbl where  CompanyDefaultData=1 and ProductId='" + ddlproductversion.SelectedValue + "'";
         SqlCommand     cmdcln1 = new SqlCommand(strcln1, con);
         DataTable      dtcln1  = new DataTable();
         SqlDataAdapter adpcln1 = new SqlDataAdapter(cmdcln1);
         adpcln1.Fill(dtcln1);
         if (dtcln1.Rows.Count > 0)
         {
             ModernpopSync.Show();
             Label6.Text = "There is another database code type name " + dtcln1.Rows[0]["CodeTypeName"].ToString() + "  is selected as main applciation database, Would you like to change that to this new selction ?";
         }
     }
 }
Example #4
0
 protected void CheckBox11_CheckedChanged(object sender, EventArgs e)
 {
     if (CheckBox11.Checked == true)
     {
         CheckBox12.Checked = false;
         CheckBox1.Checked  = false;
         string         strcln1 = "  select *   from ProductCodeDetailTbl where  BusiwizSynchronization=1 and ProductId='" + ddlproductversion.SelectedValue + "'";
         SqlCommand     cmdcln1 = new SqlCommand(strcln1, con);
         DataTable      dtcln1  = new DataTable();
         SqlDataAdapter adpcln1 = new SqlDataAdapter(cmdcln1);
         adpcln1.Fill(dtcln1);
         if (dtcln1.Rows.Count > 0)
         {
             ModernpopSync.Show();
             Label6.Text = "For one product only one database can be set as busicontroller database, there is already another database code set as Busicontroller database " + dtcln1.Rows[0]["CodeTypeName"].ToString() + " would you wish to change the Busicontroller data base to " + txtcodetypename.Text + "";
         }
     }
 }
Example #5
0
 protected void btndosyncro_Clickpop(object sender, EventArgs e)
 {
     ModernpopSync.Show();
 }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string str22 = "  Select WebsiteSection.* from WebsiteSection where WebsiteSection.SectionName='" + txtSectionName.Text + "' and WebsiteSection.AfterLoginDefaultPageId='" + ddlLoginPage.SelectedValue + "' and WebsiteSection.WebsiteMasterId='" + ddlWebsite.SelectedValue + "'";

        SqlCommand cmd2 = new SqlCommand(str22, con);

        con.Open();
        SqlDataReader rdr = cmd2.ExecuteReader();

        if (rdr.Read())
        {
            lblmsg.Text = "You can't add Same Website Section  in the Same Version of the Website";
            con.Close();
        }

        else
        {
            con.Close();
            string MasterInsert  = "";
            string Mainfol       = "";
            string SubFol        = "";
            string MainsubSubFol = "";
            string path          = "";
            if (ddl_MainFolder.SelectedIndex > 0)
            {
                Mainfol = ddl_MainFolder.SelectedValue;
            }
            if (ddl_subfolder.SelectedIndex > 0)
            {
                SubFol = ddl_subfolder.SelectedValue;
            }
            if (ddl_SubSubfolder.SelectedIndex > 0)
            {
                MainsubSubFol = ddl_SubSubfolder.SelectedValue;
            }

            if (txtFolderName.Text != "")
            {
                path = txtFolderName.Text;
            }


            if (ddlLoginPage.SelectedIndex > 0)
            {
                MasterInsert = "Insert Into WebsiteSection (WebsiteMasterId,SectionName,AfterLoginDefaultPageId,NormalUrl,LoginUrl , PageLocationPath, MainFolder, SubFolder, SubSubFolder) values ('" + ddlWebsite.SelectedValue + "','" + txtSectionName.Text + "','" + ddlLoginPage.SelectedValue + "','" + txtNormalUrl.Text + "','" + txtLoginUrl.Text + "', '" + txtFolderName.Text + "' ,'" + Mainfol + "' ,'" + SubFol + "' ,'" + MainsubSubFol + "')";
            }
            else
            {
                MasterInsert = "Insert Into WebsiteSection (WebsiteMasterId,SectionName,NormalUrl,LoginUrl, PageLocationPath, MainFolder, SubFolder, SubSubFolder) values "
                               + " ('" + ddlWebsite.SelectedValue + "','" + txtSectionName.Text + "','" + txtNormalUrl.Text + "','" + txtLoginUrl.Text + "' , '" + txtFolderName.Text + "' ,'" + Mainfol + "' ,'" + SubFol + "' ,'" + MainsubSubFol + "')";
            }
            SqlCommand cmd = new SqlCommand(MasterInsert, con);
            con.Open();
            cmd.ExecuteNonQuery();
            con.Close();
            Fillgrid();
            lblmsg.Visible = true;
            lblmsg.Text    = "Record inserted successfully";
            ModernpopSync.Show();
            clearall();
            lbllegend.Text      = "";
            addnewpanel.Visible = true;
            pnladdnew.Visible   = false;
            //}
            //}
        }
    }
Example #7
0
    protected void btnsubmit_Click(object sender, EventArgs e)
    {
        try
        {
            if (btnsubmit.Text == "Update")
            {
                DataTable dtc = select("Select * from PriceplanrestrictionTbl where PortalId='" + ddlportal.SelectedValue + "' and ProductversionId='" + ddlproduct.SelectedValue + "' and TableId='" + ddltable.SelectedValue + "' and NameofRest='" + txtnameofrest.Text + "' and TextofQueinSelection='" + txttxtquestpps.Text + "' and Id<>'" + ViewState["pfid"] + "'");
                if (dtc.Rows.Count == 0)
                {
                    SqlCommand cmd = new SqlCommand("Update PriceplanrestrictionTbl set RestGroupname='" + txtrestgroupname.Text + "', PortalId='" + ddlportal.SelectedValue + "',FieldrestrictionSet='" + ddlfeildrest.SelectedItem.Text + "',RestrictfieldId='" + txtfieldIdRest.Text + "', Restingroup='" + txtrestgroup.Text + "',Priceaddingroup='" + txtaddprice.Text + "', ProductversionId='" + ddlproduct.SelectedValue + "',TableId='" + ddltable.SelectedValue + "', NameofRest='" + txtnameofrest.Text + "', TextofQueinSelection='" + txttxtquestpps.Text + "' where Id='" + ViewState["pfid"] + "' ", con);

                    if (con.State.ToString() != "Open")
                    {
                        con.Open();
                    }

                    int result = cmd.ExecuteNonQuery();

                    con.Close();
                    if (result > 0)
                    {
                        lblmsg.Visible = true;
                        btnsubmit.Text = "Submit";
                        lblmsg.Text    = "Record updated successfully. ";
                        FillGrid();
                        txttxtquestpps.Text        = "";
                        txtnameofrest.Text         = "";
                        txtaddprice.Text           = "";
                        txtrestgroup.Text          = "";
                        ddltable.SelectedIndex     = 0;
                        ddlportal.SelectedValue    = "0";
                        ddlfeildrest.SelectedIndex = 0;
                        txtfieldIdRest.Text        = "";
                        txtrestgroupname.Text      = "";
                        addnewpanel.Visible        = true;
                        pnladdnew.Visible          = false;
                        Label2.Text = "";
                        ModernpopSync.Show();
                    }
                }
                else
                {
                    lblmsg.Visible = true;
                    lblmsg.Text    = "Record is already existed.";
                }
            }
            else
            {
                DataTable dtc = select("Select * from PriceplanrestrictionTbl where PortalId='" + ddlportal.SelectedValue + "' and ProductversionId='" + ddlproduct.SelectedValue + "' and TableId='" + ddltable.SelectedValue + "' and NameofRest='" + txtnameofrest.Text + "' and TextofQueinSelection='" + txttxtquestpps.Text + "'");
                if (dtc.Rows.Count == 0)
                {
                    SqlCommand cmd = new SqlCommand("Insert into PriceplanrestrictionTbl(ProductversionId,TableId,NameofRest,TextofQueinSelection,Restingroup,Priceaddingroup,PortalId,FieldrestrictionSet,RestrictfieldId,RestGroupname)Values('" + ddlproduct.SelectedValue + "','" + ddltable.SelectedValue + "','" + txtnameofrest.Text + "','" + txttxtquestpps.Text + "','" + txtrestgroup.Text + "','" + txtaddprice.Text + "','" + ddlportal.SelectedValue + "','" + ddlfeildrest.SelectedItem.Text + "','" + txtfieldIdRest.Text + "','" + txtrestgroupname.Text + "')", con);

                    if (con.State.ToString() != "Open")
                    {
                        con.Open();
                    }
                    Int32 result = cmd.ExecuteNonQuery();


                    con.Close();
                    if (result > 0)
                    {
                        Label2.Text    = "";
                        lblmsg.Visible = true;
                        lblmsg.Text    = "Record inserted successfully.";
                        FillGrid();
                        txttxtquestpps.Text        = "";
                        txtnameofrest.Text         = "";
                        txtaddprice.Text           = "";
                        txtrestgroup.Text          = "";
                        ddltable.SelectedIndex     = 0;
                        ddlportal.SelectedValue    = "0";
                        ddlfeildrest.SelectedIndex = 0;
                        txtfieldIdRest.Text        = "";
                        txtrestgroupname.Text      = "";
                        addnewpanel.Visible        = true;
                        pnladdnew.Visible          = false;
                        ModernpopSync.Show();
                    }

                    else
                    {
                        lblmsg.Visible = true;
                        lblmsg.Text    = "Record not added.";
                    }
                }
                else
                {
                    lblmsg.Visible = true;
                    lblmsg.Text    = "Record is already existed.";
                }
            }
        }
        catch
        {
        }
    }
 protected void Button18_Click(object sender, EventArgs e)
 {
     ModernpopSync.Show();
 }