Beispiel #1
0
    public void BindTrainers()
    {
        DataTable dt = BLL_Crew_Training.Get_Crew_Trainers(GetSessionUserID());

        gvTrainers.DataSource = dt;
        gvTrainers.DataBind();
    }
Beispiel #2
0
    public void BindTrainingTypes()
    {
        int rowcount = ucCustomPagerItems.isCountRecord;

        string sortbycoloumn = (ViewState["SORTBYCOLOUMN"] == null) ? null : (ViewState["SORTBYCOLOUMN"].ToString());
        int?   sortdirection = null; if (ViewState["SORTDIRECTION"] != null)
        {
            sortdirection = Int32.Parse(ViewState["SORTDIRECTION"].ToString());
        }

        DataTable dt = BLL_Crew_Training.Get_Crew_TrainingTypes(txtFilter_TrainingType.Text, ucCustomPagerItems.CurrentPageIndex, ucCustomPagerItems.PageSize, ref rowcount);


        if (ucCustomPagerItems.isCountRecord == 1)
        {
            ucCustomPagerItems.CountTotalRec = rowcount.ToString();
            ucCustomPagerItems.BuildPager();
        }

        if (dt.Rows.Count > 0)
        {
            gvTrainingTypes.DataSource = dt;
            gvTrainingTypes.DataBind();
        }
        else
        {
            gvTrainingTypes.DataSource = dt;
            gvTrainingTypes.DataBind();
        }
    }
Beispiel #3
0
    protected void Load_Trainings()
    {
        int       CrewID = UDFLib.ConvertToInteger(Request.QueryString["CrewID"]);
        DataTable dt     = BLL_Crew_Training.Get_Crew_Trainings(CrewID, GetSessionUserID());

        GridView_Trainings.DataSource = dt;
        GridView_Trainings.DataBind();
    }
Beispiel #4
0
    protected void ImgExpExcel_Click(object sender, EventArgs e)
    {
        DataTable dt = BLL_Crew_Training.Get_Crew_Trainers(GetSessionUserID());

        string[] HeaderCaptions  = { "Trainer Name" };
        string[] DataColumnsName = { "TrainerName" };

        GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "CrewTrainers", "Crew Trainers", "");
    }
Beispiel #5
0
    protected void Load_TraiingTypes()
    {
        DataTable dt = BLL_Crew_Training.Get_Crew_TrainingTypes();

        ddlTrainingType.DataSource     = dt;
        ddlTrainingType.DataValueField = "TrainingTypeID";
        ddlTrainingType.DataTextField  = "TrainingTypeName";
        ddlTrainingType.DataBind();
    }
Beispiel #6
0
    protected void Load_Trainers()
    {
        DataTable dt = BLL_Crew_Training.Get_Crew_Trainers(GetSessionUserID());

        ddlTrainer.DataSource     = dt;
        ddlTrainer.DataValueField = "LibUserID";
        ddlTrainer.DataTextField  = "TrainerName";
        ddlTrainer.DataBind();
    }
Beispiel #7
0
    protected void Load_Attachments(int TrainingID)
    {
        DataTable dtAttachments = BLL_Crew_Training.Get_Training_Attachments(TrainingID, GetSessionUserID());

        rptAttachments.DataSource = dtAttachments;
        rptAttachments.DataBind();
        rptAttachmentse.DataSource = dtAttachments;
        rptAttachmentse.DataBind();
    }
Beispiel #8
0
    protected void ImgExpExcel_Click(object sender, EventArgs e)
    {
        int rowcount = ucCustomPagerItems.isCountRecord;

        DataTable dt = BLL_Crew_Training.Get_Crew_TrainingTypes();

        string[] HeaderCaptions  = { "Training Type ID", "Training Type" };
        string[] DataColumnsName = { "TrainingTypeID", "TrainingTypeName" };

        GridViewExportUtil.ShowExcel(dt, HeaderCaptions, DataColumnsName, "TrainingTypes", "TrainingTypes", "");
    }
Beispiel #9
0
 protected void ImgAdd_Click(object sender, EventArgs e)
 {
     if (Convert.ToInt32(lstUserList.SelectedValue) > 0)
     {
         int retval = BLL_Crew_Training.INSERT_Crew_Trainer(Convert.ToInt32(lstUserList.SelectedValue), Convert.ToInt32(Session["USERID"]));
         BindTrainers();
     }
     else
     {
         string js = "alert('Please select user name from the list')";
         ScriptManager.RegisterStartupScript(Page, Page.GetType(), "js1", js, true);
     }
 }
Beispiel #10
0
    protected void Load_TrainingToEdit(int TrainingID)
    {
        int       CrewID = UDFLib.ConvertToInteger(Request.QueryString["CrewID"]);
        DataTable dt     = BLL_Crew_Training.Get_Crew_Trainings(CrewID, TrainingID, GetSessionUserID());

        if (dt.Rows.Count > 0)
        {
            txtDateofTraining.Text        = UDFLib.ConvertUserDateFormat(Convert.ToString(dt.Rows[0]["StartDate"]));
            ddlTrainer.SelectedValue      = dt.Rows[0]["Trainer"].ToString();
            ddlTrainingType.SelectedValue = dt.Rows[0]["TrainingType"].ToString();
            txtResult.Text  = dt.Rows[0]["Result"].ToString();
            txtRemarks.Text = dt.Rows[0]["Remarks"].ToString();
        }
        Load_Attachments(TrainingID);
    }
Beispiel #11
0
    public int UploadFile(byte[] bFile, string sFilePath, string DisplayName)
    {
        int iAttachID = 0;

        try
        {
            FileStream fileStream = new FileStream(sFilePath, FileMode.Create, FileAccess.ReadWrite);
            fileStream.Write(bFile, 0, bFile.Length);
            fileStream.Close();

            iAttachID = BLL_Crew_Training.INSERT_Training_Attachment(DisplayName, Path.GetFileName(sFilePath), bFile.Length, 0, 0);
        }
        catch { }

        return(iAttachID);
    }
Beispiel #12
0
    public string InsertVideoView(string userid, string chaperid, string itemname)
    {
        try
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("PID", typeof(int));


            BLL_Crew_Training.INSERT_Training(UDFLib.ConvertToInteger(userid), DateTime.Now, 1, UDFLib.ConvertToInteger(userid), "Video", Convert.ToDecimal(1), UDFLib.ConvertToInteger(userid), dt, Convert.ToInt32(chaperid), itemname);
            return("");
        }
        catch
        {
            return("");
        }
    }
Beispiel #13
0
    protected void btnsave_Click(object sender, EventArgs e)
    {
        if (HiddenFlag.Value == "Add")
        {
            int retval = BLL_Crew_Training.INSERT_TrainingType(txtTrainingType.Text, Convert.ToInt32(Session["USERID"]));
        }
        else
        {
            int retval = BLL_Crew_Training.UPDATE_TrainingType(Convert.ToInt32(hdnTrainingTypeID.Value.Trim()), txtTrainingType.Text, Convert.ToInt32(Session["USERID"]));
        }

        BindTrainingTypes();

        string hidemodal = String.Format("hideModal('divadd')");

        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "hidemodal", hidemodal, true);
    }
Beispiel #14
0
    protected void onUpdate(object source, CommandEventArgs e)
    {
        HiddenFlag.Value = "Edit";
        OperationMode    = "Edit";

        DataTable dt = new DataTable();

        dt = BLL_Crew_Training.Get_Crew_TrainingTypes(Convert.ToInt32(e.CommandArgument.ToString()));

        if (dt.Rows.Count > 0)
        {
            hdnTrainingTypeID.Value = dt.Rows[0]["TrainingTypeID"].ToString();
            txtTrainingType.Text    = dt.Rows[0]["TrainingTypeName"].ToString();

            string js = String.Format("showModal('divadd',false);");
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "TradeZone", js, true);
        }
    }
Beispiel #15
0
    public string Get_Training_Attachments(int TrainingID, int UserID)
    {
        DataTable dt = BLL_Crew_Training.Get_Training_Attachments(TrainingID, UserID);

        UDCHyperLink aLink = new UDCHyperLink("DocURL", "", new string[] { }, new string[] { }, "_blank");
        Dictionary <string, UDCHyperLink> dicLink = new Dictionary <string, UDCHyperLink>();

        dicLink.Add("DisplayName", aLink);


        return(UDFLib.CreateHtmlTableFromDataTable(dt,
                                                   new string[] { "Attachments" },
                                                   new string[] { "DisplayName" },
                                                   dicLink,
                                                   new Dictionary <string, UDCToolTip>(),
                                                   new string[] { "left" },
                                                   "CrewQuery-Attachments-table",
                                                   "CrewQuery-Attachments-DataHeder",
                                                   "CrewQuery-Attachments-Data"));
    }
Beispiel #16
0
    private int Save_Training(string Mode)
    {
        int    Res = 0;
        string js  = "";

        if (UDFLib.ConvertDateToNull(txtDateofTraining.Text) == null || UDFLib.ConvertToInteger(ddlTrainingType.SelectedValue) == 0 || UDFLib.ConvertToInteger(ddlTrainer.SelectedValue) == 0)
        {
            js = "alert('Unable to save as some of the fields are left blank');";
            ScriptManager.RegisterStartupScript(this, this.GetType(), "js1", js, true);
        }
        else
        {
            int     CrewID           = UDFLib.ConvertToInteger(HiddenField_CrewID.Value);
            string  Date_Of_Training = txtDateofTraining.Text;
            int     TrainingType     = UDFLib.ConvertToInteger(ddlTrainingType.Text);
            int     Trainer          = UDFLib.ConvertToInteger(ddlTrainer.SelectedValue);
            decimal Result           = UDFLib.ConvertToDecimal(txtResult.Text);
            string  Remarks          = txtRemarks.Text;

            string EditMode = Request.QueryString["Mode"];

            DataTable dt = new DataTable();
            dt.Columns.Add("PID");

            if (HiddenField_SelectedFiles.Value != "")
            {
                string Attachments = HiddenField_SelectedFiles.Value;
                foreach (string id in Attachments.Split(','))
                {
                    DataRow dr = dt.NewRow();
                    dr["PID"] = id;
                    dt.Rows.Add(dr);
                }
            }

            if (EditMode == "EDIT")
            {
                int TrainingID = UDFLib.ConvertToInteger(Request.QueryString["TrainingID"]);
                Res = BLL_Crew_Training.UPDATE_Training(TrainingID, Convert.ToDateTime(txtDateofTraining.Text), UDFLib.ConvertToInteger(ddlTrainingType.SelectedValue), UDFLib.ConvertToInteger(ddlTrainer.SelectedValue), txtRemarks.Text, Result, GetSessionUserID(), dt);

                js = "parent.GetCrewTrainingLog(" + HiddenField_CrewID.Value.ToString() + ");";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", js, true);
            }
            //else if (EditMode == "INSERT")
            //{
            //    Res = BLL_Crew_Training.INSERT_Training(CrewID, Convert.ToDateTime(txtDateofTraining.Text), UDFLib.ConvertToInteger(ddlTrainingType.SelectedValue), UDFLib.ConvertToInteger(ddlTrainer.SelectedValue), txtRemarks.Text, Result, GetSessionUserID(), dt, 0, "");

            //    js = "parent.GetCrewTrainingLog(" + HiddenField_CrewID.Value.ToString() + ");";
            //    ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", js, true);
            //}

            if (Mode == "SaveAndClose")
            {
                string js1 = "parent.hideModal('dvPopupFrame');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "msgc", js1, true);
            }
            else
            {
                Load_Attachments(UDFLib.ConvertToInteger(Request.QueryString["TrainingID"]));
            }
        }
        return(Res);
    }
Beispiel #17
0
    protected void onDelete(object source, CommandEventArgs e)
    {
        int retval = BLL_Crew_Training.DELETE_TrainingType(Convert.ToInt32(e.CommandArgument.ToString()), Convert.ToInt32(Session["USERID"]));

        BindTrainingTypes();
    }