Example #1
0
        private void BindBranchList()
        {
            BranchesDB db = new BranchesDB();

            BranchList.DataSource = db.GetBranchesByZoneID(Int32.Parse(ZoneList.SelectedValue));
            BranchList.DataBind();
        }
Example #2
0
        private void Search(int StartX, int StartY, int TargetX, int TargetY)
        {
            foreach (var item in Map)
            {
                item.IsMoved = false;
            }
            BranchList.Clear();
            OverBranch = null;
            SearchEnd  = false;
            int    MaxSearchNum = MapSizeX * MapSizeY;
            Branch branch       = branchPools.GetItem(null);

            branch.Endx = TargetX;
            branch.Endy = TargetY;
            branch.Add(Map[StartX, StartY]);
            BranchList.Add(branch);
            int Count = 0;

            for (int i = 0; i < MaxSearchNum; i++)
            {
                if (SearchEnd)
                {
                    return;
                }
                //步进
                Count = BranchList.Count;
                for (int j = 0; j < Count; j++)
                {
                    GoNext(BranchList[j]);
                }
            }
        }
Example #3
0
 public void ReverseBranches()
 {
     BranchList.Reverse();
     SetTfsBranches();
     NotifyOfPropertyChange(() => BranchSequence);
     CandidateList.Clear();
 }
 /// <summary>
 /// load a single threaded actions into the designer
 /// </summary>
 /// <param name="actions">actions to be loaded</param>
 protected override void OnLoadActionList(BranchList actions)
 {
     if (actions != null)
     {
         actions.LoadToDesignerAsSingleThread(this);
     }
 }
Example #5
0
        private void MergingMainViewModel_Deactivated(object sender, DeactivationEventArgs e)
        {
            BranchList.Clear();
            CandidateList.Clear();

            _filterTextChangeTimer?.Dispose();
            _filterTextChangeTimer = null;
        }
        public ActionBranch SearchBranchById(UInt32 id)
        {
            BranchList bl = holder.ExportActions();

            if (bl != null)
            {
                return(bl.SearchBranchById(id));
            }
            return(null);
        }
        private void Init()
        {
            SelectedSortColumn = SortColumns[4];

            Filter.Status = _statusList.First();
            if (BranchList?.Any() ?? false)
            {
                Filter.SelectedBranch = BranchList[0];
            }
        }
Example #8
0
        protected override async Task MapEditedItemToEditor(EmployeeJob item)
        {
            await base.MapEditedItemToEditor(item);

            SelectedEmployee   = EmployeeList.First(e => e.Id == item.EmployeeId);
            SelectedJob        = JobList.First(e => e.Id == item.JobId);
            SelectedDepartment = DepartmentList.First(e => e.Id == item.DepartmentId);
            SelectedCompany    = CompanyList.First(e => e.Id == item.CompanyId);
            BranchList         = (await _branchRepository.GetItemsWithDetailsByCompany(item.CompanyId)).ToAsyncObservableCollection();
            SelectedBranch     = BranchList.First(e => e.Id == item.BranchId);
        }
Example #9
0
 public void AddBranch(BranchesView BV)
 {
     using (CMSProjectEntities db = new CMSProjectEntities())
     {
         BranchList branch = new BranchList();
         branch.StreetAddress = BV.StreetAddress;
         branch.City          = BV.City;
         branch.State         = BV.State;
         branch.Pincode       = BV.Pincode;
         branch.Active        = true;
         db.BranchLists.Add(branch);
         db.SaveChanges();
     }
 }
Example #10
0
 public static void Assign(DropDownList oDDList, object objList, SBM_BLC1.Common.Constants.DDL_TYPE dDL_TYPE)
 {
     oDDList.Items.Clear();
     if (Constants.DDL_TYPE.BRANCHLIST.Equals(dDL_TYPE))
     {
         BranchList oBranchList = (BranchList)objList;
         if (oBranchList.ListOfBranch.Count > 0)
         {
             for (int i = 0; i < oBranchList.ListOfBranch.Count; i++)
             {
                 Add(oDDList, oBranchList.ListOfBranch[i].BbCode.Trim(), oBranchList.ListOfBranch[i].BranchID.Trim());
             }
         }
     }
 }
Example #11
0
 public void UpdateBranch(BranchesView BV)
 {
     using (CMSProjectEntities db = new CMSProjectEntities())
     {
         BranchList branch = new BranchList();
         branch.BranchID        = BV.BranchID;
         branch.StreetAddress   = BV.StreetAddress;
         branch.City            = BV.City;
         branch.State           = BV.State;
         branch.Pincode         = BV.Pincode;
         branch.Active          = (bool)BV.Active;
         db.Entry(branch).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
     }
 }
Example #12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session[MtbBillCollection.Global.Definitions.SessionVariable.Value.IsLoggedIn] == null || Convert.ToBoolean(Session[MtbBillCollection.Global.Definitions.SessionVariable.Value.IsLoggedIn]) == false ||
         (MtbBillCollection.Utility.Screen.IsUserPermitedToAccessScreen(Convert.ToInt32(Session[MtbBillCollection.Global.Definitions.SessionVariable.Value.UserTypeId].ToString()), "Register")) == false)
     {
         Response.Redirect("/Default.aspx");
     }
     if (!IsPostBack)
     {
         _authenticationManger.ConnectionString = MtbBillCollection.WebConfigManager.GetCollDBConnString();
         BranchList.DataSource = _authenticationManger.GetBranchList();
         BranchList.DataBind();
         _authenticationManger.ConnectionString = MtbBillCollection.WebConfigManager.GetCollDBConnString();
         UserTypeList.DataSource = _authenticationManger.GetUserTypeList();
         UserTypeList.DataBind();
     }
 }
Example #13
0
        public ActionResult DeleteB(int id)
        {
            DataManager  DM = new DataManager();
            BranchesView BV = new BranchesView();

            BV = DM.GetBranchView(id);
            using (CMSProjectEntities db = new CMSProjectEntities())
            {
                BranchList branch = new BranchList();
                branch.BranchID        = BV.BranchID;
                branch.StreetAddress   = BV.StreetAddress;
                branch.City            = BV.City;
                branch.State           = BV.State;
                branch.Pincode         = BV.Pincode;
                branch.Active          = (bool)BV.Active;
                db.Entry(branch).State = System.Data.Entity.EntityState.Deleted;
                db.SaveChanges();
                return(Json(new { success = true, message = "Deleted Successfully" }, JsonRequestBehavior.AllowGet));
            }
        }
Example #14
0
        /// <summary>
        /// 费用归属部门
        /// </summary>
        /// <param name="assumeBranchId">部门</param>
        /// <param name="assumeGroupId">小组</param>
        /// <param name="assumeShopId">门店</param>
        /// <returns></returns>
        protected string GetCostAttributionDepartment(Guid assumeBranchId, Guid assumeGroupId, Guid assumeShopId)
        {
            var assumeBranchName = string.Empty;
            var assumeGroupName  = string.Empty;
            var assumeShopName   = string.Empty;
            var systemBranchInfo = BranchList.FirstOrDefault(p => p.ID.Equals(assumeBranchId));

            if (systemBranchInfo != null)
            {
                assumeBranchName = systemBranchInfo.Name;
                var groupList      = CacheCollection.Branch.GetSystemBranchListByBranchId(assumeBranchId);
                var firstOrDefault = groupList.FirstOrDefault(p => p.ID.Equals(assumeGroupId));
                if (firstOrDefault != null)
                {
                    assumeGroupName = "-" + firstOrDefault.Name;
                    var filialeInfo = ShopList.FirstOrDefault(p => p.ID.Equals(assumeShopId));
                    if (filialeInfo != null)
                    {
                        assumeShopName = "-" + filialeInfo.Name;
                    }
                }
            }
            return(assumeBranchName + assumeGroupName + assumeShopName);
        }
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context != null && context.Instance != null && provider != null)
            {
                IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
                if (edSvc != null)
                {
                    MethodClass scopeMethod = context.Instance as MethodClass;
                    if (scopeMethod != null)
                    {
                        //this version only edit FinalActions
                        ILimnorDesignPane dp = scopeMethod.Project.GetTypedData <ILimnorDesignPane>(scopeMethod.RootPointer.ClassId);
                        if (dp != null)
                        {
                            //save the method contents
                            BranchList           bl         = scopeMethod.ActionList;
                            string               methodName = scopeMethod.MethodName;
                            ParameterClass       returnType = scopeMethod.ReturnValue;
                            List <ComponentIcon> icons      = scopeMethod.ComponentIconList;

                            //switch method contents
                            scopeMethod.ActionList = scopeMethod.FinalActions.Actions;
                            scopeMethod.SetName("FinalActions");
                            List <ComponentIcon> icons2 = new List <ComponentIcon>();
                            foreach (ComponentIcon ic in icons)
                            {
                                icons2.Add((ComponentIcon)ic.Clone());
                            }
                            foreach (ComponentIconSubscopeVariable ic in scopeMethod.FinalActions.ComponentIconList)
                            {
                                icons2.Add((ComponentIcon)ic.Clone());
                            }
                            scopeMethod.SetComponentIcons(icons2);
                            //
                            Rectangle rc = new Rectangle(Cursor.Position, new Size(32, 232));
                            if (scopeMethod.Owner == null)
                            {
                                scopeMethod.Owner = dp.Loader.GetRootId();
                            }
                            DlgMethod dlg = scopeMethod.CreateBlockScopeMethodEditor(rc, 1);
                            try
                            {
                                dlg.LoadMethod(scopeMethod, EnumParameterEditType.ReadOnly);
                                dlg.Text = string.Format(CultureInfo.InvariantCulture, "Specify final actionsfor {0}", methodName);
                                if (edSvc.ShowDialog(dlg) == DialogResult.OK)
                                {
                                    scopeMethod.FinalActions.Actions = scopeMethod.ActionList;
                                    List <ComponentIconSubscopeVariable> lst = new List <ComponentIconSubscopeVariable>();
                                    foreach (ComponentIcon ic in scopeMethod.ComponentIconList)
                                    {
                                        ComponentIconSubscopeVariable sv = ic as ComponentIconSubscopeVariable;
                                        if (sv != null)
                                        {
                                            lst.Add(sv);
                                        }
                                    }
                                    scopeMethod.FinalActions.ComponentIconList = lst;
                                    XmlObjectWriter xw = dp.Loader.Writer;
                                    xw.WriteObject(scopeMethod.FinalActions.DataXmlNode, scopeMethod.FinalActions, null);
                                    value = scopeMethod.FinalActions;
                                }
                            }
                            catch (Exception err)
                            {
                                MathNode.LogError(DesignerException.FormExceptionText(err));
                            }
                            finally
                            {
                                //restore method contents
                                scopeMethod.SetName(methodName);
                                scopeMethod.ActionList = bl;
                                scopeMethod.SetComponentIcons(icons);
                                scopeMethod.ExitEditor();
                            }
                        }
                    }
                }
            }
            return(value);
        }
Example #16
0
        void miDelete_Click(object sender, EventArgs e)
        {
            LocalVariable  lv   = this.ClassPointer as LocalVariable;
            List <IAction> acts = lv.RootPointer.GetRelatedActions(lv.MemberId);
            bool           bOK  = (acts.Count == 0);

            if (bOK)
            {
                MethodDesignerHolder mdh = MethodViewer;
                if (mdh != null)
                {
                    BranchList bl = mdh.ActionList;
                    if (bl != null)
                    {
                        Dictionary <UInt32, IAction> actions = new Dictionary <uint, IAction>();
                        bl.GetActionsUseLocalVariable(lv.MemberId, actions);
                        if (actions.Count > 0)
                        {
                            foreach (KeyValuePair <UInt32, IAction> kv in actions)
                            {
                                acts.Add(kv.Value);
                            }
                            bOK = false;
                        }
                    }
                }
            }
            if (!bOK)
            {
                List <ObjectTextID> objs = new List <ObjectTextID>();
                foreach (IAction a in acts)
                {
                    objs.Add(new ObjectTextID("Action", "", a.Display));
                }
                dlgObjectUsage dlg = new dlgObjectUsage();
                dlg.LoadData("There are actions using this object. These actions must be removed before this object can be removed.", "Remove object", objs);
                //currently no OK will be returned
                bOK = (dlg.ShowDialog(this.FindForm()) == DialogResult.OK);
                if (bOK)
                {
                    IList <MethodDiagramViewer> l = MethodViewer.GetViewer();
                    foreach (MethodDiagramViewer mv in l)
                    {
                        //remove local/constructor actions belong to it
                        List <IComponent> avList = new List <IComponent>();
                        for (int i = 0; i < mv.Controls.Count; i++)
                        {
                            ActionViewer av = mv.Controls[i] as ActionViewer;
                            if (av != null)
                            {
                                foreach (IAction a in acts)
                                {
                                    if (av.ActionObject.ContainsActionId(a.ActionId))
                                    {
                                        avList.Add(av);
                                    }
                                }
                            }
                        }
                        if (avList.Count > 0)
                        {
                            mv.DeleteComponents(avList.ToArray());
                        }
                    }
                }
            }
            if (bOK)
            {
                MethodViewer.RemoveLocalVariable(this);
                RemoveLabel();
                Control p = this.Parent;
                if (p != null)
                {
                    p.Controls.Remove(this);
                }
                MethodViewer.Changed = true;
            }
        }
        public void ReloadActions()
        {
            ActionGroupDesignerHolder holder = DesignerHolder as ActionGroupDesignerHolder;
            AB_Squential actions             = holder.Actions;
            bool         b = holder.DisableUndo;

            holder.DisableUndo = true;
            holder.ClearAllComponent();
            Controls.Clear();

            BranchList bl = actions.ActionList;

            LoadActions(bl);

            //load component icons
            List <ComponentIcon> iconList = IconList;

            if (iconList == null)
            {
                iconList = new List <ComponentIcon>();
            }
            List <ComponentIcon> invalids = new List <ComponentIcon>();

            foreach (ComponentIcon ci in iconList)
            {
                if (ci.ClassPointer == null)
                {
                    invalids.Add(ci);
                }
            }
            foreach (ComponentIcon ci in invalids)
            {
                iconList.Remove(ci);
            }
            //find root
            ClassPointer  root = holder.Designer.GetRootId();
            List <IClass> objList;

            if (Method.IsStatic)
            {
                objList = new List <IClass>();
            }
            else
            {
                objList = root.GetClassList();
            }
            SubMethodInfoPointer smi = null;

            if (Method.SubMethod.Count > 0)
            {
                smi = Method.SubMethod.Peek() as SubMethodInfoPointer;
            }
            //initialize existing icons, creating ComponentIcon.ClassPointer
            foreach (ComponentIcon ic in iconList)
            {
                ic.SetDesigner(holder.Designer);
                ComponentIconPublic cip = ic as ComponentIconPublic;
                if (cip == null)
                {
                    ComponentIconLocal lv = ic as ComponentIconLocal;
                    if (lv != null)
                    {
                        lv.ReadOnly = true;
                        if (!ParentEditor.LocalVariableDeclared(lv))
                        {
                            lv.ScopeGroupId = actions.BranchId;
                        }
                    }
                    else
                    {
                    }
                    if (smi != null)
                    {
                        ParameterClassSubMethod sm = ic.ClassPointer as ParameterClassSubMethod;
                        if (sm != null)
                        {
                            if (sm.ActionId == 0)
                            {
                                sm.ActionId = smi.ActionOwner.ActionId;
                            }
                            ParameterClass pc = ic.ClassPointer as ParameterClass;
                            if (pc != null && pc.ObjectType != null)
                            {
                                if (pc.ObjectType.IsGenericParameter)
                                {
                                    if (pc.ConcreteType == null)
                                    {
                                        if (smi.ActionOwner.MethodOwner != null)
                                        {
                                            CustomPropertyPointer cpp = smi.ActionOwner.MethodOwner.Owner as CustomPropertyPointer;
                                            if (cpp != null)
                                            {
                                                pc.ConcreteType = cpp.GetConcreteType(pc.ObjectType);
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                else
                {
                }
            }
            //add new public component icons
            int x0 = 10;
            int y0 = 30;
            int x  = x0;
            int y  = y0;
            int dx = 10;
            int dy = 10;

            foreach (IClass c in objList)
            {
                bool bFound = false;
                foreach (ComponentIcon ic in iconList)
                {
                    if (ic.ClassPointer == null)
                    {
                    }
                    else
                    {
                        if (ic.ClassPointer.IsSameObjectRef(c))
                        {
                            bFound = true;
                            break;
                        }
                    }
                }
                if (!bFound)
                {
                    ComponentIconPublic cip = new ComponentIconPublic(holder.Designer, c, Method);
                    cip.Location = new Point(x, y);
                    y           += dy;
                    y           += cip.Height;
                    if (y >= this.Height)
                    {
                        y  = y0;
                        x += dx;
                        x += cip.Width;
                    }
                    iconList.Add(cip);
                }
            }
            //add new local component icons
            List <ComponentIcon> picons = ParentEditor.IconList;

            foreach (ComponentIcon lv in picons)
            {
                ComponentIconPublic cip0 = lv as ComponentIconPublic;
                if (cip0 == null)
                {
                    bool bFound = false;
                    foreach (ComponentIcon ic in iconList)
                    {
                        if (ic.ClassPointer.IsSameObjectRef(lv.ClassPointer))
                        {
                            bFound = true;
                            break;
                        }
                    }
                    if (!bFound)
                    {
                        ComponentIcon cip = (ComponentIcon)lv.Clone();
                        cip.SetDesigner(holder.Designer);
                        cip.ReadOnly = true;
                        cip.Location = new Point(x, y);
                        y           += dy;
                        y           += cip.Height;
                        if (y >= this.Height)
                        {
                            y  = y0;
                            x += dx;
                            x += cip.Width;
                        }
                        iconList.Add(cip);
                    }
                }
            }
            //add parameters
            if (Method.ParameterCount > 0)
            {
                foreach (ParameterClass c in Method.Parameters)
                {
                    bool bFound = false;
                    foreach (ComponentIcon ic in iconList)
                    {
                        if (ic.ClassPointer.IsSameObjectRef(c))
                        {
                            bFound = true;
                            break;
                        }
                    }
                    if (!bFound)
                    {
                        ComponentIconParameter cip = new ComponentIconParameter(holder.Designer, c, Method);
                        cip.Location = new Point(x, y);
                        y           += dy;
                        y           += cip.Height;
                        if (y >= this.Height)
                        {
                            y  = y0;
                            x += dx;
                            x += cip.Width;
                        }
                        iconList.Add(cip);
                    }
                }
            }
            //add action parameters
            ISingleAction sa = actions as ISingleAction;

            if (sa != null && sa.ActionData != null && sa.ActionData.ActionMethod != null && sa.ActionData.ActionMethod.MethodPointed.MethodParameterTypes != null)
            {
                List <ParameterClass> plist = new List <ParameterClass>();
                SubMethodInfoPointer  smp   = sa.ActionData.ActionMethod.MethodPointed as SubMethodInfoPointer;
                if (smp != null)
                {
                    foreach (ParameterClassSubMethod p in smp.Parameters)
                    {
                        plist.Add(p);
                    }
                }
                else
                {
                    foreach (IParameter p in sa.ActionData.ActionMethod.MethodPointed.MethodParameterTypes)
                    {
                        ParameterClass c = p as ParameterClass;
                        if (c == null)
                        {
                            try
                            {
                                c = sa.ActionData.ActionMethod.MethodPointed.GetParameterType(p.ParameterID) as ParameterClass;
                                if (c == null)
                                {
                                    DesignUtil.WriteToOutputWindowAndLog("Cannot get ParameterClass {0} for method {1} of {2}.", p.Name, sa.ActionData.ActionMethod.MethodName, sa.ActionData.ActionMethod.MethodPointed.GetType());
                                    continue;
                                }
                            }
                            catch (Exception errp)
                            {
                                DesignUtil.WriteToOutputWindowAndLog(errp, "Cannot get ParameterClass {0} for method {1} of {2}", p.Name, sa.ActionData.ActionMethod.MethodName, sa.ActionData.ActionMethod.MethodPointed.GetType());
                                continue;
                            }
                        }
                        if (c != null)
                        {
                            plist.Add(c);
                        }
                    }
                }
                foreach (ParameterClass c in plist)
                {
                    bool bFound = false;
                    foreach (ComponentIcon ic in iconList)
                    {
                        if (ic.ClassPointer.IsSameObjectRef(c))
                        {
                            ParameterClass c0 = ic.ClassPointer as ParameterClass;
                            c0.ReadOnly    = true;
                            c0.Description = c.Description;
                            bFound         = true;
                            break;
                        }
                    }
                    if (!bFound)
                    {
                        ComponentIcon         cip;
                        ActionBranchParameter abp = c as ActionBranchParameter;
                        if (abp != null)
                        {
                            cip = new ComponentIconActionBranchParameter(actions);
                            cip.ClassPointer = abp;
                            cip.SetDesigner(holder.Designer);
                        }
                        else
                        {
                            cip = new ComponentIconParameter(holder.Designer, c, Method);
                        }
                        cip.Location = new Point(x, y);
                        y           += dy;
                        y           += cip.Height;
                        if (y >= this.Height)
                        {
                            y  = y0;
                            x += dx;
                            x += cip.Width;
                        }
                        iconList.Add(cip);
                    }
                }
            }
            //add icons
            holder.AddControlsToIconsHolder(iconList.ToArray());
            foreach (ComponentIcon ic in iconList)
            {
                ComponentIconPublic cip = ic as ComponentIconPublic;
                if (cip == null)
                {
                    if (ic.Left < 0)
                    {
                        ic.Left = 2;
                    }
                    if (ic.Top < 0)
                    {
                        ic.Top = 2;
                    }
                    ic.BringToFront();
                    ic.RefreshLabelPosition();
                    ic.RefreshLabelText();
                    ComponentIconLocal cil = ic as ComponentIconLocal;
                    if (cil != null)
                    {
                        cil.HookNameChecker();
                    }
                }
            }
            //}
            InitializeInputTypes();
            ValidateControlPositions();
            holder.DisableUndo = b;
        }
 public UndoActionGroupState(IUndoHost host, IMethodDiagram editor, BranchList actions)
 {
     _actions = (BranchList)actions.Clone();
     _host    = host;
     _editor  = editor;
 }
Example #19
0
 private Questionnaire()
 {
     Questions = new QuestionList();
     Bosses = new BossList();
     Branches = new BranchList();
 }
 public override void LinkJumpedBranches(BranchList branches)
 {
 }
Example #21
0
        protected void addEmployeeButton_Click(object sender, EventArgs e)
        {
            try
            {
                string myConnectionString = "";

                connectionInsert1 = new MySqlConnection(myConnectionString);
                connectionInsert1.Open();

                MySqlCommand commandInsert1 = new MySqlCommand("INSERT INTO Address(province, district, street, zipcode) "
                                                               + "VALUES(@province, @district, @street, @zipcode)", connectionInsert1);
                commandInsert1.Parameters.Add(new MySqlParameter("@province", provinceTextBox.Text));
                commandInsert1.Parameters.Add(new MySqlParameter("@district", districtTextBox.Text));
                commandInsert1.Parameters.Add(new MySqlParameter("@street", streetTextBox.Text));
                commandInsert1.Parameters.Add(new MySqlParameter("@zipcode", zipcodeTextBox.Text));
                commandInsert1.ExecuteNonQuery();

                string addressId = " ";

                connectionSelect1 = new MySqlConnection(myConnectionString);
                connectionSelect1.Open();

                MySqlCommand    commandSelect1 = new MySqlCommand("SELECT MAX(address_id) AS address_id FROM Address", connectionSelect1);
                MySqlDataReader reader1        = commandSelect1.ExecuteReader();

                if (reader1.HasRows)
                {
                    if (reader1.Read())
                    {
                        addressId = reader1["address_id"].ToString();
                    }
                }

                connectionInsert2 = new MySqlConnection(myConnectionString);
                connectionInsert2.Open();

                MySqlCommand commandInsert2 = new MySqlCommand("INSERT INTO Employee(address_id, branch_id, identity_number, first_name, last_name, "
                                                               + "phone, mail, password, salary, access_level) VALUES(@address_id, @branch_id, @identity_number, @first_name, @last_name, @phone, "
                                                               + " @mail, @password, @salary, @access_level)", connectionInsert2);
                commandInsert2.Parameters.Add(new MySqlParameter("@address_id", addressId));
                commandInsert2.Parameters.Add(new MySqlParameter("@branch_id", BranchList.SelectedIndex));
                commandInsert2.Parameters.Add(new MySqlParameter("@identity_number", employeeIDTextBox.Text));
                commandInsert2.Parameters.Add(new MySqlParameter("@first_name", employeeFNameTextBox.Text));
                commandInsert2.Parameters.Add(new MySqlParameter("@last_name", employeeLNameTextBox.Text));
                commandInsert2.Parameters.Add(new MySqlParameter("@phone", employeePhoneTextBox.Text));
                commandInsert2.Parameters.Add(new MySqlParameter("@mail", employeeMailTextBox.Text));
                commandInsert2.Parameters.Add(new MySqlParameter("@password", employeePasswordTextBox.Text));
                commandInsert2.Parameters.Add(new MySqlParameter("@salary", salaryTextBox.Text));
                commandInsert2.Parameters.Add(new MySqlParameter("@access_level", accessLevelList.SelectedValue));
                commandInsert2.ExecuteNonQuery();


                string employeeId = " ";

                connectionSelect2 = new MySqlConnection(myConnectionString);
                connectionSelect2.Open();

                MySqlCommand    commandSelect2 = new MySqlCommand("SELECT MAX(employee_id) AS employee_id FROM Employee", connectionSelect2);
                MySqlDataReader reader2        = commandSelect2.ExecuteReader();

                if (reader2.HasRows)
                {
                    if (reader2.Read())
                    {
                        employeeId = reader2["employee_id"].ToString();
                    }
                }


                Response.Write("<div class='alert alert-primary alert-dismissible fade show' role='alert'>"
                               + "Personel eklenmiştir."
                               + "<button type = 'button' class='close' data-dismiss='alert' aria-label='Close'>"
                               + "<span aria-hidden='true'>&times;</span>"
                               + "</button>"
                               + "</div>");
            }
            catch (MySqlException ex)
            {
            }
            finally
            {
                provinceTextBox.Text                 = districtTextBox.Text = streetTextBox.Text = zipcodeTextBox.Text =
                    employeeIDTextBox.Text           = employeeFNameTextBox.Text = employeeLNameTextBox.Text = employeePhoneTextBox.Text =
                        employeePasswordTextBox.Text = employeePasswordTextBox2.Text = salaryTextBox.Text = string.Empty;
                BranchList.ClearSelection();
                accessLevelList.ClearSelection();

                connectionInsert1.Close();
                connectionInsert2.Close();
                connectionSelect1.Close();
                connectionSelect2.Close();
            }
        }
 public override void RemoveOutOfGroupBranches(BranchList branches)
 {
 }
Example #23
0
 protected override void OnAfterRead()
 {
     //server actions are saved with MethodClass
     //when editing, ActionList is set to corresponding actions
     _branchListServer = ActionList;
 }
Example #24
0
        static int Execute(Instruction instr)
        {
            //First must set the operands
            //Most will use RS and RT, which are EX.A and EX.B
            int left  = ctx.pipelineregs.RF__EX_A;
            int right = ctx.pipelineregs.RF__EX_B;

            if (instr.op == "ADDU" || instr.op == "SUBU" || instr.op == "ADDIU") //Unsigned instr, convert to bits and interpret as unsigned
            {
                //Left will still be an int, but its bit representation must be interpreted as uint, so we will convert the int to bits, those bits to uint, then that uint back to an int
                left  = (int)BitsToUInt(IntToBits(left));
                right = (int)BitsToUInt(IntToBits(right));
            }
            if (TwoRegAndImmediateList.Contains(instr.op)) //Want to use immediate
            {
                right = instr.imm;
            }
            else if (TwoRegAndShamtList.Contains(instr.op))
            {
                left  = (int)instr.shamt;
                right = ctx.registers[(int)instr.rt];
            }
            else if (instr.op == "SW" || instr.op == "LW")
            {
                right = instr.offset;
            }
            //Now must check for forwarding which can overwrite previously set values
            if (ctx.forwardvalues.Use_DF_To_EX_Left)
            {
                left = ctx.forwardvalues.DF_To_EX_Left_Value;
            }
            else if (ctx.forwardvalues.Use_DS_To_EX_Left)
            {
                left = ctx.forwardvalues.DS_To_EX_Left_Value;
            }
            else if (ctx.forwardvalues.Use_WB_To_EX_Left)
            {
                left = ctx.forwardvalues.WB_To_EX_Left_Value;
            }
            if (ctx.forwardvalues.Use_DF_To_EX_Right)
            {
                right = ctx.forwardvalues.DF_To_EX_Right_Value;
            }
            else if (ctx.forwardvalues.Use_DS_To_EX_Right)
            {
                right = ctx.forwardvalues.DS_To_EX_Right_Value;
            }
            else if (ctx.forwardvalues.Use_WB_To_EX_Right)
            {
                right = ctx.forwardvalues.WB_To_EX_Right_Value;
            }
            //Now perform operation
            int a = left;
            int b = right;

            if (instr.op == "ADD" || instr.op == "ADDI" || instr.op == "ADDU" || instr.op == "ADDIU" || instr.op == "SW" || instr.op == "LW")
            {
                return(a + b);
            }
            else if (instr.op == "SUB" || instr.op == "SUBU")
            {
                return(a - b);
            }
            else if (instr.op == "AND")
            {
                return(a & b);
            }
            else if (instr.op == "OR")
            {
                return(a | b);
            }
            else if (instr.op == "XOR")
            {
                return(a ^ b);
            }
            else if (instr.op == "NOR")
            {
                return(~(a | b));
            }
            else if (instr.op == "SLL")
            {
                return(b << a);
            }
            else if (instr.op == "SRA")
            {
                return(b >> a);
            }
            else if (instr.op == "SRL")
            {
                return((int)((uint)b >> a));
            }
            else if (instr.op == "SLTI" || instr.op == "SLT")
            {
                return(a < b ? 1 : 0);
            }
            //Jumps and branches
            else if (instr.op == "JR" || instr.op == "J")
            {
                ctx.takebranch = true;
                return((int)instr.addr);
            }
            else if (BranchList.Contains(instr.op))
            {
                ctx.takebranch = ResolveBranch(instr, left, right);
                return(instr.pc + 4 + instr.offset);
            }
            return(0);
        }
Example #25
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context != null && context.Instance != null && provider != null)
            {
                IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
                if (edSvc != null)
                {
                    ExceptionHandlerList.PropertyDescriptorExceptionHandler pd = context.PropertyDescriptor as ExceptionHandlerList.PropertyDescriptorExceptionHandler;
                    if (pd == null)
                    {
                        throw new DesignerException("Property descriptor [{0}] is not a PropertyDescriptorExceptionHandler", context.PropertyDescriptor == null ? "null" : context.PropertyDescriptor.GetType().FullName);
                    }
                    ExceptionHandler     eh       = pd.Handler;
                    BranchList           branches = eh.ActionList;
                    ExceptionHandlerList ehs      = context.Instance as ExceptionHandlerList;
                    if (ehs != null)
                    {
                        MethodClass scopeMethod = ehs.OwnerMethod;
                        if (scopeMethod != null)
                        {
                            if (branches == null)
                            {
                                branches = new BranchList(eh, new List <ActionBranch>());
                            }

                            ILimnorDesignPane dp = scopeMethod.Project.GetTypedData <ILimnorDesignPane>(scopeMethod.RootPointer.ClassId);
                            if (dp != null)
                            {
                                //save the method contents
                                BranchList           bl         = scopeMethod.ActionList;
                                string               methodName = scopeMethod.MethodName;
                                ParameterClass       returnType = scopeMethod.ReturnValue;
                                List <ComponentIcon> icons      = scopeMethod.ComponentIconList;

                                //switch method contents
                                scopeMethod.ActionList = branches;
                                scopeMethod.SetName(string.Format(CultureInfo.InvariantCulture, "HandlerFor{0}", eh.ExceptionType.Name));
                                scopeMethod.ReturnValue = null;
                                List <ComponentIcon> icons2 = new List <ComponentIcon>();
                                foreach (ComponentIcon ic in icons)
                                {
                                    icons2.Add((ComponentIcon)ic.Clone());
                                }
                                foreach (ComponentIconSubscopeVariable ic in eh.ComponentIconList)
                                {
                                    icons2.Add((ComponentIcon)ic.Clone());
                                }
                                icons2.Add(eh.ExceptionObject);
                                scopeMethod.SetComponentIcons(icons2);
                                //
                                Rectangle rc = new Rectangle(Cursor.Position, new Size(32, 232));
                                if (scopeMethod.Owner == null)
                                {
                                    scopeMethod.Owner = dp.Loader.GetRootId();
                                }
                                DlgMethod dlg = scopeMethod.CreateBlockScopeMethodEditor(rc, eh.ExceptionType.MemberId);
                                try
                                {
                                    dlg.LoadMethod(scopeMethod, EnumParameterEditType.ReadOnly);
                                    dlg.Text = string.Format(CultureInfo.InvariantCulture, "Create exception handler for {0}", eh.ExceptionType.Name);
                                    if (edSvc.ShowDialog(dlg) == DialogResult.OK)
                                    {
                                        bool delete = false;
                                        eh.ActionList = scopeMethod.ActionList;
                                        if (eh.ActionList.Count == 0)
                                        {
                                            if (MessageBox.Show(string.Format(CultureInfo.CurrentUICulture, "Do you want to remove this exception [{0}]?", eh.ExceptionType.Name), "Capture exception", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                                            {
                                                delete = true;
                                            }
                                        }
                                        if (delete)
                                        {
                                            scopeMethod.RemoveExceptionCapture(eh);
                                        }
                                        else
                                        {
                                            List <ComponentIconSubscopeVariable> lst = new List <ComponentIconSubscopeVariable>();
                                            foreach (ComponentIcon ic in scopeMethod.ComponentIconList)
                                            {
                                                ComponentIconSubscopeVariable sv = ic as ComponentIconSubscopeVariable;
                                                if (sv != null)
                                                {
                                                    lst.Add(sv);
                                                }
                                            }
                                            eh.ComponentIconList = lst;
                                            scopeMethod.RootPointer.SaveMethod(scopeMethod, eh);
                                        }
                                    }
                                }
                                catch (Exception err)
                                {
                                    MathNode.LogError(DesignerException.FormExceptionText(err));
                                }
                                finally
                                {
                                    //restore method contents
                                    scopeMethod.SetName(methodName);
                                    scopeMethod.ActionList  = bl;
                                    scopeMethod.ReturnValue = returnType;
                                    scopeMethod.SetComponentIcons(icons);
                                    scopeMethod.ExitEditor();
                                }
                            }
                        }
                    }
                }
            }
            return(value);
        }
 public override void LinkActions(BranchList branches)
 {
 }