public static List <ATTMeetingType> GetMeetingTypeList()
        {
            List <ATTMeetingType> lstMeetingType = new List <ATTMeetingType>();

            try
            {
                foreach (DataRow row in DLLMeetingType.GetMeetingTypeListTable().Rows)
                {
                    ATTMeetingType objMeetingType = new ATTMeetingType(

                        int.Parse(row["MTYPE_ID"].ToString()),
                        row["MTYPE_NAME"].ToString(),
                        row["DESCRIPTION"].ToString()

                        );

                    objMeetingType.Action = "E";

                    lstMeetingType.Add(objMeetingType);
                }

                return(lstMeetingType);
            }
            catch (Exception ex)
            {
                throw(ex);
            }
        }
Ejemplo n.º 2
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        ATTMeetingType Mtype = new ATTMeetingType();

        Mtype.MeetingTypeName = this.txtMeetingType.Text;
        Mtype.MeetingTypeDesc = this.txtDescription.Text;

        if (this.lstMeetingType.SelectedIndex < 0)//add mode
        {
            Mtype.MeetingTypeID = 0;
            Mtype.Action        = "A";
        }
        else //edit mode
        {
            Mtype.MeetingTypeID = ((List <ATTMeetingType>)Session["MeetingTypeLst"])[this.lstMeetingType.SelectedIndex].MeetingTypeID;
            Mtype.Action        = "E";
        }

        ObjectValidation result = BLLMeetingType.Validate(Mtype);

        if (result.IsValid == false)
        {
            this.lblStatusMessage.Text = result.ErrorMessage;
            this.programmaticModalPopup.Show();
            return;
        }

        try
        {
            BLLMeetingType.AddMeetingType(Mtype);
            List <ATTMeetingType> lst = ((List <ATTMeetingType>)Session["MeetingTypeLst"]);

            if (Mtype.Action == "A")
            {
                lst.Add(Mtype);
            }
            else
            {
                lst[this.lstMeetingType.SelectedIndex] = Mtype;
            }

            this.lstMeetingType.DataSource     = lst;
            this.lstMeetingType.DataTextField  = "MeetingTypeName";
            this.lstMeetingType.DataValueField = "MeetingTypeID";
            this.lstMeetingType.DataBind();

            this.ClearME();
            this.lstMeetingType.SelectedIndex = -1;
            this.lblStatusMessage.Text        = "Meeting Type successfully saved.";
            this.programmaticModalPopup.Show();
        }
        catch (Exception ex)
        {
            this.lblStatusMessage.Text = ex.Message;
            this.programmaticModalPopup.Show();
        }
    }
Ejemplo n.º 3
0
    protected void lstMeetingType_SelectedIndexChanged(object sender, EventArgs e)
    {
        ATTMeetingType obj = ((List <ATTMeetingType>)Session["MeetingTypeLst"])[this.lstMeetingType.SelectedIndex];

        this.ClearME();

        this.txtMeetingType.Text = obj.MeetingTypeName;
        this.txtDescription.Text = obj.MeetingTypeDesc;
    }
 public static bool AddMeetingType(ATTMeetingType obj)
 {
     try
     {
         return(DLLMeetingType.AddMeetingType(obj));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public static ObjectValidation Validate(ATTMeetingType obj)
        {
            ObjectValidation result = new ObjectValidation();

            if (obj.MeetingTypeName == "")
            {
                result.IsValid      = false;
                result.ErrorMessage = "Meeting type name cannot be blank.";
                return(result);
            }

            return(result);
        }
Ejemplo n.º 6
0
        public static bool AddMeetingType(ATTMeetingType obj)
        {
            string SP = "";

            if (obj.Action == "A")
            {
                SP = "SP_ADD_MEETING_TYPE";
            }
            else if (obj.Action == "E")
            {
                SP = "SP_EDIT_MEETING_TYPE";
            }

            List <OracleParameter> paramArray = new List <OracleParameter>();

            paramArray.Add(Utilities.GetOraParam("p_mtype_id", obj.MeetingTypeID, OracleDbType.Int16, ParameterDirection.InputOutput));
            paramArray.Add(Utilities.GetOraParam("p_mtype_name", obj.MeetingTypeName, OracleDbType.Varchar2, ParameterDirection.Input));
            paramArray.Add(Utilities.GetOraParam("p_desc", obj.MeetingTypeDesc, OracleDbType.Varchar2, ParameterDirection.Input));

            GetConnection DBConn = new GetConnection();

            try
            {
                OracleConnection Conn = DBConn.GetDbConn(Module.OAS);

                SqlHelper.ExecuteNonQuery(Conn, CommandType.StoredProcedure, SP, paramArray.ToArray());
                obj.MeetingTypeID = int.Parse(paramArray[0].Value.ToString());

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                DBConn.CloseDbConn();
            }
        }