protected void Page_Load(object sender, EventArgs e)
    {
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();

        compid         = Session["Comid"].ToString();
        Page.Title     = pg.getPageTitle(page);
        Label1.Visible = false;

        PageConn pgcon = new PageConn();

        con = pgcon.dynconn;

        if (!IsPostBack)
        {
            txtFromDate.Text = System.DateTime.Now.ToShortDateString();
            txtToDate.Text   = System.DateTime.Now.ToShortDateString();

            TextBox3.Text = System.DateTime.Now.ToShortDateString();
            TextBox4.Text = System.DateTime.Now.ToShortDateString();

            ViewState["sortOrder"] = "";

            fillstore();

            fillfilterstore();

            RadioButtonList1_SelectedIndexChanged(sender, e);
            fillgriddata();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        PageConn pgcon = new PageConn();

        con = pgcon.dynconn;
        if (Session["Comid"] == null)
        {
            Response.Redirect("~/Shoppingcart/Admin/ShoppingCartLogin.aspx");
        }
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[]   separator   = new char[] { '/' };
        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();

        Page.Title = pg.getPageTitle(page);

        if (!IsPostBack)
        {
            ViewState["sortOrder"] = "";
            lblmsg.Text            = "";
            fillstore();
            ddlcategory.Items.Insert(0, "All");
            ddlcategory.Items[0].Value = "0";

            ddlSubCategory.Items.Insert(0, "All");
            ddlSubCategory.Items[0].Value = "0";

            ddlSubSubCategory.Items.Insert(0, "All");
            ddlSubSubCategory.Items[0].Value = "0";

            ddlwarehouse_SelectedIndexChanged(sender, e);
            ImageButton1_Click(sender, e);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        //PageConn pgcon = new PageConn();
        //con = pgcon.dynconn;
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();

        compid           = Session["Comid"].ToString();
        Page.Title       = pg.getPageTitle(page);
        Label1.Visible   = false;
        ViewState["Wid"] = Request.QueryString["wid"].ToString();
        if (!Page.IsPostBack)
        {
            string         warename = "select Name from WarehouseMaster where WarehouseId='" + ViewState["Wid"] + "'";
            SqlDataAdapter adp      = new SqlDataAdapter(warename, con);
            DataTable      dtp      = new DataTable();
            adp.Fill(dtp);
            if (dtp.Rows.Count > 0)
            {
                storename.Text = dtp.Rows[0]["Name"].ToString();
            }
            ViewState["sortOrder"] = "";
            fillcountry();
            //FillTax();

            fillgrid();

            //chkCharge_CheckedChanged(sender, e);
            lblCompany.Text = Session["Cname"].ToString();
        }
    }
Example #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["EmployeeId"] != null)
        {
            pagetitleclass pg      = new pagetitleclass();
            string         strData = Request.Url.ToString();

            char[] separator = new char[] { '/' };

            string[] strSplitArr = strData.Split(separator);
            int      i           = Convert.ToInt32(strSplitArr.Length);
            string   page        = strSplitArr[i - 1].ToString();
            Session["PageUrl"]  = strData;
            Session["PageName"] = page;
            Page.Title          = pg.getPageTitle(page);

            if (Session["CompanyName"] != null)
            {
                this.Title = Session["CompanyName"] + " IFileCabinet.com Company Wizard - Document Print View ";
            }

            Session["PageName"] = "ViewDocForPrint.aspx";

            if (!IsPostBack)
            {
                int Docid = Convert.ToInt32(Request.QueryString["id"]);
                //int DesignationId = Convert.ToInt32(Request.QueryString["Did"]);
                LoadPdf(Docid);
                //SetAccessRights(Docid, DesignationId);
                //imgbtnPrint.Attributes.Add("onclick", "window.print();return false;");
            }
        }
        else
        {
            Response.Redirect("~/Shoppingcart/admin/ShoppingcartLogin.aspx");
        }
    }
Example #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        PageConn pgcon = new PageConn();

        con = pgcon.dynconn;
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();

        Session["PageUrl"]  = strData;
        Session["PageName"] = page;
        Page.Title          = pg.getPageTitle(page);



        if (!IsPostBack)
        {
            ViewState["sortOrder"] = "";

            txtfrom.Text  = System.DateTime.Now.Month.ToString() + "/1/" + System.DateTime.Now.Year.ToString();
            txtto.Text    = System.DateTime.Now.ToShortDateString();
            DesignationId = Convert.ToInt32(Session["DesignationId"]);

            filldatebyperiod();
            fillstore();
            Fillddlemployee();
            filterbyparty();
            FillDocumentTypeAll();
            fillddllistofdocument();
            FillGrid();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Comid"] == null)
        {
            Response.Redirect("~/Shoppingcart/Admin/ShoppingCartLogin.aspx");
        }
        PageConn pgcon = new PageConn();

        con = pgcon.dynconn;
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };
        //compid = Session["comid"].ToString();
        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();


        Page.Title = pg.getPageTitle(page);

        lblmsg.Visible = false;
        if (!IsPostBack)
        {
            Pagecontrol.dypcontrol(Page, page);

            con = pgcon.dynconn;
            fillstore();

            fillgrid();
            filterstore();

            Fillddlbatchname();
            Filteremployee();
        }
    }
Example #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Comid"] == null)
        {
            Response.Redirect("~/Shoppingcart/Admin/ShoppingCartLogin.aspx");
        }

        Page.Form.Attributes.Add("enctype", "multipart/form-data");
        PageConn pgcon = new PageConn();

        con = pgcon.dynconn;
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();

        compid     = Session["comid"].ToString();
        Page.Title = pg.getPageTitle(page);

        if (!IsPostBack)
        {
            Pagecontrol.dypcontrol(Page, page);
            if (Session["Comid"] == null)
            {
                Response.Redirect("~/Shoppingcart/Admin/ShoppingCartLogin.aspx");
            }


            ViewState["sortOrder"] = "";
            fillgrid();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        //PageConn pgcon = new PageConn();
        //con = pgcon.dynconn;
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();


        Page.Title = pg.getPageTitle(page);
        if (!IsPostBack)
        {
            ViewState["sortOrder"] = "";
            Pagecontrol.dypcontrol(Page, page);

            Fillwarehouse();
            ddlfilterbus_SelectedIndexChanged(sender, e);
        }
    }
Example #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Comid"] == null)
        {
            Response.Redirect("~/Shoppingcart/Admin/ShoppingCartLogin.aspx");
        }
        PageConn pgcon = new PageConn();

        con = pgcon.dynconn;
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();

        ViewState["Compid"]   = Session["Comid"].ToString();
        ViewState["UserName"] = Session["userid"].ToString();
        Page.Title            = pg.getPageTitle(page);
        if (!IsPostBack)
        {
            Pagecontrol.dypcontrol(Page, page);
            ViewState["sortOrder"] = "";
            lblCompany.Text        = Session["Cname"].ToString();

            lblmsg.Text = "";

            loadupdate();


            fillgrid();
            ModalPopupExtender1222.Hide();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Comid"] == null)
        {
            Response.Redirect("~/Shoppingcart/Admin/ShoppingCartLogin.aspx");
        }
        //PageConn pgcon = new PageConn();
        //con = pgcon.dynconn;
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();


        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();


        Page.Title          = pg.getPageTitle(page);
        compid              = Session["Comid"].ToString();
        statuslable.Visible = false;
        if (!IsPostBack)
        {
            ViewState["sortOrder"] = "";

            Pagecontrol.dypcontrol(Page, page);
            fillwarehouse();
            ddlwarehouse_SelectedIndexChanged(sender, e);


            btnUpdate.Visible = false;

            //Button6.Visible = false;
        }
    }
Example #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Comid"] == null)
        {
            Response.Redirect("~/Shoppingcart/Admin/ShoppingCartLogin.aspx");
        }

        PageConn pgcon = new PageConn();

        con = pgcon.dynconn;
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[]   separator   = new char[] { '/' };
        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();

        compid     = Session["Comid"].ToString();
        Page.Title = pg.getPageTitle(page);

        if (!IsPostBack)
        {
            fillbusiness();
            fillusertype();
            filluser();
            fillgrid();

            addnewfillbusiness();
            addnewfillusertype();
            addnewfilluser();

            lblcomname.Text  = Session["Cname"].ToString();
            lblBusiness.Text = ddlbusinessname.SelectedItem.Text;
        }
    }
Example #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Comid"] == null)
        {
            Response.Redirect("~/Shoppingcart/Admin/ShoppingCartLogin.aspx");
        }
        PageConn pgcon = new PageConn();

        con = pgcon.dynconn;
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();


        Page.Title = pg.getPageTitle(page);
        if (!IsPostBack)
        {
            Pagecontrol.dypcontrol(Page, page);
            Fillwarehouse();
            //DropDownList3.Items.Insert(0, "-Select-");
            //DropDownList3.Items[0].Value = "0";
            ViewState["sortOrder"] = "";
            //fillemployee();

            fillbatch();
            fillstorebatch();
            gridfun();
            lblCompany.Text = Session["Cname"].ToString();
            ddlfilterstore_SelectedIndexChanged(sender, e);
        }
    }
Example #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Comid"] == null)
        {
            Response.Redirect("~/Shoppingcart/Admin/ShoppingCartLogin.aspx");
        }
        PageConn pgcon = new PageConn();

        con = pgcon.dynconn;
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();

        Page.Title = pg.getPageTitle(page);

        if (!IsPostBack)
        {
        }
    }
Example #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Comid"] == null)
        {
            Response.Redirect("~/Shoppingcart/Admin/ShoppingCartLogin.aspx");
        }


        PageConn pgcon = new PageConn();

        con = pgcon.dynconn;
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();

        Session["PageUrl"]  = strData;
        Session["PageName"] = page;
        Page.Title          = pg.getPageTitle(page);
        if (Session["CompanyName"] != null)
        {
            this.Title = Session["CompanyName"] + " IFileCabinet.com - Available Documents : Manager";
        }

        Session["PageName"] = "DocumentAvailableByMangr.aspx";
        if (Session["EmployeeId"] != null)
        {
            if (!IsPostBack)
            {
                Pagecontrol.dypcontrol(Page, page);

                ViewState["EmployeeId"] = Session["EmployeeId"];
                string str = "SELECT Distinct WareHouseId,Name  FROM WareHouseMaster inner join EmployeeWarehouseRights on EmployeeWarehouseRights.Whid=WareHouseMaster.WareHouseId where comid = '" + Session["comid"] + "'and WareHouseMaster.Status='" + 1 + "' and EmployeeWarehouseRights.AccessAllowed='True' order by name";

                SqlCommand cmd1 = new SqlCommand(str, con);
                cmd1.CommandType = CommandType.Text;
                SqlDataAdapter da = new SqlDataAdapter(cmd1);
                DataTable      dt = new DataTable();
                da.Fill(dt);

                ddlbusiness.DataSource     = dt;
                ddlbusiness.DataTextField  = "Name";
                ddlbusiness.DataValueField = "WareHouseId";
                ddlbusiness.DataBind();
                ViewState["sortOrder"] = "";
                string         eeed    = " Select distinct EmployeeMaster.Whid from  EmployeeMaster where EmployeeMasterId='" + Session["EmployeeId"] + "'";
                SqlCommand     cmdeeed = new SqlCommand(eeed, con);
                SqlDataAdapter adpeeed = new SqlDataAdapter(cmdeeed);
                DataTable      dteeed  = new DataTable();
                adpeeed.Fill(dteeed);
                if (dteeed.Rows.Count > 0)
                {
                    ddlbusiness.SelectedValue = Convert.ToString(dteeed.Rows[0]["Whid"]);
                }
                Fillddl_doc_appvd_by_deo();
                Fillddl_doc_appvd_by_sup();
                //  fillemp();
                SelectDocument();
            }
        }
        else
        {
            Response.Redirect("Shoppingcartlogin.aspx");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        PageConn pgcon = new PageConn();

        con = pgcon.dynconn;
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();

        Session["PageUrl"]  = strData;
        Session["PageName"] = page;
        Page.Title          = pg.getPageTitle(page);

        //  Session["PageName"] = "DocumentEditAndView.aspx";

        if (!IsPostBack)
        {
            //DataTable dt = new DataTable();
            //string doc = "Select DocumentMainType.Whid FROM DocumentMainType INNER JOIN DocumentSubType ON DocumentMainType.DocumentMainTypeId = DocumentSubType.DocumentMainTypeId INNER JOIN DocumentType ON DocumentSubType.DocumentSubTypeId = DocumentType.DocumentSubTypeId inner join DocumentMaster on DocumentMaster.DocumentTypeId=DocumentType.DocumentTypeId where DocumentMainType.CID='" + Session["Comid"] + "' and DocumentMaster.DocumentId='" + ViewState["docid"] + "'";
            //SqlDataAdapter adp = new SqlDataAdapter(doc, con);
            //adp.Fill(dt);
            //if (dt.Rows.Count > 0)
            //{
            //    ViewState["Whid"] = Convert.ToString(dt.Rows[0]["Whid"]);
            //}
            string strf = "SELECT WareHouseId,Name,Address,CurrencyId  FROM WareHouseMaster where comid = '" + Session["comid"] + "'and WareHouseMaster.Status='" + 1 + "' order by name";

            SqlCommand cmd1 = new SqlCommand(strf, con);
            cmd1.CommandType = CommandType.Text;
            SqlDataAdapter daf = new SqlDataAdapter(cmd1);
            DataTable      dtf = new DataTable();
            daf.Fill(dtf);

            ddlbusiness.DataSource     = dtf;
            ddlbusiness.DataTextField  = "Name";
            ddlbusiness.DataValueField = "WareHouseId";
            ddlbusiness.DataBind();
            //ddlbusiness.SelectedIndex = ddlbusiness.Items.IndexOf(ddlbusiness.Items.FindByValue(ViewState["Whid"].ToString()));
            string         eeed    = " Select distinct EmployeeMaster.Whid from  EmployeeMaster where EmployeeMasterId='" + Session["EmployeeId"] + "'";
            SqlCommand     cmdeeed = new SqlCommand(eeed, con);
            SqlDataAdapter adpeeed = new SqlDataAdapter(cmdeeed);
            DataTable      dteeed  = new DataTable();
            adpeeed.Fill(dteeed);
            if (dteeed.Rows.Count > 0)
            {
                ddlbusiness.SelectedValue = Convert.ToString(dteeed.Rows[0]["Whid"]);
            }


            ddlbusiness_SelectedIndexChanged(sender, e);


            //LoadPdf(Docid);

            // FillDocumentMainType();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        PageConn pgcon = new PageConn();

        con     = pgcon.dynconn;
        strconn = pgcon.dynconn.ConnectionString;
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();

        if (!IsPostBack)
        {
            ViewState["sortOrder"] = "";

            if (Request.QueryString["id"] != null)
            {
                int id = Convert.ToInt32(Request.QueryString["id"]);

                SqlDataAdapter da1 = new SqlDataAdapter("select User_Master.UserID, CustomerServiceCallMaster.CustomerServiceCallMasterId,CustomerServiceCallMaster.ServiceStatusId,Party_master.PartyID,CustomerServiceCallMaster.Entrydate,cast(CustomerServiceCallMaster.CustomerServiceCallMasterId as nvarchar)+' : '+User_Master.Name as Pname,party_master.Whid from CustomerServiceCallMaster inner join user_master on CustomerServiceCallMaster.[CustomerId]=user_master.[UserID] inner join party_master on [User_master].[PartyID]=party_master.[PartyID] where CustomerServiceCallMaster.CustomerServiceCallMasterId='" + Request.QueryString["id"] + "' ", con);
                DataTable      dt  = new DataTable();
                da1.Fill(dt);

                if (dt.Rows.Count > 0)
                {
                    fillstore();
                    ddlWarehouse.SelectedIndex = ddlWarehouse.Items.IndexOf(ddlWarehouse.Items.FindByValue(dt.Rows[0]["Whid"].ToString()));
                    fillfilterparty();
                    ddlpartynamefilter.SelectedIndex = ddlpartynamefilter.Items.IndexOf(ddlpartynamefilter.Items.FindByValue(dt.Rows[0]["UserID"].ToString()));

                    txtFromDate.Text = Convert.ToDateTime(dt.Rows[0]["Entrydate"].ToString()).ToShortDateString();
                    txtTodate.Text   = Convert.ToDateTime(dt.Rows[0]["Entrydate"].ToString()).ToShortDateString();

                    FillMainStatus();

                    ddlMainStatus.SelectedIndex = ddlMainStatus.Items.IndexOf(ddlMainStatus.Items.FindByValue(dt.Rows[0]["ServiceStatusId"].ToString()));

                    fillparty();
                    ddlpartytype.SelectedIndex = ddlpartytype.Items.IndexOf(ddlpartytype.Items.FindByValue(dt.Rows[0]["CustomerServiceCallMasterId"].ToString()));
                    ddlpartytype_SelectedIndexChanged(sender, e);
                    fillgrid();
                    fillfilterstore();
                    filluser();
                }
            }
            else
            {
                txtFromDate.Text = System.DateTime.Now.ToShortDateString();
                txtTodate.Text   = System.DateTime.Now.ToShortDateString();

                fillstore();
                fillfilterparty();
                FillMainStatus();
                fillparty();

                ddlpartytype_SelectedIndexChanged(sender, e);
                fillgrid();
                fillfilterstore();
                filluser();
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Comid"] == null)
        {
            Response.Redirect("~/Shoppingcart/Admin/ShoppingCartLogin.aspx");
        }

        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();

        Session["PageUrl"]  = strData;
        Session["PageName"] = page;
        Page.Title          = pg.getPageTitle(page);
        if (Session["EmployeeId"] != null)
        {
            if (!IsPostBack)
            {
                Pagecontrol.dypcontrol(Page, page);
                DataTable desgdept = new DataTable();
                string    str      = "SELECT Distinct FolderID,FolderName  FROM DocumentFolderMaster where EmployeeId = '" + Session["EmployeeId"] + "'  order by FolderName";

                SqlCommand cmd1 = new SqlCommand(str, con);
                cmd1.CommandType = CommandType.Text;
                SqlDataAdapter da = new SqlDataAdapter(cmd1);
                DataTable      dt = new DataTable();
                da.Fill(dt);
                if (dt.Rows.Count > 0)
                {
                    ddlfolder.DataSource     = dt;
                    ddlfolder.DataTextField  = "FolderName";
                    ddlfolder.DataValueField = "FolderID";
                    ddlfolder.DataBind();
                    ddlfolder.Items.Insert(0, "All");
                    ddlfolder.Items[0].Value = "0";
                }
                if (Request.QueryString["Sid"] != null)
                {
                    int FolderId = Convert.ToInt32(Request.QueryString["Sid"]);
                    ViewState["FolderId"] = FolderId.ToString();

                    ddlfolder.SelectedIndex = ddlfolder.Items.IndexOf(ddlfolder.Items.FindByValue(ViewState["FolderId"].ToString()));


                    fillDatalistwithfolder(Convert.ToInt32(ddlfolder.SelectedValue));
                }
                else if (Request.QueryString["id"] != null)
                {
                    int DocumentId = Convert.ToInt32(Request.QueryString["id"]);
                    ViewState["docid"] = DocumentId.ToString();
                    fillDatalist(DocumentId);
                }
                else
                {
                    ddlfolder_SelectedIndexChanged(sender, e);
                }
            }
        }
        else
        {
            Response.Redirect("~/Shoppingcart/Admin/Soppingcartlogin.aspx");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Comid"] == null)
        {
            Response.Redirect("~/Shoppingcart/Admin/ShoppingCartLogin.aspx");
        }
        PageConn pgcon = new PageConn();

        con = pgcon.dynconn;
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();


        Page.Title = pg.getPageTitle(page);


        Label1.Visible = false;
        if (!IsPostBack)
        {
            Pagecontrol.dypcontrol(Page, page);
            ViewState["sortOrder"] = "";
            TextEntryDate.Text     = System.DateTime.Now.ToShortDateString();
            lblCompany.Text        = Session["Cname"].ToString();

            ddlWebsiteName.Enabled  = true;
            ddlEmailType.Enabled    = true;
            txtEmailContent.Enabled = true;
            TextEntryDate.Enabled   = true;
            ImageButton1.Enabled    = true;
            imgaddcatt.Visible      = true;
            imgcattrefresh.Visible  = true;

            if (Request.QueryString["Id"] != null)
            {
                int id = Convert.ToInt32(Request.QueryString["Id"]);

                SqlDataAdapter da = new SqlDataAdapter("SELECT * from EmailTypeMaster where EmailTypeId='" + id + "'", con);
                DataTable      dt = new DataTable();
                da.Fill(dt);
                if (dt.Rows.Count > 0)
                {
                    FillddlSitename();

                    ddlWebsiteName.SelectedIndex = ddlWebsiteName.Items.IndexOf(ddlWebsiteName.Items.FindByValue(dt.Rows[0]["Whid"].ToString()));

                    FillddlEmailType();
                    ddlEmailType.SelectedIndex = ddlEmailType.Items.IndexOf(ddlEmailType.Items.FindByValue(dt.Rows[0]["EmailTypeId"].ToString()));



                    filterstore();
                    filterbyemailtype();

                    FillGrid();

                    addemail.Visible    = true;
                    btnadd.Visible      = false;
                    Label1.Visible      = false;
                    contntlabel.Visible = true;
                    contntlabel.Text    = "Draft Pre-Formatted Email";
                }
            }
            else if (Request.QueryString["ViewManageId"] != null)
            {
                int viewmanageid = Convert.ToInt32(Request.QueryString["ViewManageId"]);


                SqlDataAdapter da = new SqlDataAdapter("SELECT * from EmailContentMaster where EmailTypeId='" + viewmanageid + "'", con);
                DataTable      dt = new DataTable();
                da.Fill(dt);

                if (dt.Rows.Count > 0)
                {
                    FillddlSitename();

                    ddlWebsiteName.SelectedIndex = ddlWebsiteName.Items.IndexOf(ddlWebsiteName.Items.FindByValue(dt.Rows[0]["CompanyWebsiteMasterId"].ToString()));

                    ViewState["Id"] = dt.Rows[0]["EmailContentMasterId"].ToString();

                    FillddlEmailType();

                    ddlEmailType.SelectedIndex = ddlEmailType.Items.IndexOf(ddlEmailType.Items.FindByValue(dt.Rows[0]["EmailTypeId"].ToString()));

                    txtEmailContent.Text = dt.Rows[0]["EmailContent"].ToString();

                    TextEntryDate.Text = Convert.ToDateTime(dt.Rows[0]["EntryDate"].ToString()).ToShortDateString();

                    btnadd.Visible          = false;
                    addemail.Visible        = true;
                    btnupdate.Visible       = true;
                    contntlabel.Visible     = true;
                    contntlabel.Text        = "Edit Pre-Formatted Email";
                    btnsubmit.Visible       = false;
                    txtEmailContent.Enabled = true;
                    TextEntryDate.Enabled   = true;
                    ddlEmailType.Enabled    = true;
                    ddlWebsiteName.Enabled  = true;

                    filterstore();
                    filterbyemailtype();

                    FillGrid();
                }
                else
                {
                    SqlDataAdapter da123 = new SqlDataAdapter("SELECT * from EmailTypeMaster where EmailTypeId='" + viewmanageid + "'", con);
                    DataTable      dt123 = new DataTable();
                    da123.Fill(dt123);
                    if (dt123.Rows.Count > 0)
                    {
                        FillddlSitename();

                        ddlWebsiteName.SelectedIndex = ddlWebsiteName.Items.IndexOf(ddlWebsiteName.Items.FindByValue(dt123.Rows[0]["Whid"].ToString()));

                        FillddlEmailType();
                        ddlEmailType.SelectedIndex = ddlEmailType.Items.IndexOf(ddlEmailType.Items.FindByValue(dt123.Rows[0]["EmailTypeId"].ToString()));



                        filterstore();
                        filterbyemailtype();

                        FillGrid();

                        addemail.Visible    = true;
                        btnadd.Visible      = false;
                        Label1.Visible      = false;
                        contntlabel.Visible = true;
                        contntlabel.Text    = "Draft Pre-Formatted Email";
                    }
                }
            }

            else
            {
                FillddlSitename();
                FillddlEmailType();
                filterstore();
                filterbyemailtype();

                FillGrid();
            }
        }
    }
Example #19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Comid"] == null)
        {
            Response.Redirect("~/Shoppingcart/Admin/ShoppingCartLogin.aspx");
        }

        PageConn pgcon = new PageConn();

        con = pgcon.dynconn;
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();

        Session["PageUrl"]  = strData;
        Session["PageName"] = page;
        Page.Title          = pg.getPageTitle(page);


        if (!IsPostBack)
        {
            Pagecontrol.dypcontrol(Page, page);
            ViewState["sortOrder"] = "";
            lblcomid.Text          = Session["Cname"].ToString();
            flaganddoc();
            //lblcomname.Text = "All";
            string str = "SELECT WareHouseId,Name,Address,CurrencyId  FROM WareHouseMaster where comid = '" + Session["comid"] + "'and WareHouseMaster.Status='" + 1 + "' order by name";

            SqlCommand cmd1 = new SqlCommand(str, con);
            cmd1.CommandType = CommandType.Text;
            SqlDataAdapter da = new SqlDataAdapter(cmd1);
            DataTable      dt = new DataTable();
            da.Fill(dt);
            if (dt.Rows.Count > 0)
            {
                ddlbusiness.DataSource     = dt;
                ddlbusiness.DataTextField  = "Name";
                ddlbusiness.DataValueField = "WareHouseId";
                ddlbusiness.DataBind();
                ddlstore.DataSource = dt;


                ddlstore.DataTextField  = "Name";
                ddlstore.DataValueField = "WareHouseId";
                ddlstore.DataBind();
                ddlstore.Items.Insert(0, "All");
                ddlstore.Items[0].Value = "0";
                string         eeed    = " Select distinct EmployeeMaster.Whid from  EmployeeMaster where EmployeeMasterId='" + Session["EmployeeId"] + "'";
                SqlCommand     cmdeeed = new SqlCommand(eeed, con);
                SqlDataAdapter adpeeed = new SqlDataAdapter(cmdeeed);
                DataTable      dteeed  = new DataTable();
                adpeeed.Fill(dteeed);
                if (dteeed.Rows.Count > 0)
                {
                    ddlbusiness.SelectedValue = Convert.ToString(dteeed.Rows[0]["Whid"]);
                }
            }
            RadioButtonList1_SelectedIndexChanged(sender, e);
            FillDocumentTypeAll();
            FillParty();
            FillGrid();
        }
    }
Example #20
0
    // SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["OnlineAccountConnectionString"].ConnectionString);

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Comid"] == null)
        {
            Response.Redirect("~/Shoppingcart/Admin/ShoppingCartLogin.aspx");
        }
        pagetitleclass pg = new pagetitleclass();


        string strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };
        compid = Session["Comid"].ToString();
        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();


        Page.Title = pg.getPageTitle(page);

        PageConn pgcon = new PageConn();

        conn = pgcon.dynconn;
        if (!Page.IsPostBack)
        {
            Pagecontrol.dypcontrol(Page, page);
            ViewState["sortOrder"] = "";
            lblCompany.Text        = Session["Cname"].ToString();
            lblBusiness.Text       = "All";

            //string str = "select WareHouseId,Name from WareHouseMaster WHERE comid='" + Session["Comid"].ToString() + "' and [WareHouseMaster].Status='1' order by Name";
            //SqlCommand cmd = new SqlCommand(str, conn);
            //SqlDataAdapter adp = new SqlDataAdapter(cmd);
            //DataSet ds = new DataSet();
            //adp.Fill(ds);
            //ddlstorename.DataSource = ds;
            //ddlstorename.DataTextField = "Name";
            //ddlstorename.DataValueField = "WareHouseId";
            //ddlstorename.DataBind();


            //DropDownList3.DataSource = ds;
            //DropDownList3.DataTextField = "Name";
            //DropDownList3.DataValueField = "WareHouseId";
            //DropDownList3.DataBind();
            //DropDownList3.Items.Insert(0, "ALL");

            fillstore();

            lblCompany.Text = Session["Cname"].ToString();

            Fillddlbatch();
            Fillddltime();
            Fillgridbatchtiming();
            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                SqlDataAdapter adpt = new SqlDataAdapter("select BatchMaster.ID,BatchMaster.WHID,WareHouseMaster.WareHouseId from BatchMaster inner join WareHouseMaster on BatchMaster.WHID = WareHouseMaster.WareHouseId where BatchMaster.ID ='" + Request.QueryString["id"] + "'", conn);
                DataTable      dt   = new DataTable();
                adpt.Fill(dt);
                if (dt.Rows.Count > 0)
                {
                    ddlstorename.SelectedIndex = ddlstorename.Items.IndexOf(ddlstorename.Items.FindByValue(dt.Rows[0]["WareHouseId"].ToString()));
                    Fillddlbatch();
                    ddlbatchmaster.SelectedIndex = ddlbatchmaster.Items.IndexOf(ddlbatchmaster.Items.FindByValue(dt.Rows[0]["ID"].ToString()));
                    Fillddltime();

                    Label1.Text    = "";
                    lblmsg.Text    = "";
                    pnladd.Visible = true;
                    lbladd.Text    = "Add New Batch Time";
                    btnadd.Visible = false;
                }
            }
            //ddlstorename.Items.Insert(0, "--Select--");
            ImageButton49.Visible = false;
            ImageButton48.Visible = true;
            lblmsg.Text           = "";
            // txteffectstart.Text = Convert.ToString(System.DateTime.Now);
            // txteffectend.Text = Convert.ToString(System.DateTime.Now.AddYears(5));
        }
    }
Example #21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        PageConn pgcon = new PageConn();

        con  = pgcon.dynconn;
        con1 = PageConn.licenseconn();
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();

        Session["PageUrl"]  = strData;
        Session["PageName"] = page;
        Page.Title          = pg.getPageTitle(page);

        double mul = 1073741824;

        //double plansize = Convert.ToDouble(Session["Size"].ToString());
        double plansize    = 1;
        double sizeinbytes = mul * plansize;

        //string eeed = " Select distinct EmployeeMaster.EmployeeMasterID from EmployeeMaster inner join Party_master on Party_master.PartyID=EmployeeMaster.PartyID inner join User_master on User_master.PartyID=Party_master.PartyID where User_master.UserID='" + Session["userid"] + "'";
        //SqlCommand cmdeeed = new SqlCommand(eeed, con);
        //SqlDataAdapter adpeeed = new SqlDataAdapter(cmdeeed);
        //DataTable dteeed = new DataTable();
        //adpeeed.Fill(dteeed);
        //if (dteeed.Rows.Count > 0)
        //{
        //    Session["EmployeeId"] = Convert.ToString(dteeed.Rows[0]["EmployeeMasterID"]);
        //}

        if (Session["CompanyName"] != null)
        {
            this.Title = Session["CompanyName"] + " IFileCabinet.com - Document Upload";
        }
        Session["PageName"] = "DocumentUpload.aspx";
        //  pnlmsg.Visible = false;
        lblmsg.Visible = false;
        if (!IsPostBack)
        {
            TxtDocDate.Text = System.DateTime.Now.ToShortDateString();
            //FillDocumentMainType();
            string str = "SELECT Distinct WareHouseId,Name  FROM WareHouseMaster inner join EmployeeWarehouseRights on EmployeeWarehouseRights.Whid=WareHouseMaster.WareHouseId where comid = '" + Session["comid"] + "'and WareHouseMaster.Status='" + 1 + "' and EmployeeWarehouseRights.AccessAllowed='True' order by name";

            SqlCommand cmd1 = new SqlCommand(str, con);
            cmd1.CommandType = CommandType.Text;
            SqlDataAdapter da = new SqlDataAdapter(cmd1);
            DataTable      dt = new DataTable();
            da.Fill(dt);

            ddlbusiness.DataSource     = dt;
            ddlbusiness.DataTextField  = "Name";
            ddlbusiness.DataValueField = "WareHouseId";
            ddlbusiness.DataBind();
            string         eeed    = " Select distinct EmployeeMaster.Whid from  EmployeeMaster where EmployeeMasterId='" + Session["EmployeeId"] + "'";
            SqlCommand     cmdeeed = new SqlCommand(eeed, con);
            SqlDataAdapter adpeeed = new SqlDataAdapter(cmdeeed);
            DataTable      dteeed  = new DataTable();
            adpeeed.Fill(dteeed);
            if (dteeed.Rows.Count > 0)
            {
                ddlbusiness.SelectedValue = Convert.ToString(dteeed.Rows[0]["Whid"]);
            }
            ddlbusiness_SelectedIndexChanged(sender, e);
            hdbDId.Value     = "0";
            hdbDMId.Value    = "0";
            hdbDSId.Value    = "0";
            hdbPartyId.Value = "0";
            //hdnSIZEofFOLDER.Value = "0";
            // imgbtnupload.Attributes.Add("OnClick", "Validate();");


            str = Server.MapPath("~\\Account\\" + Session["comid"] + "\\UploadedDocuments");
            GetFolderSize(str, false);


            //string[] ag = new string[0];
            //Main(ag);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        PageConn pgcon = new PageConn();

        con = pgcon.dynconn;
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();

        Page.Title = pg.getPageTitle(page);
        if (!IsPostBack)
        {
            ware();
            DataTable dtda = (DataTable)select("select Distinct Report_period_confirm.Id as conid, ReportPeriod.Report_Period_Id,Convert(nvarchar,StartDate,101) as StartDate, Convert(nvarchar,EndDate,101) as EndDate from [ReportPeriod] left join Report_period_confirm on Report_period_confirm.Report_Period_Id=ReportPeriod.Report_Period_Id where Compid = '" + Session["comid"] + "' and Whid='" + ddlbus.SelectedValue + "' and Active='1' ");
            lblfysdate.Text = Convert.ToString(dtda.Rows[0]["StartDate"]);
            lblfyedate.Text = Convert.ToString(dtda.Rows[0]["EndDate"]);

            if (dtda.Rows.Count > 0)
            {
                string fday   = Convert.ToDateTime(dtda.Rows[0]["StartDate"]).Day.ToString();
                string fmonth = Convert.ToDateTime(dtda.Rows[0]["StartDate"]).Month.ToString();
                string fyear  = Convert.ToDateTime(dtda.Rows[0]["StartDate"]).Year.ToString();
                for (int k = 1; k <= 31; k++)
                {
                    ddlacday.Items.Insert(k - 1, k.ToString());
                }
                int index = 0;
                ddlacday.SelectedIndex = ddlacday.Items.IndexOf(ddlacday.Items.FindByText(fday));
                ddlacday_SelectedIndexChanged(sender, e);
                ddlacmonth.SelectedIndex = ddlacmonth.Items.IndexOf(ddlacmonth.Items.FindByText(fmonth));
                for (int k = 1; k <= 50; k++)
                {
                    int cye = (DateTime.Now.Year) + 50;
                    ddlacyear.Items.Insert(index, (cye - k).ToString());
                }
                for (int k = 1; k <= 15; k++)
                {
                    int cye = DateTime.Now.Year - 15;
                    ddlacyear.Items.Insert(index, (DateTime.Now.Year - k).ToString());
                }

                ddlacyear.SelectedIndex = ddlacyear.Items.IndexOf(ddlacyear.Items.FindByText(fyear));
                if (Convert.ToString(dtda.Rows[0]["conid"]) == "")
                {
                    lblyearcacc.Text = "Select your first accounting year for your business";
                    pnlaccy.Visible  = true;
                    //lblyearcacc.Text = "Select your First Accounting year for your business";
                    lblopenaccy.Visible = false;
                    contr(true);
                    Panel1.Visible  = true;
                    btnconf.Visible = true;
                    Label9.Visible  = false;
                    Label10.Visible = false;
                    AHREF.Visible   = false;
                }
                else
                {
                    //ddlacmonth.SelectedIndex = ddlacmonth.Items.IndexOf(ddlacmonth.Items.FindByText(DateTime.Now.Year.ToString()));
                    contr(false);
                    pnlaccy.Visible = true;
                    //      lblyearcacc.Text = "Accounting year for your business ";
                    //      lblopenaccy.Text = Convert.ToString(dtda.Rows[0]["StartDate"]) + "-" + Convert.ToString(dtda.Rows[0]["EndDate"]);
                    lblopenaccy.Visible = true;
                    Panel1.Visible      = false;
                    btnconf.Visible     = false;
                    Label9.Visible      = true;
                    Label10.Visible     = true;
                    AHREF.Visible       = true;
                    AHREF.HRef          = "AccountYearchange.aspx?Wid=" + ddlbus.SelectedValue + "";

                    //lblopenaccy.NavigateUrl = "~/ShoppingCart/Admin/AccountYearChange.aspx?Whid=" + ddlbus.SelectedValue + "";
                }
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        PageConn pgcon = new PageConn();

        con = pgcon.dynconn;
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();

        Session["PageUrl"]  = strData;
        Session["PageName"] = page;
        Page.Title          = pg.getPageTitle(page);

        if (Session["CompanyName"] != null)
        {
            this.Title = Session["CompanyName"] + " IFileCabinet.com Document Department - Document Approve by Employee";
        }

        Session["PageName"] = "DocumentViewApproveByEmpDetail.aspx";


        if (!IsPostBack)
        {
            ViewState["sortOrder"] = "";

            txtfrom.Text = System.DateTime.Now.Month.ToString() + "/1/" + System.DateTime.Now.Year.ToString();
            txtto.Text   = System.DateTime.Now.ToShortDateString();
            string str = "SELECT Distinct WareHouseId,Name  FROM WareHouseMaster inner join EmployeeWarehouseRights on EmployeeWarehouseRights.Whid=WareHouseMaster.WareHouseId where comid = '" + Session["comid"] + "'and WareHouseMaster.Status='" + 1 + "' and EmployeeWarehouseRights.AccessAllowed='True' order by name";

            SqlCommand cmd1 = new SqlCommand(str, con);
            cmd1.CommandType = CommandType.Text;
            SqlDataAdapter da = new SqlDataAdapter(cmd1);
            DataTable      dt = new DataTable();
            da.Fill(dt);

            ddlbusiness.DataSource     = dt;
            ddlbusiness.DataTextField  = "Name";
            ddlbusiness.DataValueField = "WareHouseId";
            ddlbusiness.DataBind();
            string         eeed    = " Select distinct EmployeeMaster.Whid from  EmployeeMaster where EmployeeMasterId='" + Session["EmployeeId"] + "'";
            SqlCommand     cmdeeed = new SqlCommand(eeed, con);
            SqlDataAdapter adpeeed = new SqlDataAdapter(cmdeeed);
            DataTable      dteeed  = new DataTable();
            adpeeed.Fill(dteeed);
            if (dteeed.Rows.Count > 0)
            {
                ddlbusiness.SelectedValue = Convert.ToString(dteeed.Rows[0]["Whid"]);
            }
            ddlbusiness_SelectedIndexChanged(sender, e);

            clear();
            DesignationId = Convert.ToInt32(Session["DesignationId"]);

            griddocviewapprvbyemp.Visible = false;
        }
    }
Example #24
0
    protected void Page_Load(object sender, EventArgs e)
    {
        PageConn pgcon = new PageConn();

        con = pgcon.dynconn;
        if (Session["Comid"] == null)
        {
            Response.Redirect("~/Shoppingcart/Admin/ShoppingCartLogin.aspx");
        }
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();


        Page.Title = pg.getPageTitle(page);
        if (!IsPostBack)
        {
            txtqtyondatestarted.Text = System.DateTime.Now.ToShortDateString();

            ddllbs.DataSource     = uinittype();
            ddllbs.DataTextField  = "Name";
            ddllbs.DataValueField = "UnitTypeId";
            ddllbs.DataBind();



            ddlinventorysubsubid.DataSource     = getall();
            ddlinventorysubsubid.DataTextField  = "Category";
            ddlinventorysubsubid.DataValueField = "InventorySubSubId";
            ddlinventorysubsubid.DataBind();


            ViewState["inventoryWHid"] = Convert.ToInt32(Request.QueryString["InventoryWarehouseMasterId"].ToString());
            lblInvId.Text = ViewState["inventoryWHid"].ToString(); //= Convert.ToInt32(Request.QueryString["id"].ToString());



            string str = "select  InventoryMaster.Name,InventoryMaster.MasterActiveStatus, InventoryMaster.ProductNo, InventoryMaster.InventoryMasterId, InventoryMaster.InventorySubSubId, InventoryMaster.InventoryDetailsId, " +
                         " InventoryBarcodeMaster.Barcode ,InventoryDetails.Description, InventoryDetails.Weight,InventoryDetails.DateStarted, InventoryDetails.Inventory_Details_Id,UnitTypeMaster.Name as Name1,UnitTypeMaster.UnitTypeId  " +
                         " FROM     InventoryMaster INNER JOIN    InventoryBarcodeMaster ON InventoryBarcodeMaster.InventoryMaster_id=InventoryMaster.InventoryMasterId    INNER JOIN  InventoryDetails on  InventoryDetails.Inventory_Details_Id=InventoryMaster.InventoryDetailsId    INNER JOIN UnitTypeMaster ON  UnitTypeMaster.UnitTypeId=InventoryDetails.UnitTypeId   where  InventoryMaster.InventoryMasterId= " + lblInvId.Text + " ";

            SqlCommand     cmd = new SqlCommand(str, con);
            SqlDataAdapter adp = new SqlDataAdapter(cmd);
            DataSet        ds  = new DataSet();
            adp.Fill(ds);
            if (ds.Tables[0].Rows.Count > 0)
            {
                lblINvName.Text   = ds.Tables[0].Rows[0]["Name"].ToString();
                txtname.Text      = ds.Tables[0].Rows[0]["Name"].ToString();
                txtproductno.Text = ds.Tables[0].Rows[0]["ProductNo"].ToString();
                ddlinventorysubsubid.SelectedIndex = ddlinventorysubsubid.Items.IndexOf(ddlinventorysubsubid.Items.FindByValue(ds.Tables[0].Rows[0]["InventorySubSubId"].ToString()));
                txtBarcode.Text      = ds.Tables[0].Rows[0]["Barcode"].ToString();
                txtWeight.Text       = ds.Tables[0].Rows[0]["Weight"].ToString();
                ddllbs.SelectedIndex = ddllbs.Items.IndexOf(ddllbs.Items.FindByValue(ds.Tables[0].Rows[0]["UnitTypeId"].ToString()));
                // ddllbs.SelectedIndex = ddllbs.Items.IndexOf(ddllbs.Items.FindByValue(ds.Tables[0].Rows[0]["UnitType"].ToString()));

                txtdescription.Text = ds.Tables[0].Rows[0]["Description"].ToString();

                chkActive.Checked = Convert.ToBoolean(ds.Tables[0].Rows[0]["MasterActiveStatus"].ToString());
                if (Convert.ToBoolean(ds.Tables[0].Rows[0]["MasterActiveStatus"].ToString()) == true)
                {
                    ddlstatus.SelectedValue = "1";
                }
                else
                {
                    ddlstatus.SelectedValue = "0";
                }
                // txtqtyondatestarted.Text = ds.Tables[0].Rows[0]["DateStarted"].ToString();
                ViewState["detailid"] = ds.Tables[0].Rows[0]["InventoryDetailsId"].ToString();
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        PageConn pgcon = new PageConn();

        con = pgcon.dynconn;
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();

        Session["PageUrl"]  = strData;
        Session["PageName"] = page;
        Page.Title          = pg.getPageTitle(page);
        if (Session["CompanyName"] != null)
        {
            this.Title = Session["CompanyName"] + " IFileCabinet.com - Edit Document";
        }

        Session["PageName"] = "DocumentEditAndView.aspx";

        if (!IsPostBack)
        {
            ViewState["dtrws"] = "1";
            int Docid = Convert.ToInt32(Request.QueryString["id"]);
            hdnDocId.Value = Request.QueryString["id"];
            // int Docid = 145;
            // int DesignationId = Convert.ToInt32(Request.QueryString["Did"]);
            ViewState["docid"] = Docid.ToString();
            flaganddoc();
            if (Convert.ToString(ViewState["docid"]) != "")
            {
                DataTable      dt  = new DataTable();
                string         doc = "Select DocumentMainType.Whid FROM DocumentMainType INNER JOIN DocumentSubType ON DocumentMainType.DocumentMainTypeId = DocumentSubType.DocumentMainTypeId INNER JOIN DocumentType ON DocumentSubType.DocumentSubTypeId = DocumentType.DocumentSubTypeId inner join DocumentMaster on DocumentMaster.DocumentTypeId=DocumentType.DocumentTypeId where DocumentMainType.CID='" + Session["Comid"] + "' and DocumentMaster.DocumentId='" + ViewState["docid"] + "'";
                SqlDataAdapter adp = new SqlDataAdapter(doc, con);
                adp.Fill(dt);
                if (dt.Rows.Count > 0)
                {
                    ViewState["Whid"] = Convert.ToString(dt.Rows[0]["Whid"]);
                }
                string strf = "SELECT WareHouseId,Name,Address,CurrencyId  FROM WareHouseMaster where comid = '" + Session["comid"] + "'and WareHouseMaster.Status='" + 1 + "' order by name";

                SqlCommand cmd1 = new SqlCommand(strf, con);
                cmd1.CommandType = CommandType.Text;
                SqlDataAdapter daf = new SqlDataAdapter(cmd1);
                DataTable      dtf = new DataTable();
                daf.Fill(dtf);

                ddlbusiness.DataSource     = dtf;
                ddlbusiness.DataTextField  = "Name";
                ddlbusiness.DataValueField = "WareHouseId";
                ddlbusiness.DataBind();
                if (Convert.ToString(ViewState["Whid"]) != "")
                {
                    ddlbusiness.SelectedIndex = ddlbusiness.Items.IndexOf(ddlbusiness.Items.FindByValue(ViewState["Whid"].ToString()));
                }
                ddlbusiness_SelectedIndexChanged(sender, e);


                LoadPdf(Docid);
                FillDocumentTypeAll();
                // FillDocumentMainType();
                FillParty();
                FillDocDetail(sender, e);
                //txtDate.Text = System.DateTime.Now.ToShortDateString();
            }
        }

        DocumentName  = ViewState["docname"].ToString();
        DocumentID    = Convert.ToInt32(ViewState["docId"]);
        DesignationId = Convert.ToInt32(Session["DesignationId"]);


        pnlmsg.Visible = false;
    }
Example #26
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Comid"] == null)
        {
            Response.Redirect("~/ShoppingCart/Admin/ShoppingCartLogin.aspx");
        }
        //PageConn pgcon = new PageConn();
        //con = pgcon.dynconn;
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        compid = Session["Comid"].ToString();
        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();


        Page.Title     = pg.getPageTitle(page);
        lblmsg.Text    = "";
        lblmsg.Visible = false;
        if (!IsPostBack)
        {
            Pagecontrol.dypcontrol(Page, page);
            //fillddlclass();
            if (txtdateto.Text.Length <= 0)
            {
                txtdateto.Text = DateTime.Now.ToShortDateString();
            }
            if (txtdatefrom.Text.Length <= 0)
            {
                txtdatefrom.Text = DateTime.Now.ToShortDateString();
            }
            ViewState["sortOrder"] = "";
            fillstore();
            lblcompname.Text = Session["Cname"].ToString();

            if (Request.QueryString["Gd"] != null && Request.QueryString["Wh"] != null)
            {
                Panel1.Visible = true;

                ddlSearchByStore.SelectedValue = Request.QueryString["Wh"];
                ddlSearchByStore_SelectedIndexChanged(sender, e);
                txtdatefrom.Text = Session["ddf"].ToString();
                txtdateto.Text   = Session["dde"].ToString();

                DataTable drt = select("select [ClassCompanyMaster].[id],[GroupCompanyMaster].[id] as gid from [GroupCompanyMaster] inner join [ClassCompanyMaster] on [ClassCompanyMaster].id = [GroupCompanyMaster].classcompanymasterid  where [GroupCompanyMaster].GroupId = '" + Request.QueryString["Gd"] + "' and [GroupCompanyMaster].Whid='" + ddlSearchByStore.SelectedValue + "'  ");

                if (drt.Rows.Count > 0)
                {
                    ddlclass.SelectedIndex = ddlclass.Items.IndexOf(ddlclass.Items.FindByValue(drt.Rows[0]["id"].ToString()));
                }
                ddlclass_SelectedIndexChanged(sender, e);
                ddlgroup.SelectedIndex = ddlgroup.Items.IndexOf(ddlgroup.Items.FindByValue(drt.Rows[0]["gid"].ToString()));
                imgbtngo_Click(sender, e);
            }
            else
            {
                ddlSearchByStore_SelectedIndexChanged(sender, e);
            }
        }
    }
Example #27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //if (Session["Comid"] == null)
        //{
        //    Response.Redirect("~/Shoppingcart/Admin/ShoppingCartLogin.aspx");
        //}
        pagetitleclass pg = new pagetitleclass();

        string strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };
        //  compid = Session["Comid"].ToString();
        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();


        //    Page.Title = pg.getPageTitle(page);

        PageConn pgcon = new PageConn();

        con = pgcon.dynconn;

        if (!Page.IsPostBack)
        {
            Pagecontrol.dypcontrol(Page, page);


            if (Request.QueryString["Id"] != null)
            {
                int id = Convert.ToInt32(Request.QueryString["Id"]);

                string inf = "select vacancymastertbl.* from vacancymastertbl where  vacancymastertbl.ID=" + id;

                SqlDataAdapter dainf = new SqlDataAdapter(inf, con);
                DataTable      dtinf = new DataTable();
                dainf.Fill(dtinf);

                ViewState["whid"] = Convert.ToString(dtinf.Rows[0]["BusinessID"]);
                ViewState["vacancypositiontypeid"]  = Convert.ToString(dtinf.Rows[0]["vacancypositiontypeid"]);
                ViewState["vacancypositiontitleid"] = Convert.ToString(dtinf.Rows[0]["vacancypositiontitleid"]);


                SqlDataAdapter da11 = new SqlDataAdapter("select LogoUrl from CompanyWebsitMaster where whid='" + ViewState["whid"] + "'", con);
                DataTable      dt11 = new DataTable();
                da11.Fill(dt11);

                if (dt11.Rows.Count > 0)
                {
                    Img1.ImageUrl = "~/ShoppingCart/images/" + dt11.Rows[0]["LogoUrl"].ToString();
                }

                SqlDataAdapter daza = new SqlDataAdapter("select warehousemaster.Name,CityMasterTbl.CityName,StateMasterTbl.StateName,CompanyWebsiteAddressMaster.TollFree1,CountryMaster.CountryName,CompanyWebsiteAddressMaster.Address1,CompanyWebsiteAddressMaster.Zip,CompanyWebsiteAddressMaster.Address2,CompanyWebsiteAddressMaster.Phone1,CompanyWebsiteAddressMaster.Phone2,CompanyWebsiteAddressMaster.Email from CompanyWebsiteAddressMaster inner join warehousemaster on warehousemaster.warehouseid=CompanyWebsiteAddressMaster.CompanyWebsiteMasterId inner join CityMasterTbl on CityMasterTbl.CityId=CompanyWebsiteAddressMaster.City inner join StateMasterTbl on StateMasterTbl.StateId=CompanyWebsiteAddressMaster.State inner join CountryMaster on CountryMaster.CountryId=CompanyWebsiteAddressMaster.Country where CompanyWebsiteAddressMaster.CompanyWebsiteMasterId='" + ViewState["whid"] + "'", con);
                DataTable      dtza = new DataTable();
                daza.Fill(dtza);

                if (dtza.Rows.Count > 0)
                {
                    lblcompanyname.Text = dtza.Rows[0]["Name"].ToString();

                    lbladdress1.Text = "";

                    if (Convert.ToString(dtza.Rows[0]["TollFree1"]) != "")
                    {
                        lbladdress1.Text += "Tollfree : " + dtza.Rows[0]["TollFree1"].ToString();
                    }
                    if (Convert.ToString(dtza.Rows[0]["Phone1"]) != "" && Convert.ToString(dtza.Rows[0]["TollFree1"]) != "")
                    {
                        lbladdress1.Text += " , Ph : " + dtza.Rows[0]["Phone1"].ToString();
                    }
                    else
                    {
                        lbladdress1.Text += "Ph : " + dtza.Rows[0]["Phone1"].ToString();
                    }
                    //lbladdress1.Text = "Tollfree : " + dtza.Rows[0]["TollFree1"].ToString() + " , Ph : " + dtza.Rows[0]["Phone1"].ToString();

                    if (Convert.ToString(dtza.Rows[0]["Email"]) != "")
                    {
                        lblphoneno.Text = "Email : " + dtza.Rows[0]["Email"].ToString();
                    }

                    //lblcompanyname.Text = dtza.Rows[0]["Name"].ToString();
                    //lbladdress1.Text = dtza.Rows[0]["Address1"].ToString();
                    //lbltollfreeno.Text = dtza.Rows[0]["Address2"].ToString();
                    //lblphoneno.Text = dtza.Rows[0]["Phone1"].ToString();
                    //Label3.Text = dtza.Rows[0]["Email"].ToString();

                    //lblcs.Text = dtza.Rows[0]["CityName"].ToString() + "," + dtza.Rows[0]["StateName"].ToString() + "," + dtza.Rows[0]["CountryName"].ToString();
                }

                string         strii = "select distinct VacancyMasterTbl.*,case when (VacancyMasterTbl.status='1') then 'Active' else 'Inactive' End as Statuslabel,WareHouseMaster.Name as wname,DepartmentmasterMNC.Departmentname + ' - ' + DesignationMaster.DesignationName as dname,VacancyTypeMaster.Name as vname,VacancyPositionTitleMaster.VacancyPositionTitle as vtitle from VacancyMasterTbl inner join WareHouseMaster on WareHouseMaster.WareHouseId=VacancyMasterTbl.businessid  inner join DesignationMaster on DesignationMaster.DesignationMasterId=VacancyMasterTbl.DesignationID inner join DepartmentmasterMNC on DesignationMaster.DeptID=DepartmentmasterMNC.id inner join VacancyTypeMaster on VacancyTypeMaster.ID=VacancyMasterTbl.vacancypositiontypeid inner join VacancyPositionTitleMaster  on VacancyPositionTitleMaster.ID=VacancyMasterTbl.vacancypositiontitleid where VacancyMasterTbl.ID='" + id + "'";
                SqlDataAdapter da    = new SqlDataAdapter(strii, con);
                DataTable      dt    = new DataTable();
                da.Fill(dt);


                if (dt.Rows.Count > 0)
                {
                    lblbusiness.Text = Convert.ToString(dt.Rows[0]["wname"]);



                    lblvactype.Text = Convert.ToString(dt.Rows[0]["vname"]);

                    lblvactitle.Text = Convert.ToString(dt.Rows[0]["vtitle"]);


                    lblemail.Text = Convert.ToString(dt.Rows[0]["contactEmail"]);

                    lblpername.Text = Convert.ToString(dt.Rows[0]["contactname"]);

                    lblphonno.Text = Convert.ToString(dt.Rows[0]["contactphoneno"]);

                    lbladdress.Text = Convert.ToString(dt.Rows[0]["contactAddress"]);



                    lblsal2.Text = Convert.ToString(dt.Rows[0]["salaryamount"]);



                    if (Convert.ToBoolean(dt.Rows[0]["applybyemail"]) == true)
                    {
                        pansdsdssdd.Visible = true;
                    }
                    else
                    {
                        pansdsdssdd.Visible = false;
                    }
                    if (Convert.ToBoolean(dt.Rows[0]["applybyphone"]) == true)
                    {
                        Panel1.Visible = true;
                    }
                    else
                    {
                        Panel1.Visible = false;
                    }
                    if (Convert.ToBoolean(dt.Rows[0]["applybyvisit"]) == true)
                    {
                        Panel2.Visible = true;
                    }
                    else
                    {
                        Panel2.Visible = false;
                    }
                    if (Convert.ToBoolean(dt.Rows[0]["applyonline"]) == true)
                    {
                        Panel3.Visible = true;
                    }
                    else
                    {
                        Panel3.Visible = false;
                    }
                }

                SqlDataAdapter dac = new SqlDataAdapter("select [CityMasterTbl].[CityName],StateMasterTbl.[StateName],CountryMaster.[CountryName] from [CityMasterTbl] inner join VacancyMasterTbl on VacancyMasterTbl.cityid=[CityMasterTbl].[CityId] inner join StateMasterTbl on StateMasterTbl.StateId=VacancyMasterTbl.stateid inner join CountryMaster on CountryMaster.CountryId=VacancyMasterTbl.countryid where VacancyMasterTbl.ID='" + id + "'", con);
                DataTable      dtc = new DataTable();
                dac.Fill(dtc);

                if (dtc.Rows.Count > 0)
                {
                    lblcountry.Text = Convert.ToString(dtc.Rows[0]["CountryName"]);

                    lblstate.Text = Convert.ToString(dtc.Rows[0]["StateName"]);

                    lblcity.Text = Convert.ToString(dtc.Rows[0]["CityName"]);
                }

                SqlDataAdapter dac1 = new SqlDataAdapter("select VacancyDetailTbl.* from VacancyDetailTbl inner join VacancyMasterTbl on VacancyMasterTbl.ID=VacancyDetailTbl.vacancymasterid where VacancyMasterTbl.ID='" + id + "'", con);
                DataTable      dtc1 = new DataTable();
                dac1.Fill(dtc1);

                if (dtc1.Rows.Count > 0)
                {
                    lbljobfun.Text = Convert.ToString(dtc1.Rows[0]["JobFunction"]);

                    lblqualifi.Text = Convert.ToString(dtc1.Rows[0]["QualificationRequirements"]);

                    lblTandC.Text = Convert.ToString(dtc1.Rows[0]["TermsandConditions"]);
                }

                SqlDataAdapter dac11 = new SqlDataAdapter("select Name from VacancyFTPT inner join VacancyMasterTbl on VacancyMasterTbl.vacancyftptid=VacancyFTPT.Id where VacancyMasterTbl.ID='" + id + "'", con);
                DataTable      dtc11 = new DataTable();
                dac11.Fill(dtc11);

                if (dtc11.Rows.Count > 0)
                {
                    lblduration.Text = Convert.ToString(dtc11.Rows[0]["Name"]);
                }

                SqlDataAdapter dasl = new SqlDataAdapter("select CurrencyMaster.CurrencyName from CurrencyMaster inner join VacancyMasterTbl on VacancyMasterTbl.currencyid=CurrencyMaster.CurrencyId where VacancyMasterTbl.ID='" + id + "'", con);
                DataTable      dtsl = new DataTable();
                dasl.Fill(dtsl);

                if (dtsl.Rows.Count > 0)
                {
                    lblsal1.Text = Convert.ToString(dtsl.Rows[0]["CurrencyName"]);
                }

                SqlDataAdapter dasl11 = new SqlDataAdapter("select SalaryPerPeriodMaster.Name from SalaryPerPeriodMaster inner join VacancyMasterTbl on VacancyMasterTbl.salaryperperiodid=SalaryPerPeriodMaster.ID where VacancyMasterTbl.ID='" + id + "'", con);
                DataTable      dtsl11 = new DataTable();
                dasl11.Fill(dtsl11);

                if (dtsl11.Rows.Count > 0)
                {
                    lblsal3.Text = Convert.ToString(dtsl11.Rows[0]["Name"]);
                }
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Comid"] == null)
        {
            Response.Redirect("~/ShoppingCart/Admin/ShoppingCartLogin.aspx");
        }
        PageConn pgcon = new PageConn();

        con = pgcon.dynconn;

        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();

        Session["PageUrl"]  = strData;
        Session["PageName"] = page;
        Page.Title          = pg.getPageTitle(page);

        if (Session["CompanyName"] != null)
        {
            this.Title = Session["CompanyName"] + " IFileCabinet.com - Manage Email";
        }
        if (!IsPostBack)
        {
            ViewState["sortOrder"] = "";
            Pagecontrol.dypcontrol(Page, page);
            string str = "SELECT WareHouseId,Name,Address,CurrencyId  FROM WareHouseMaster where comid = '" + Session["comid"] + "'and WareHouseMaster.Status='" + 1 + "' order by name";

            SqlCommand cmd1 = new SqlCommand(str, con);
            cmd1.CommandType = CommandType.Text;
            SqlDataAdapter da = new SqlDataAdapter(cmd1);
            DataTable      dt = new DataTable();
            da.Fill(dt);

            ddlstore.DataSource     = dt;
            ddlstore.DataTextField  = "Name";
            ddlstore.DataValueField = "WareHouseId";
            ddlstore.DataBind();
            ddlbusinessfil.DataSource     = dt;
            ddlbusinessfil.DataTextField  = "Name";
            ddlbusinessfil.DataValueField = "WareHouseId";
            ddlbusinessfil.DataBind();
            ddlbusinessfil.Items.Insert(0, "All");
            ddlbusinessfil.Items[0].Value = "0";
            DataTable dsss = new DataTable();
            dsss = clsMessage.Empid(ddlstore.SelectedValue);
            if (dsss.Rows.Count > 0)
            {
                Session["EmployeeIdep"] = dsss.Rows[0]["EmployeeMasterId"].ToString();
            }
            else
            {
                Session["EmployeeIdep"] = "0";
            }

            ddlempfil.Items.Insert(0, "All");
            ddlempfil.Items[0].Value = "0";
            ddlemp.Items.Insert(0, "Select");
            ddlemp.Items[0].Value = "0";
            ViewState["Dltitem"]  = "";
            lblCompany.Text       = Session["comid"].ToString();
            lblBusiness.Text      = "All";
            FillGrid();
            imgupdate.Visible = false;
            imgbtnsubmitCabinetAdd.Visible = true;
            //imgcancel.Visible = false;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Comid"] == null)
        {
            Response.Redirect("~/Shoppingcart/Admin/ShoppingCartLogin.aspx");
        }
        PageConn pgcon = new PageConn();

        con = pgcon.dynconn;
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();

        ViewState["Compid"]   = Session["Comid"].ToString();
        ViewState["UserName"] = Session["userid"].ToString();



        Page.Title = pg.getPageTitle(page);
        if (!IsPostBack)
        {
            txtfromdate.Text = System.DateTime.Now.ToShortDateString();
            txttodate.Text   = System.DateTime.Now.ToShortDateString();

            Pagecontrol.dypcontrol(Page, page);
            fillwarehouse();

            if (ddlwarehouse.SelectedItem.Text.Equals("All"))
            {
                string qryStr1 = "Select id,Departmentname from DepartmentmasterMNC  where Companyid='" + ViewState["Compid"] + "'  order by Departmentname";
                ddlDept.DataSource = (DataSet)fillddl(qryStr1);
                fillddlOther(ddlDept, "Departmentname", "id");
                ddlDept.Items.Insert(0, "All");
                ddlDept.Items[0].Value = "0";
            }
            else
            {
                //    fillemploy();
                string qryStr = "Select id,Departmentname from DepartmentmasterMNC  where Companyid='" + ViewState["Compid"] + "' and Whid='" + ddlwarehouse.SelectedValue + "' order by Departmentname";
                ddlDept.DataSource = (DataSet)fillddl(qryStr);
                fillddlOther(ddlDept, "Departmentname", "id");
                ddlDept.Items.Insert(0, "All");
                ddlDept.Items[0].Value = "0";
            }


            ddlDesignation.Items.Insert(0, "All");
            ddlDesignation.Items[0].Value = "0";
            ddlEmployeeName.Items.Insert(0, "All");
            ddlEmployeeName.Items[0].Value = "0";
            ddlproject.Items.Insert(0, "All");
            ddlproject.Items[0].Value = "0";
            ddltask.Items.Insert(0, "All");
            ddltask.Items[0].Value = "0";

            fillgriddata();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Comid"] == null)
        {
            Response.Redirect("~/Shoppingcart/Admin/ShoppingCartLogin.aspx");
        }
        PageConn pgcon = new PageConn();

        con = pgcon.dynconn;
        pagetitleclass pg      = new pagetitleclass();
        string         strData = Request.Url.ToString();

        char[] separator = new char[] { '/' };

        string[] strSplitArr = strData.Split(separator);
        int      i           = Convert.ToInt32(strSplitArr.Length);
        string   page        = strSplitArr[i - 1].ToString();

        Compid = Session["Comid"].ToString();
        ViewState["Compid"]   = Session["Comid"].ToString();
        ViewState["UserName"] = Session["userid"].ToString();
        Page.Title            = pg.getPageTitle(page);

        if (!IsPostBack)
        {
            ViewState["sortOrder"] = "";
            lblmsg.Text            = "";

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

            if (Request.QueryString["Id"] != null)
            {
                int id = Convert.ToInt32(Request.QueryString["Id"]);
                pnladd.Visible = true;
                add.Visible    = false;

                fillstore();
                txtStartDate.Text = System.DateTime.Now.ToShortDateString();
                txtEndDate.Text   = System.DateTime.Now.ToShortDateString();
                txtfromdt.Text    = System.DateTime.Now.ToShortDateString();
                txttodt.Text      = System.DateTime.Now.ToShortDateString();
                fillleaveearned();
                getSupervisor();
                FillLeaveType();
                ddlLeaveType.SelectedIndex = ddlLeaveType.Items.IndexOf(ddlLeaveType.Items.FindByValue(id.ToString()));

                filldata();
                ddlstrname_SelectedIndexChanged(sender, e);
            }


            else
            {
                fillstore();
                txtStartDate.Text = System.DateTime.Now.ToShortDateString();
                txtEndDate.Text   = System.DateTime.Now.ToShortDateString();
                txtfromdt.Text    = System.DateTime.Now.ToShortDateString();
                txttodt.Text      = System.DateTime.Now.ToShortDateString();
                fillleaveearned();
                getSupervisor();
                FillLeaveType();

                filldata();
                ddlstrname_SelectedIndexChanged(sender, e);
            }
        }
    }