Ejemplo n.º 1
0
        public SMSBrowsePhonebook(SMSMainform _frm)
        {
            InitializeComponent();
            this._frm = _frm;

            cat = new ClassPosition();
        }
Ejemplo n.º 2
0
        protected void btnSubmitPosition_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtInsertPositionID.Text))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('กรุณาใส่ รหัสระดับ')", true);
                return;
            }
            if (string.IsNullOrEmpty(txtInsertPositionName.Text))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('กรุณาใส่ ชื่อระดับ')", true);
                return;
            }
            if (string.IsNullOrEmpty(txtInsertSubStaffID.Text))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('กรุณาใส่ รหัสประเภทตำแหน่ง')", true);
                return;
            }
            ClassPosition p = new ClassPosition();

            p.ID    = txtInsertPositionID.Text;
            p.NAME  = txtInsertPositionName.Text;
            p.ST_ID = txtInsertSubStaffID.Text;

            if (p.CheckUsePositionID())
            {
                p.InsertPosition();
                BindData();
                ClearData();
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('เพิ่มข้อมูลเรียบร้อย')", true);
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('มีรหัสตำแหน่งทางวิชาการ อยู่ในระบบแล้ว !')", true);
            }
        }
Ejemplo n.º 3
0
        public PhoneBookAdd(PhoneBookMainform _frm)
        {
            InitializeComponent();

            cat       = new ClassPosition();
            this._frm = _frm;
        }
Ejemplo n.º 4
0
        public TextBlastSMSMainform()
        {
            InitializeComponent();

            sms          = new ClassSMS();
            listMobileNo = new List <string>();
            cat          = new ClassPosition();
        }
Ejemplo n.º 5
0
        public UserAddModify(UserMainform _frm)
        {
            InitializeComponent();

            cat = new ClassPosition();

            this._frm = _frm;
        }
Ejemplo n.º 6
0
        void BindData1()
        {
            ClassPosition p  = new ClassPosition();
            DataTable     dt = p.GetPositionSearch(txtSearchPositionID.Text, txtSearchPositionName.Text, txtSearchSubStaffID.Text);

            GridView1.DataSource = dt;
            GridView1.DataBind();
            SetViewState(dt);
        }
Ejemplo n.º 7
0
        void BindData()
        {
            ClassPosition p  = new ClassPosition();
            DataTable     dt = p.GetPosition("", "", "");

            GridView1.DataSource = dt;
            GridView1.DataBind();
            SetViewState(dt);
        }
Ejemplo n.º 8
0
        protected void btnSearchRefresh_Click(object sender, EventArgs e)
        {
            ClearData();
            ClassPosition p  = new ClassPosition();
            DataTable     dt = p.GetPosition("", "", "");

            GridView1.DataSource = dt;
            GridView1.DataBind();
            SetViewState(dt);
        }
Ejemplo n.º 9
0
        protected void modDeleteCommand(Object sender, GridViewDeleteEventArgs e)
        {
            string        id = GridView1.DataKeys[e.RowIndex].Value.ToString();
            ClassPosition p  = new ClassPosition();

            p.ID = id;
            p.DeletePosition();
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('ลบข้อมูลเรียบร้อย')", true);

            GridView1.EditIndex = -1;
            BindData1();
        }
Ejemplo n.º 10
0
        protected void modUpdateCommand(Object sender, GridViewUpdateEventArgs e)
        {
            TextBox txtPositionIDEdit   = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtPositionIDEdit");
            TextBox txtPositionNameEdit = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtPositionNameEdit");
            TextBox txtSubStaffIDEdit   = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtSubStaffIDEdit");

            ClassPosition p = new ClassPosition(txtPositionIDEdit.Text, txtPositionNameEdit.Text, txtSubStaffIDEdit.Text);

            p.UpdatePosition();
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('อัพเดทข้อมูลเรียบร้อย')", true);
            GridView1.EditIndex = -1;
            BindData1();
        }
Ejemplo n.º 11
0
 protected void btnSearchPosition_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(txtSearchPositionID.Text) && string.IsNullOrEmpty(txtSearchPositionName.Text) && string.IsNullOrEmpty(txtSearchSubStaffID.Text))
     {
         ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('กรุณากรอก คำค้นหา')", true);
         return;
     }
     else
     {
         ClassPosition p  = new ClassPosition();
         DataTable     dt = p.GetPositionSearch(txtSearchPositionID.Text, txtSearchPositionName.Text, txtSearchSubStaffID.Text);
         GridView1.DataSource = dt;
         GridView1.DataBind();
         SetViewState(dt);
     }
 }
Ejemplo n.º 12
0
        public static void ParseClassDefinitions(string code, FilePosition filePosition, TypeCollection types, WarningList warnings)
        {
            // Find all class definitions
            var matches = classDefinitionRegex.Matches(code);

            // Parse class definitions
            foreach (Match match in matches)
            {
                string className     = match.Groups["className"].Value;
                var    classPosition = new ClassPosition(filePosition, className);

                // Parse annotations, filtering out unknown ones
                Annotation[] annotations = match.Groups["annotation"].Captures
                                           .Cast <Capture>()
                                           .Select(capture => Annotation.Create(capture.Value, classPosition, warnings))
                                           .ToArray();
                foreach (var unknownAnnotation in annotations.OfType <UnknownAnnotation>())
                {
                    warnings.Add(classPosition, WarningType.UnexpectedAnnotation,
                                 "Unknown annotation command '{0}'.", unknownAnnotation.Command);
                }
                annotations = annotations
                              .Where(annotation => !(annotation is UnknownAnnotation))
                              .ToArray();

                // Get base class names, ignoring all template classes and primitive types
                MoaiClass[] baseClasses = match.Groups["baseClassName"].Captures
                                          .Cast <Capture>()
                                          .Where(capture => !capture.Value.Contains("<"))
                                          .Select(capture => types.GetOrCreate(capture.Value, null))
                                          .OfType <MoaiClass>()
                                          .ToArray();

                // Parse annotation block
                MoaiClass moaiClass = types.GetOrCreate(className, classPosition) as MoaiClass;
                if (moaiClass != null)
                {
                    moaiClass.ClassPosition = classPosition;
                    if (annotations.Any())
                    {
                        ParseClassDocumentation(moaiClass, annotations, baseClasses, classPosition, warnings);
                    }
                }
            }
        }
Ejemplo n.º 13
0
 public TeacherAccount()
 {
     InitializeComponent();
     pos = new ClassPosition();
 }
Ejemplo n.º 14
0
        private static void ParseClassDocumentation(MoaiClass moaiClass, Annotation[] annotations, MoaiClass[] baseClasses, ClassPosition classPosition, WarningList warnings)
        {
            // Check that there is a single @lua annotation
            int nameAnnotationCount = annotations.OfType <LuaNameAnnotation>().Count();

            if (nameAnnotationCount == 0)
            {
                warnings.Add(classPosition, WarningType.MissingAnnotation, "Missing @lua annotation.");
            }
            else if (nameAnnotationCount > 1)
            {
                warnings.Add(classPosition, WarningType.UnexpectedAnnotation, "Multiple @lua annotations.");
            }

            // Check that there is a single @text annotation
            int textAnnotationCount = annotations.OfType <TextAnnotation>().Count();

            if (textAnnotationCount == 0)
            {
                warnings.Add(classPosition, WarningType.MissingAnnotation, "Missing @text annotation.");
            }
            else if (textAnnotationCount > 1)
            {
                warnings.Add(classPosition, WarningType.UnexpectedAnnotation, "Multiple @text annotations.");
            }

            // Store base classes
            moaiClass.BaseClasses.AddRange(baseClasses);

            // Parse annotations
            foreach (var annotation in annotations)
            {
                if (annotation is LuaNameAnnotation)
                {
                    // Nothing to do. Name is already set. Just make sure the annotation is correct.
                    var nameAnnotation = (LuaNameAnnotation)annotation;
                    if (nameAnnotation.Value != moaiClass.Name)
                    {
                        warnings.Add(classPosition, WarningType.UnexpectedValue,
                                     "@lua annotation has inconsistent value '{0}'. Expected '{1}'.", nameAnnotation.Value, moaiClass.Name);
                    }
                }
                else if (annotation is TextAnnotation)
                {
                    // Set class description
                    moaiClass.Description = ((TextAnnotation)annotation).Value;
                }
                else if (annotation is FieldAnnotation)
                {
                    // Add field (constant, flag, or attribute)
                    var   fieldAnnotation = (FieldAnnotation)annotation;
                    Field field           = (annotation is ConstantAnnotation) ? new Constant()
                        : (annotation is FlagAnnotation) ? (Field) new Flag()
                        : new Attribute();
                    field.OwningClass = moaiClass;
                    field.Name        = fieldAnnotation.Name;
                    field.Description = fieldAnnotation.Description;
                    moaiClass.Members.Add(field);
                }
                else
                {
                    warnings.Add(classPosition, WarningType.UnexpectedAnnotation,
                                 "Unexpected {0} annotation.", annotation.Command);
                }
            }
        }
Ejemplo n.º 15
0
 public UserAddModify()
 {
     InitializeComponent();
     cat = new ClassPosition();
 }