bool CheckDuplicate()
        {
            lbl_message.Text = string.Empty;
            bool RetVal = true;

            foreach (GridViewRow gr in gview_Component.Rows)
            {
                if (gr.Cells[1].Text == lbl_PaycomponentID.Text)
                {
                    RetVal = false;
                    dialog_Message.Show();
                    lbl_message.Text = ReadXML.GetFailureMessage("EMPLOYEE_DUP_COMPONENT");
                }
            }
            return(RetVal);
        }
Exemple #2
0
        public void loadXML()
        {
            ReadXML xmlOutput = sGlobal["$XMLOutput"];

            if (!xmlOutput.isObject())
            {
                ObjectCreator xmlCreator = new ObjectCreator("ReadXML", xmlOutput);
                xmlCreator["fileName"] = sGlobal["$XMLOutput"] + ".xml";

                xmlOutput = xmlCreator.Create();
            }

            bool output = xmlOutput.readFile();

            Util._echo(output ? "Read successful." : "Read error.");
        }
        public bool ValidateFormFields()
        {
            string UserMessage = string.Empty;
            bool   ReturnValue = true;

            if (ddl_Account.SelectedIndex == 0)
            {
                UserMessage = ReadXML.GetGeneralMessage("SELECTION_CAN_NOT_EMPTY", "Account");
                //lbl_TheMessage.Text = UserMessage;
                ReturnValue = false;

                ReturnValue = false;
            }

            return(ReturnValue);
        }
Exemple #4
0
        static List <string> GetTopoRunRecordTableSql(XmlNode xNode)
        {
            lock (syncRoot)
            {
                List <string> pLst = new List <string>();
                if (xNode.Name.Trim().ToUpper() == "TopoRunRecordTable".ToUpper())
                {
                    List <KeyValue> pAttrs = GetNodeAttrs(xNode);  //获取节点属性值
#if debug
                    ReadXML.WriteLogs(pAttrs, "");
#endif
                    pLst = GetCmdTxtListFromAttrs(pAttrs, true);
                }
                return(pLst);
            }
        }
        private void SetValidationMessages()
        {
            requiredFieldValidator_BankBranch.InitialValue  = MicroConstants.DROPDOWNLIST_DEFAULT_ITEMTEXT;
            requiredFieldValidator_BankAccount.InitialValue = MicroConstants.DROPDOWNLIST_DEFAULT_ITEMTEXT;

            regularExpressionValidator_TransactionDate.ValidationExpression = MicroConstants.REGEX_DATE;

            requiredFieldValidator_TransactionDate.ErrorMessage  = ReadXML.GetGeneralMessage("ONLY_DATE_FIELD");
            requiredFieldValidator_RemittancePaidTo.ErrorMessage = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "Office");
            requiredFieldValidator_BankBranch.ErrorMessage       = ReadXML.GetGeneralMessage("SELECTION_CAN_NOT_EMPTY", "Bank Branch");
            requiredFieldValidator_BankAccount.ErrorMessage      = ReadXML.GetGeneralMessage("SELECTION_CAN_NOT_EMPTY", "Bank Account Number");

            regularExpressionValidator_TransactionDate.ErrorMessage = ReadXML.GetGeneralMessage("REGEX_DATE");

            SetFormMessageCSSClass("ValidateMessage");
        }
        //private void HideGridViewColumns()
        //{
        //    BasePage.ShowHidePagePermissions(gridview_LoanMaster, btn_AddApplication, this.Page);
        //}

        private void SetValidationMessages()
        {
            requiredFieldValidator_LoanType.InitialValue                = MicroConstants.DROPDOWNLIST_DEFAULT_ITEMTEXT;
            requiredFieldValidator_EmployeeName.InitialValue            = MicroConstants.DROPDOWNLIST_DEFAULT_ITEMTEXT;
            requiredFieldValidator_AcademicYear.InitialValue            = MicroConstants.DROPDOWNLIST_DEFAULT_ITEMTEXT;
            regularExpressionValidator_loanappdate.ValidationExpression = MicroConstants.REGEX_DATE;

            requiredFieldValidator_LoanAmount.ErrorMessage   = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "Loan Amount");
            requiredFieldValidator_LoanType.ErrorMessage     = ReadXML.GetGeneralMessage("SELECTION_CAN_NOT_EMPTY", "LoanType");
            requiredFieldValidator_AcademicYear.ErrorMessage = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "AcademicYear");
            requiredFieldValidator_EmployeeName.ErrorMessage = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "EmployeeName");
            requiredFieldValidator_loanappdate.ErrorMessage  = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "LoanApplicationDate");


            SetFormMessageCSSClass("ValidateMessage");
        }
Exemple #7
0
        public static void ImportExpensesFromXml()
        {
            var expenses = ReadXML.GetObjects("..\\..\\..\\Vendors-Expenses.xml");

            using (var context = new SuperMarketContext())
            {
                foreach (var expense in expenses)
                {
                    context.Expenses.Add(new Expense {
                        VendorName = expense.Item1, Month = expense.Item2, Value = expense.Item3
                    });
                }

                context.SaveChanges();
            }
        }
        protected void gridview_Question_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int RowIndex = 0;

            if (!e.CommandName.Equals(MicroEnums.DataOperation.Page.GetStringValue()))
            {
                RowIndex = Convert.ToInt32(e.CommandArgument);
                int RecordID = int.Parse(((Label)gridview_Question.Rows[RowIndex].FindControl("lbl_QuestionID")).Text);

                PageVariables.ThisFeedbackMaster = (from xyz in PageVariables.TheFeedbackQuestionsList
                                                    where xyz.QuestionID == RecordID
                                                    select xyz).Single();
                if (e.CommandName.Equals(MicroEnums.DataOperation.Edit.GetStringValue()))
                {
                    PopulateFormField(PageVariables.ThisFeedbackMaster);
                    multiview_ManageFeedbacks.SetActiveView(view_EnterQuestions);
                    btn_Save.Text = MicroEnums.DataOperation.Update.GetStringValue();
                }
                if (e.CommandName.Equals(MicroEnums.DataOperation.Select.GetStringValue()))
                {
                    OptionMasters ThisOptionMasters;
                    ThisOptionMasters = (from xyz in FeedbackMasterManagement.GetInstance.GetOptionMastersList()
                                         where xyz.QuestionID == RecordID
                                         select xyz).Single();
                    PopulateFormFieldOptions(ThisOptionMasters);
                    multiview_ManageFeedbacks.SetActiveView(option_EnterQuestions);
                    btn_SaveQ.Text = MicroEnums.DataOperation.Update.GetStringValue();
                }
                else if (e.CommandName.Equals(MicroEnums.DataOperation.Delete.GetStringValue()))
                {
                    int ProcReturnValue = (int)MicroEnums.DataOperationResult.Failure;

                    ProcReturnValue = DeleteFeedbackQuestions();

                    if (ProcReturnValue > (int)MicroEnums.DataOperationResult.Success)
                    {
                        lbl_TheMessage.Text = ReadXML.GetSuccessMessage("OK_ALUMINI_DELETED");
                        BindGridViewOptions();
                    }
                    else
                    {
                        lbl_TheMessage.Text = ReadXML.GetFailureMessage("KO_ALUMINI_DELETED");
                    }
                    dialog_Message.Show();
                }
            }
        }
Exemple #9
0
        public static int ReadMSSQLRecordCount(string[] dbparemeters, string workingFolder, string projectXMLFile)
        {
            string table;
            int    count;

            var fqProjectFilePath = Path.Combine(workingFolder, projectXMLFile);

            if (File.Exists(fqProjectFilePath))
            {
                table = ReadXML.ReadProjectDBTableName(fqProjectFilePath);
            }
            else
            {
                throw new FileNotFoundException("Project file not found!");
            }

            SqlConnectionStringBuilder dbConString = new SqlConnectionStringBuilder
            {
                DataSource     = dbparemeters[0],
                InitialCatalog = dbparemeters[1],
                UserID         = dbparemeters[2],
                Password       = dbparemeters[3]
            };

            using (SqlConnection connection = new SqlConnection(dbConString.ConnectionString))
            {
                try
                {
                    connection.Open();

                    string command = "SELECT COUNT(*) from " + table + ";";

                    using (SqlCommand cmd = new SqlCommand(command, connection))
                    {
                        count = Convert.ToInt32(cmd.ExecuteScalar());
                    }

                    //read data

                    return(count);
                }
                catch (SqlException)
                {
                    return(-1);
                }
            }
        }
        private void SetValidationMessages()
        {
            requiredFieldValidator_ExamSchedule.InitialValue = MicroConstants.DROPDOWNLIST_DEFAULT_ITEMTEXT;
            requiredFieldValidator_ExamSchedule.ErrorMessage = ReadXML.GetGeneralMessage("SELECTION_CAN_NOT_EMPTY", "ExamSchedule");

            requiredFieldValidator_MarksObtain.ErrorMessage = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "Marks Obtained");

            requiredFieldValidator_Student.InitialValue = MicroConstants.DROPDOWNLIST_DEFAULT_ITEMTEXT;
            requiredFieldValidator_Student.ErrorMessage = ReadXML.GetGeneralMessage("SELECTION_CAN_NOT_EMPTY", "Student");

            requiredFieldValidator_VarifiedBy.ErrorMessage = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "Varified By");

            regularExpressionValidator_MarksObtain.ValidationExpression = MicroConstants.REGEX_NUMBER_ONLY;
            regularExpressionValidator_MarksObtain.ErrorMessage         = ReadXML.GetGeneralMessage("REGEX_NUMBER_ONLY");
            regularExpressionValidator_Varifiedby.ValidationExpression  = MicroConstants.REGEX_NUMBER_ONLY;
            regularExpressionValidator_Varifiedby.ErrorMessage          = ReadXML.GetGeneralMessage("REGEX_NUMBER_ONLY");
        }
        private void SetFormMessage()
        {
            requiredFieldValidator_MenuHeads.InitialValue            = MicroConstants.DROPDOWNLIST_DEFAULT_ITEMTEXT;
            requiredFieldValidator_MenuHeads.ErrorMessage            = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "MenuHeads");
            requiredFieldValidator_MenuDisplayText.ErrorMessage      = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "Menu Diplay Text");
            requiredFieldValidator_NavigationUrl.ErrorMessage        = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "NavigationUrl");
            requiredFieldValidator_SubMenuDisplayText.ErrorMessage   = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "Menu Diplay Text");
            requiredFieldValidator_SubMenuNavigationURL.ErrorMessage = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "NavigationUrl");
            //requiredFieldValidator_DisplayOrder.ErrorMessage = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "Display Order");
            regularExpressionValidator_DisplayOrder.ErrorMessage        = ReadXML.GetGeneralMessage("REGEX_NUMBER_WITH_SPACE");
            regularExpressionValidator_SubMenuDisplayOrder.ErrorMessage = ReadXML.GetGeneralMessage("REGEX_NUMBER_WITH_SPACE");

            regularExpressionValidator_SubMenuDisplayOrder.ValidationExpression = MicroConstants.REGEX_NUMBER_WITH_SPACE;


            SetFormMessageCssClass("ValidateMessage");
        }
    void OnEnable()
    {
        common        = GameObject.Find("CommonObject").GetComponent <CommonObjectScript>();
        isNeedWarning = false;
        valuePrefabs  = (GameObject)Resources.Load("Farm/AddValue");
        dataElement   = new ReadXML("Town/XMLFile/ElementStaff");
        numberOfStaff = 0;
        for (int i = 0; i < 16; i++)
        {
            if (i < 4)
            {
                listStaffsinShop[i] = new StaffData(i + 1, 1, 4, -1, false);//max 4 staff in city
                isOpenStaffs[i]     = false;
                if (i != 3)
                {
                    staffDatas[i]   = new Staff(0);//max 3 staff in shop
                    changeStaffs[i] = false;
                }
            }
            if (i != 15)
            {
                cusDatas[i / 5, i % 5] = new Customer();       //max 15 cus
            }
            productDatas[i]    = new ProductData(i, -1, true); //max 16 prodcut
            isUsingItemWeather = true;
        }

        foreach (StaffData staff in MissionData.townDataMission.staffsData)
        {
            listStaffsinShop[staff.idStaff - 1] = staff;
            isOpenStaffs[staff.idStaff - 1]     = true;//confirm staff is open
            if (staff.isHired)
            {
                staffDatas[numberOfStaff] = new Staff(staff.startLevel);
                data = dataElement.getDataByValue("id", staff.idStaff.ToString());
                staffDatas[numberOfStaff].setData(staff.startLevel, getValue("speed", staff.startLevel), getValue("health", staff.startLevel), getValue("percent", staff.startLevel), getValue("mental", staff.startLevel), staff.idStaff);
                numberOfStaff++;
            }
        }
        isCanSick = MissionData.townDataMission.isCanSick;
        if (DialogShop.BoughtItem[12])
        {
            isCanSick = false;
        }
        isUsingItemWeather = MissionData.shopDataMission.isUsingItem;
    }
        private void SetValidationMessages()
        {
            requiredFieldValidator_LeaveDescription.InitialValue = MicroConstants.DROPDOWNLIST_DEFAULT_ITEMTEXT;
            requiredFieldValidator_FromDate.ErrorMessage         = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "FromDate");

            regularExpressionValidator_Todate.ErrorMessage         = ReadXML.GetGeneralMessage("REGEX_DATE");
            regularExpressionValidator_Todate.ValidationExpression = MicroConstants.REGEX_DATE;
            requiredFieldValidator_LeaveDescription.ErrorMessage   = ReadXML.GetGeneralMessage("SELECTION_CAN_NOT_EMPTY", "LeaveDescription");


            requiredFieldValidator_Todate.ErrorMessage = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "ToDate");

            regularExpressionValidator_Todate.ErrorMessage         = ReadXML.GetGeneralMessage("REGEX_DATE");
            regularExpressionValidator_Todate.ValidationExpression = MicroConstants.REGEX_DATE;

            SetFormMessageCSSClass("ValidateMessage");
        }
Exemple #14
0
        private bool ValidateOldPassword()
        {
            bool ReturnValue = true;

            User   ThisUser         = Connection.LoggedOnUser;
            string ThisUserPassword = MicroSecurity.Decrypt(ThisUser.Password);

            if (!ThisUserPassword.Equals(txt_OldPassword.Text))
            {
                lbl_ErrorMessage.Text = ReadXML.GetFailureMessage("KO_PWD_MISMATCH");
                txt_OldPassword.Text  = string.Empty;
                txt_OldPassword.Focus();
                ReturnValue = false;
            }

            return(ReturnValue);
        }
Exemple #15
0
        protected void gridview_StudentSection_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int RowIndex = 0;

            lbl_TheMessage.Text = string.Empty;
            if (!e.CommandName.Equals(MicroEnums.DataOperation.Page.GetStringValue()))
            {
                RowIndex = Convert.ToInt32(e.CommandArgument);
                int            RecordID = int.Parse(((Label)gridview_StudentSection.Rows[RowIndex].FindControl("lbl_SectionID")).Text);
                StudentSection TheSection;
                TheSection = (from xyz in StudentSectionManagement.GetInstance.GetSectionList("")
                              where xyz.SectionID == RecordID
                              select xyz).Single();
                if (e.CommandName.Equals(MicroEnums.DataOperation.Edit.GetStringValue()))
                {
                    PopulateFormField(TheSection, RecordID);
                    multiview_StudentSections.SetActiveView(InputControls);
                    btn_Submit.Text  = MicroEnums.DataOperation.Update.GetStringValue();
                    btn_Submit1.Text = MicroEnums.DataOperation.Update.GetStringValue();
                }
                else if (e.CommandName.Equals(MicroEnums.DataOperation.Delete.GetStringValue()))
                {
                    int ProcReturnValue = (int)MicroEnums.DataOperationResult.Failure;
                    ProcReturnValue = DeleteRecord();
                    if (ProcReturnValue > (int)MicroEnums.DataOperationResult.Success)
                    {
                        dialog_Message.Show();
                        lbl_TheMessage.Text = ReadXML.GetSuccessMessage("OK_DATA_DELETED");
                        BindGrid();
                    }
                    else
                    {
                        dialog_Message.Show();
                        lbl_TheMessage.Text = ReadXML.GetSuccessMessage("KO_DATA_DELETED");
                    }
                }
                else if (e.CommandName.Equals(MicroEnums.DataOperation.Select.GetStringValue()))
                {
                    PopulateFormField(TheSection, RecordID);
                    multiview_StudentSections.SetActiveView(InputControls);
                    btn_Submit.Visible  = false;
                    btn_Submit1.Visible = false;
                }
            }
        }
Exemple #16
0
        private void loadTestSymbolsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            bool          openSuccess;
            List <string> sketches = General.SelectOpenFiles(out openSuccess, "Sketches containing test shapes",
                                                             "Labeled XML Sketches (*.labeled.xml)|*.labeled.xml");

            if (!openSuccess)
            {
                MessageBox.Show("Unable to load sketches");
                return;
            }

            //m_Recognizer = ImageAlignerRecognizer.Load("C:\\Reco.iar");
            //m_Recognizer = ImageAlignerRecognizer.Load("C:\\Documents and Settings\\eric\\My Documents\\Trunk\\Code\\Recognition\\ImageAligner\\TrainedRecognizers\\ImageAlignerRecognizerNBEST.iar");

            int numRight = 0;
            int numWrong = 0;
            Dictionary <Shape, ImageTemplateResult> results = new Dictionary <Shape, ImageTemplateResult>();

            foreach (string sketchFile in sketches)
            {
                Sketch.Sketch sketch = new ReadXML(sketchFile).Sketch;
                sketch = General.ReOrderParentShapes(sketch);

                foreach (Shape shape in sketch.Shapes)
                {
                    if (General.IsGate(shape))
                    {
                        if (shape.Substrokes[0].Labels[0] == shape.Label)
                        {
                            ImageTemplateResult result = m_Recognizer.Recognize(shape);
                            results.Add(shape, result);
                            if (result != null && result.Name == shape.Label)
                            {
                                numRight++;
                            }
                            else
                            {
                                numWrong++;
                            }
                        }
                    }
                }
            }
        }
Exemple #17
0
            /// <summary>
            /// Reset back to tbe beginning of the file.
            /// </summary>
            public void Reset()
            {
                try
                {
                    this.file   = new FileStream(this.owner.Filename, FileMode.Open);
                    this.reader = new ReadXML(this.file);
                }
                catch (IOException e)
                {
#if logging
                    if (logger.IsErrorEnabled)
                    {
                        logger.Error("Exception", e);
                    }
#endif
                    throw new NeuralNetworkError(e);
                }
            }
        private void SetFormMessage()
        {
            RequiredFieldValidator_CompanyName.ErrorMessage                  = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "CompanyName");
            RequiredFieldValidator_CompanyAliasName.ErrorMessage             = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "CompanyAliasName");
            RequiredFieldValidator_CompanyMailingName.ErrorMessage           = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "CompanyMailingName");
            RequiredFieldValidator_CompanyRegistrationNumber.ErrorMessage    = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "CompanyRegistrationNumber");
            RequiredFieldValidator_CompanyEPFRegistrationNumber.ErrorMessage = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "CompanyEPFRegistrationNumber");
            RequiredFieldValidator_EstablishmentDate.ErrorMessage            = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "EstablishmentDate");

            RegularExpressionValidator_CompanyName.ErrorMessage                  = ReadXML.GetGeneralMessage("REGEX_ALPHANUMERIC_SPACE_DOT");
            RegularExpressionValidator_CompanyAliasName.ErrorMessage             = ReadXML.GetGeneralMessage("ONLY_ALPHABET_FIELD");
            RegularExpressionValidator_CompanyMailingName.ErrorMessage           = ReadXML.GetGeneralMessage("ONLY_EMAIL_FIELD");
            RegularExpressionValidator_CompanyRegistrationNumber.ErrorMessage    = ReadXML.GetGeneralMessage("ONLY_NUMBER_FIELD");
            RegularExpressionValidator_CompanyEPFRegistrationNumber.ErrorMessage = ReadXML.GetGeneralMessage("ONLY_NUMBER_FIELD");
            RegularExpressionValidator_EstablishmentDate.ErrorMessage            = ReadXML.GetGeneralMessage("ONLY_VALID_DATE");

            SetFormMessageCSSClass("ValidateMessage");
        }
Exemple #19
0
        public void TestMethodVersion1Dat()
        {
            ArrayList exoplanetArray = null;

            ReadCSV.Read(Constant.UnitTestDATFolder + "Version1.dat");
            exoplanetArray = ReadXML.Read(Constant.UnitTestDATFolder + "Version1.xml", true);
            WriteCSV.Write(Constant.UnitTestDATFolder + "Version1TestResults.dat", exoplanetArray, Constant.Version2);

            ArrayList exoplanetArray2 = null;

            ReadCSV.Read(Constant.UnitTestDATFolder + "Version1TestResults.dat");
            exoplanetArray2 = ReadXML.Read(Constant.UnitTestDATFolder + "Version1TestResults.xml", true);

            Assert.IsNotNull(exoplanetArray);
            Assert.IsNotNull(exoplanetArray2);
            Assert.AreEqual(exoplanetArray.Count, exoplanetArray2.Count);
            Assert.AreEqual(Exoplanets.AreEqual(exoplanetArray, exoplanetArray2), true);
        }
        private bool ValidateUser()
        {
            bool ReturnValue = true;

            User ThisUser = new User();

            ThisUser = UserManagement.GetInstance.GetUserByLoginName(txt_UserID.Text);
            if (ThisUser != null)
            {
                if (ThisUser.UserID <= 0)
                {
                    lbl_UserMessage.Text = ReadXML.GetFailureMessage("FORGOT_USERID");
                    ReturnValue          = false;
                }
            }

            return(ReturnValue);
        }
Exemple #21
0
        protected void btn_Submit_Click(object sender, EventArgs e)
        {
            int ProcReturnValue = (int)MicroEnums.DataOperationResult.Failure;

            if (((Button)sender).Text.Trim().Equals(MicroEnums.DataOperation.Save.GetStringValue()))
            {
                ProcReturnValue = InsertStudentSections();
                if (ProcReturnValue > (int)MicroEnums.DataOperationResult.Success)
                {
                    lbl_TheMessage.Text = ReadXML.GetSuccessMessage("OK_DATA_ADDED");
                    multiview_StudentSections.SetActiveView(InputControls);
                    BindGrid();
                }
                else
                {
                    lbl_TheMessage.Text = ReadXML.GetFailureMessage("KO_DATA_ADDED");
                    BindGrid();
                    multiview_StudentSections.SetActiveView(view_Grid);
                }
            }
            else
            {
                ProcReturnValue = UpdateStudentSections();
                if (ProcReturnValue > (int)MicroEnums.DataOperationResult.Success)
                {
                    lbl_TheMessage.Text = ReadXML.GetSuccessMessage("OK_DATA_UPDATED");
                    multiview_StudentSections.SetActiveView(view_Grid);
                }
                else
                {
                    if (ProcReturnValue == -2)
                    {
                        lbl_TheMessage.Text = ReadXML.GetFailureMessage("KO_DATA_UPDATED_STUDENT_IN_OTHER_SECTION");
                        Reset();
                    }
                    else
                    {
                        lbl_TheMessage.Text = ReadXML.GetFailureMessage("KO_DATA_UPDATED");
                    }
                }
            }

            dialog_Message.Show();
        }
Exemple #22
0
        /// <summary>
        /// Load a RBF layer.
        /// </summary>
        /// <param name="xmlin">The XML to read from.</param>
        /// <returns>The object that was loaded.</returns>
        public IEncogPersistedObject Load(ReadXML xmlin)
        {
            int neuronCount = 0;
            int x           = 0;
            int y           = 0;
            int dimensions  = 1;

            IRadialBasisFunction[] rbfs = new IRadialBasisFunction[0];

            String end = xmlin.LastTag.Name;

            while (xmlin.ReadToTag())
            {
                if (xmlin.IsIt(BasicLayerPersistor.PROPERTY_NEURONS, true))
                {
                    neuronCount = xmlin.ReadIntToTag();
                }
                else if (xmlin.IsIt(BasicLayerPersistor.PROPERTY_X, true))
                {
                    x = xmlin.ReadIntToTag();
                }
                else if (xmlin.IsIt(BasicLayerPersistor.PROPERTY_Y, true))
                {
                    y = xmlin.ReadIntToTag();
                }
                else if (xmlin.IsIt(RadialBasisFunctionLayerPersistor.PROPERTY_RBF,
                                    true))
                {
                    rbfs = LoadAllRBF(xmlin);
                }
                else if (xmlin.IsIt(end, false))
                {
                    break;
                }
            }

            RadialBasisFunctionLayer layer = new RadialBasisFunctionLayer(neuronCount);

            layer.RadialBasisFunction = rbfs;
            layer.X = x;
            layer.Y = y;

            return(layer);
        }
        protected void ddlPayComponent_SelectedIndexChanged(object sender, EventArgs e)
        {
            string       ComponentType       = string.Empty;
            string       ComponentID         = string.Empty;
            bool         CheckVal            = true;
            DropDownList ddl                 = (DropDownList)sender;
            GridViewRow  row                 = (GridViewRow)ddl.NamingContainer;
            DropDownList ddlPayComponent     = ((DropDownList)row.FindControl("ddlPayComponent"));
            DropDownList ddlPayComponentType = ((DropDownList)row.FindControl("ddlPayComponentType"));

            foreach (GridViewRow gr in GridBindEmpPayComponents.Rows)
            {
                Label lblPaycomponentbind = (Label)gr.FindControl("lblPaycomponentbind");
                if (lblPaycomponentbind != null)//Check Weather null or not
                {
                    if (lblPaycomponentbind.Text == ddlPayComponent.SelectedItem.Text)
                    {
                        CheckVal = false;
                    }
                }
            }
            if (CheckVal == true)
            {
                lbl_message.Text = string.Empty;
                if (ddlPayComponent.SelectedValue.Contains("||"))
                {
                    string[] values = ddlPayComponent.SelectedValue.Split(new string[] { "||" }, StringSplitOptions.RemoveEmptyEntries);
                    if (values.Length > 0)
                    {
                        ComponentType = values[0];
                        ComponentID   = values[1];
                        ddlPayComponentType.SelectedValue = ComponentType;
                    }
                }
            }
            else
            {
                dialog_Message.Show();
                lbl_message.Text = ReadXML.GetFailureMessage("EMPLOYEE_DUP_COMPONENT");
                ddlPayComponentType.SelectedIndex = 0;
                ddlPayComponent.SelectedIndex     = 0;
            }
        }
Exemple #24
0
        static void Main(string[] args)
        {
            List <string> ClassesToRemove = new List <string>();

            ClassesToRemove.Add("Equation");
            ClassesToRemove.Add("Geometry");
            ClassesToRemove.Add("Other");

            string fileMap = "C:\\Documents and Settings\\eric\\Desktop\\Statics Study\\StaticsMap_v1.txt";
            Dictionary <string, string> map = GetMapping(fileMap);

            string sketchDir = "C:\\Documents and Settings\\eric\\Desktop\\Statics Study\\Labeled_Sketches\\";

            string[] sketches = Directory.GetFiles(sketchDir, "*.labeled.xml");

            string saveDir = "C:\\Documents and Settings\\eric\\Desktop\\Statics Study\\Labeled_Sketches_no_EGO\\";

            foreach (string sketchFile in sketches)
            {
                Sketch.Sketch    sketch   = new ReadXML(sketchFile).Sketch;
                List <Substroke> toRemove = new List <Substroke>();

                foreach (Substroke stroke in sketch.SubstrokesL)
                {
                    string classification = stroke.FirstLabel;
                    string cls            = map[classification];
                    if (ClassesToRemove.Contains(cls))
                    {
                        toRemove.Add(stroke);
                    }
                }

                foreach (Substroke stroke in toRemove)
                {
                    sketch.RemoveSubstrokeByID(stroke);
                }

                string fileShort = Path.GetFileName(sketchFile);
                string newFile   = saveDir + fileShort;

                new MakeXML(sketch).WriteXML(newFile);
            }
        }
        private void SetValidationMessages()
        {
            ajaxFilteredTextBox_ThirdParty.ValidChars = MicroConstants.VALID_CHAR_NAME;

            regularExpressionValidator_ThirdParty.ValidationExpression = MicroConstants.REGEX_NAME;
            regularExpressionValidator_Amount.ValidationExpression     = MicroConstants.REGEX_NUMBER_GREATERTHANZERO;

            requiredFieldValidator_Accounts.InitialValue    = MicroConstants.DROPDOWNLIST_DEFAULT_ITEMTEXT;
            requiredFieldValidator_PaymentMode.InitialValue = MicroConstants.DROPDOWNLIST_DEFAULT_ITEMTEXT;

            requiredFieldValidator_Accounts.ErrorMessage       = ReadXML.GetGeneralMessage("SELECTION_CAN_NOT_EMPTY", "Account");
            requiredFieldValidator_ThirdParty.ErrorMessage     = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "Third Party Description");
            regularExpressionValidator_ThirdParty.ErrorMessage = ReadXML.GetGeneralMessage("REGEX_NAME");
            requiredFieldValidator_Amount.ErrorMessage         = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "Transaction Amount");
            regularExpressionValidator_Amount.ErrorMessage     = ReadXML.GetGeneralMessage("REGEX_NUMBER_GREATERTHANZERO");
            requiredFieldValidator_PaymentMode.ErrorMessage    = ReadXML.GetGeneralMessage("SELECTION_CAN_NOT_EMPTY", "Payment mode");

            SetFormMessageCSSClass("ValidateMessage");
        }
Exemple #26
0
        protected void btn_Submit_Click(object sender, EventArgs e)
        {
            int ProcReturnValue = (int)MicroEnums.DataOperationResult.Failure;

            if (ValidateFormFields())
            {
                if (((Button)sender).Text.Trim().Equals(MicroEnums.DataOperation.Save.GetStringValue()))
                {
                    ProcReturnValue     = InsertRecord();
                    lbl_TheMessage.Text = GetDataOperationResult(ProcReturnValue, "Employee Profile", MicroEnums.DataOperation.AddNew);
                }
                else
                {
                    ProcReturnValue     = UpdateRecord();
                    lbl_TheMessage.Text = GetDataOperationResult(ProcReturnValue, "Employee Profile", MicroEnums.DataOperation.Edit);
                }

                if (ProcReturnValue > (int)MicroEnums.DataOperationResult.Success)
                {
                    MoveImageFile(PageVariables.TheProfileImage.ImageUrl);
                    ResetTextBoxes();
                }
                else
                {
                    RemoveImageFile(PageVariables.TheProfileImage.ImageUrl);
                }
            }
            else
            {
                lbl_TheMessage.Text       = ReadXML.GetGeneralMessage("KO_IMAGE_NOT_SELECTED");
                img_ProfileImage.ImageUrl = string.Empty;

                if (PageVariables.TheProfileImage != null)
                {
                    RemoveImageFile(PageVariables.TheProfileImage.ImageUrl);
                }
            }

            dialog_Message.Show();
            EnableDisbleProfiles();
            PageVariables.TheProfileImage = null;
            img_ProfileImage.ImageUrl     = string.Empty;
        }
        protected void btn_GeneratePassword_Click(object sender, EventArgs e)
        {
            if (!(this.txtimgcode.Text == HttpContext.Current.Session["CaptchaImageText"].ToString()))
            {
                lit_ErrorMessage.Text = ReadXML.GetGeneralMessage("IMAGE_VERIFY_FAILED", false);
                return;
            }

            User objUser = UserManagement.GetInstance.GetUserByLoginName(txt_UserID.Text);

            lbl_UserMessage.Text  = string.Empty;
            lit_ErrorMessage.Text = string.Empty;
            try
            {
                if (ValidateUser())
                {
                    objUser.Password            = ResetPasswordManagement.GetInstance.GeneratePassword();
                    lbl_DisplayNewPassword.Text = objUser.Password;

                    int ProcReturnValue = ResetPasswordManagement.GetInstance.ChangePassword(objUser);

                    if (ProcReturnValue > (int)MicroEnums.DataOperationResult.Success)
                    {
                    }
                    else
                    {
                        lit_ErrorMessage.Text = ReadXML.GetFailureMessage("PASSWORD_NOT_RESET");
                    }

                    objUser.Password = MicroSecurity.Encrypt(lbl_DisplayNewPassword.Text);

                    int ProcReturnValueUpdate = ChangePasswordManagement.GetInstance.UpdateChangePassword(objUser);

                    if (ProcReturnValueUpdate > (int)MicroEnums.DataOperationResult.Success)
                    {
                        lit_ErrorMessage.Text = ReadXML.GetSuccessMessage("PASSWORD_RESET");
                    }
                }
            }
            catch
            {
            }
        }
        static void Main(string[] args)
        {
            if (args.Length != 2)
            {
                return;
            }

            string[] files = Directory.GetFiles(args[0], args[1]);

            string dirOut = args[0] + "\\Flipped\\";

            if (!Directory.Exists(dirOut))
            {
                Directory.CreateDirectory(dirOut);
            }

            float minT = 3000.0f;

            foreach (string file in files)
            {
                Sketch.Sketch sketch = new ReadXML(file).Sketch;

                if (file.Contains("_P.labeled"))
                {
                    float max = 0f;
                    foreach (Point pt in sketch.Points)
                    {
                        max = Math.Max(max, pt.Y);
                    }

                    max += minT;

                    foreach (Point pt in sketch.Points)
                    {
                        pt.Y = max - pt.Y;
                    }
                }

                MakeXML make = new MakeXML(sketch);
                make.WriteXML(dirOut + Path.GetFileName(file));
            }
        }
        private void SetValidationMessages()
        {
            requiredFieldValidator_ClassName.InitialValue = MicroConstants.DROPDOWNLIST_DEFAULT_ITEMTEXT;
            requiredFieldValidator_ClassName.ErrorMessage = ReadXML.GetGeneralMessage("SELECTION_CAN_NOT_EMPTY", "Class Name");

            requiredFieldValidator_CloseTime.ErrorMessage    = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "CloseTime");
            requiredFieldValidator_ExamFullMark.ErrorMessage = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "Exam Fullmark");
            requiredFieldValidator_PassMark.ErrorMessage     = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", " Exam Passmark");

            requiredFieldValidator_ExamID.InitialValue = MicroConstants.DROPDOWNLIST_DEFAULT_ITEMTEXT;
            requiredFieldValidator_ExamID.ErrorMessage = ReadXML.GetGeneralMessage("SELECTION_CAN_NOT_EMPTY", "ExamID");

            requiredFieldValidator_Invivilator.ErrorMessage  = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "Invivilator");
            requiredFieldValidator_RoomNo.ErrorMessage       = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "RoomNo");
            requiredFieldValidator_SeheduleName.ErrorMessage = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "SeheduleName");
            requiredFieldValidator_StartExam.ErrorMessage    = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "Exam Date");
            requiredFieldValidator_StartTime.ErrorMessage    = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "StartTime");

            requiredFieldValidator_Stream.InitialValue = MicroConstants.DROPDOWNLIST_DEFAULT_ITEMTEXT;
            requiredFieldValidator_Stream.ErrorMessage = ReadXML.GetGeneralMessage("SELECTION_CAN_NOT_EMPTY", "Stream");

            requiredFieldValidator_Subjects.InitialValue = MicroConstants.DROPDOWNLIST_DEFAULT_ITEMTEXT;
            requiredFieldValidator_Subjects.ErrorMessage = ReadXML.GetGeneralMessage("SELECTION_CAN_NOT_EMPTY", "Subjects");

            regularExpressionValidator_CloseExamTime.ValidationExpression = MicroConstants.REGEX_DECIMAL_GREATERTHANZERO;
            regularExpressionValidator_CloseExamTime.ErrorMessage         = ReadXML.GetGeneralMessage("REGEX_TIME_GREATERTHANZERO");
            regularExpressionValidator_ExamStartTime.ValidationExpression = MicroConstants.REGEX_DECIMAL_GREATERTHANZERO;
            regularExpressionValidator_ExamStartTime.ErrorMessage         = ReadXML.GetGeneralMessage("REGEX_TIME_GREATERTHANZERO");
            //regularExpressionValidator_InvigilatorID.ValidationExpression = MicroConstants.REGEX_NUMBER_ONLY;
            //regularExpressionValidator_InvigilatorID.ErrorMessage = ReadXML.GetGeneralMessage("REGEX_NUMBER_ONLY");
            regularExpressionValidator_RoomNo.ValidationExpression = MicroConstants.REGEX_ALPHANUMERIC_MINUS;
            regularExpressionValidator_RoomNo.ErrorMessage         = ReadXML.GetGeneralMessage("REGEX_ALPHANUMERIC_MINUS");

            regularExpressionValidator_StartExam.ValidationExpression = MicroConstants.REGEX_DATE;
            regularExpressionValidator_StartExam.ErrorMessage         = ReadXML.GetGeneralMessage("REGEX_DATE");

            regularExpressionValidator_ExamFullmark.ValidationExpression = MicroConstants.REGEX_NUMBER_ONLY;
            regularExpressionValidator_ExamFullmark.ErrorMessage         = ReadXML.GetGeneralMessage("REGEX_NUMBER_ONLY");

            regularExpressionValidator_PassMark.ValidationExpression = MicroConstants.REGEX_NUMBER_ONLY;
            regularExpressionValidator_PassMark.ErrorMessage         = ReadXML.GetGeneralMessage("REGEX_NUMBER_ONLY");
        }
Exemple #30
0
        private void SetValidationMessages()
        {
            requiredFieldValidator_Reason.ErrorMessage             = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "Reason");
            requiredFieldValidator_AttendanceDate.ErrorMessage     = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "Attandance Date");
            regularExpressionValidator_AttendanceDate.ErrorMessage = ReadXML.GetGeneralMessage("REGEX_DATE");

            regularExpressionValidator_InTime.ValidationExpression = MicroConstants.REGEX_TIME;
            regularExpressionValidator_InTime.ErrorMessage         = ReadXML.GetGeneralMessage("ONLY_12_HOURS_FORMAT");



            regularExpressionValidator_OutTime.ValidationExpression = MicroConstants.REGEX_TIME;
            regularExpressionValidator_OutTime.ErrorMessage         = ReadXML.GetGeneralMessage("ONLY_12_HOURS_FORMAT");


            requiredFieldValidator_InTime.ErrorMessage  = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "InTime");
            requiredFieldValidator_OutTime.ErrorMessage = ReadXML.GetGeneralMessage("FIELD_CAN_NOT_EMPTY", "OutTime");

            SetFormMessageCSSClass("ValidateMessage");
        }