protected void Load_CompanyList()
    {
        try
        {
            int RelationshipType_id = UDFLib.ConvertToInteger(ddCompRelationshipType.SelectedValue);

            DataSet ds = objCompBLL.Get_Company_Parent_Child(RelationshipType_id, UDFLib.ConvertToInteger(lstCompany.SelectedValue), Convert.ToInt32(Session["USERID"].ToString()));

            if (ds.Tables.Count > 0)
            {
                lstCompany.DataSource     = ds.Tables[0];
                lstCompany.DataTextField  = "company_name";
                lstCompany.DataValueField = "ID";
                lstCompany.DataBind();
                lstCompany.Items.Insert(0, new ListItem("-Select-", "0"));

                lstCompany1.DataSource     = ds.Tables[1];
                lstCompany1.DataTextField  = "company_name";
                lstCompany1.DataValueField = "ID";
                lstCompany1.DataBind();
            }
        }
        catch (Exception ex)
        {
        }
    }
Esempio n. 2
0
    public void FillDDL()
    {
        try
        {
            BLL_Infra_InspectionType onjInsp = new BLL_Infra_InspectionType();
            DataTable FleetDT = objVsl.GetFleetList(Convert.ToInt32(Session["USERCOMPANYID"].ToString()));
            DDLFleet.DataSource     = FleetDT;
            DDLFleet.DataTextField  = "Name";
            DDLFleet.DataValueField = "code";
            DDLFleet.DataBind();
            ListItem li = new ListItem("--SELECT ALL--", "0");
            DDLFleet.Items.Insert(0, li);

            BLL_Infra_Company objInfra = new BLL_Infra_Company();
            ddlVessel_Manager.DataSource     = objInfra.Get_Company_Parent_Child(1, 0, 0);
            ddlVessel_Manager.DataTextField  = "COMPANY_NAME";
            ddlVessel_Manager.DataValueField = "ID";
            ddlVessel_Manager.DataBind();
            ddlVessel_Manager.Items.Insert(0, new ListItem("-Select All-", "0"));



            DataTable dtVessel = objVsl.Get_VesselList(0, 0, Convert.ToInt32(Session["USERCOMPANYID"].ToString()), "", Convert.ToInt32(Session["USERCOMPANYID"].ToString()));
            DDLVessel.DataSource     = dtVessel;
            DDLVessel.DataTextField  = "Vessel_name";
            DDLVessel.DataValueField = "Vessel_id";
            DDLVessel.DataBind();
            DDLVessel.Items.Insert(0, new ListItem("--SELECT--", null));



            DataTable dtSup = objInsp.Get_Supritendent_Users(null, null);
            DDLInspector.DataSource     = dtSup;
            DDLInspector.DataTextField  = "Name";
            DDLInspector.DataValueField = "UserID";
            DDLInspector.DataBind();
            DDLInspector.Items.Insert(0, new ListItem("--SELECT--", null));

            DDLInspectorA.DataSource     = dtSup;
            DDLInspectorA.DataTextField  = "Name";
            DDLInspectorA.DataValueField = "UserID";
            DDLInspectorA.DataBind();
            DDLInspectorA.Items.Insert(0, new ListItem("--SELECT--", null));

            DataTable dtInsp = onjInsp.Get_InspectionTypeList();


            ddlInspectionType.DataSource     = dtInsp;
            ddlInspectionType.DataTextField  = "InspectionTypeName";
            ddlInspectionType.DataValueField = "InspectionTypeId";
            ddlInspectionType.DataBind();
            ddlInspectionType.Items.Insert(0, new ListItem("--SELECT--", null));
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }
    public void BindSupAttGrid(DateTime StartDate)
    {
        DataSet dtCompany = objCom.Get_Company_Parent_Child(1, UDFLib.ConvertToInteger(Session["USERCOMPANYID"].ToString()), 0);;

        DDLCompany.DataSource     = dtCompany.Tables[0];
        DDLCompany.DataTextField  = "Company_Name";
        DDLCompany.DataValueField = "ID";
        DDLCompany.DataBind();
        DDLCompany.Items.Insert(0, new ListItem("-- ALL --", null));

        dt = objInsp.TEC_Get_SupritendentAttendanceWithPort(StartDate, UDFLib.ConvertToInteger(DDLCompany.SelectedValue));

        grdSupAtt.DataSource = dt;
        grdSupAtt.DataBind();

        //string js = "LastLoad()";
        // ScriptManager.RegisterStartupScript(this, this.GetType(), "ddd", js, true);
        //string[] retval = new string[2];
        //retval = asncLoadCalendarBySupt("0", StartDate.ToString());

        //newt0.InnerHtml = retval[0];
        //newt.InnerHtml = retval[2];
    }
    protected void LoadData()
    {
        try
        {
            ViewState["AddEditFlag"] = "Add";

            grvChecklist.DataSource = null;
            grvChecklist.DataBind();

            tblChecklist.Visible = false;
            BLL_Infra_Company objCom = new BLL_Infra_Company();

            DataSet dtCompany = objCom.Get_Company_Parent_Child(1, 0, 0);;
            DDLCompany.DataSource     = dtCompany.Tables[0];
            DDLCompany.DataTextField  = "Company_Name";
            DDLCompany.DataValueField = "ID";
            DDLCompany.DataBind();
            DDLCompany.Items.Insert(0, new ListItem("-- ALL --", null));


            BLL_Infra_InspectionType onjInsp = new BLL_Infra_InspectionType();
            DataTable FleetDT = objVsl.GetFleetList(Convert.ToInt32(Session["USERCOMPANYID"].ToString()));
            DDLFleetP.DataSource     = FleetDT;
            DDLFleetP.DataTextField  = "Name";
            DDLFleetP.DataValueField = "code";
            DDLFleetP.DataBind();
            DDLFleetP.Items.Insert(0, new ListItem("-- ALL --", null));


            DataTable dtVessel = objVsl.Get_VesselList(0, 0, 0, "", Convert.ToInt32(Session["USERCOMPANYID"].ToString()));
            DDLVesselP.DataSource     = dtVessel;
            DDLVesselP.DataTextField  = "Vessel_name";
            DDLVesselP.DataValueField = "Vessel_id";
            DDLVesselP.DataBind();
            DDLVesselP.Items.Insert(0, new ListItem("-- Select --", null));


            DataTable dtInsp = onjInsp.Get_InspectionTypeList();
            ddlInspectionTypeP.DataSource     = dtInsp;
            ddlInspectionTypeP.DataTextField  = "InspectionTypeName";
            ddlInspectionTypeP.DataValueField = "InspectionTypeId";
            ddlInspectionTypeP.DataBind();
            ddlInspectionTypeP.Items.Insert(0, new ListItem("--SELECT--", null));

            DataTable dtPort = objInfra.Get_PortList();

            if (dtPort.Rows.Count > 0)
            {
                drpPort.DataSource     = dtPort;
                drpPort.DataValueField = "PORT_ID";
                drpPort.DataTextField  = "PORT_NAME";
                drpPort.DataBind();
            }
            drpPort.Items.Insert(0, new ListItem()
            {
                Value = "0", Text = "-Select-"
            });

            txtStartDate.Enabled       = true;
            DDLFleetP.Enabled          = true;
            DDLVesselP.Enabled         = true;
            ddlInspectionTypeP.Enabled = true;
            rdoFrequency.Enabled       = true;
            drpPort.Visible            = true;
            ViewState["ScheduleID"]    = 0;
            ViewState["ScheduleID"]    = "0";
            txtStartDate.Text          = DateTime.Now.Date.ToString("dd/MMM/yy");
            txtEndDate.Text            = "";
            txtOneTime.Text            = DateTime.Now.Date.ToString("dd/MMM/yy");
            chkMonthWise.ClearSelection();
            chkWeekDays.ClearSelection();
            txtWeek.Text                     = "1";
            chkSendEmail.Checked             = false;
            chkImages.Checked                = false;
            txtInspRemark.Text               = "";
            DDLFleetP.SelectedIndex          = 0;
            DDLVesselP.SelectedIndex         = 0;
            DDLInspectorP.SelectedIndex      = 0;
            ddlDaysBefore.SelectedIndex      = 6;
            rdoFrequency.SelectedIndex       = 0;
            ddlInspectionTypeP.SelectedIndex = 0;
            ddlDuration.SelectedValue        = "7";
            rdoFrequency_SelectedIndexChanged(null, null);
            txtDurJobs.Text = "1";
            Guid l = Guid.NewGuid();
        }
        catch (Exception ex)
        {
            UDFLib.WriteExceptionLog(ex);
        }
    }