Пример #1
0
        private void Cv_Edited(object sender, EditEventArgs e)
        {
            var dialog = new AddHairLengthDialog(mHairBl, e.HairLenght);

            dialog.OkClicked += Dialog_OkClicked;
            Navigation.PushPopupAsync(dialog);
        }
Пример #2
0
        protected virtual void UpdateBEResponseStatus(EditEventArgs e, string plmIdFieldName, string status)
        {
            SqlCommand command = (SqlCommand)e.Command;
            Field      field   = (e.View.Fields.ContainsKey(plmIdFieldName) ? e.View.Fields[plmIdFieldName] : null);
            string     plmId   = field.GetValue(e.PrevRow);

            if (command != null && field != null && plmId != string.Empty)
            {
                SqlAccess sqlAccess                     = new SqlAccess();
                string    v_BETechnicalViewName         = "v_BETechnical";
                Dictionary <string, Durados.View> views = e.View.Database.Views;

                if (!views.ContainsKey(v_BETechnicalViewName))
                {
                    throw new DuradosException("BETechnical View is missing");
                }
                View v_BETechnicalView             = (View)views[v_BETechnicalViewName];
                Dictionary <string, object> values = new Dictionary <string, object>();

                // find its name
                string BEResponseStatusFieldName = "FK_BEResponseStatus_v_BETechnical_Parent";
                values.Add(BEResponseStatusFieldName, status);

                string   id             = field.GetValue(e.PrevRow);
                string[] beTechnicalIds = GetBETechnicalIds(plmId, command);

                foreach (string beTechnicalId in beTechnicalIds)
                {
                    sqlAccess.Edit(v_BETechnicalView, values, beTechnicalId, null, null, null, null, (SqlCommand)e.Command, e.History, e.UserId);
                }
            }
        }
Пример #3
0
        protected override void AfterEditBeforeCommit(EditEventArgs e)
        {
            string usernameFieldName = GetUsernameFieldName();

            if (e.Values.ContainsKey(usernameFieldName) && e.Values.ContainsKey("Email"))
            {
                string username = e.Values["Username"].ToString();
                System.Web.Security.MembershipUser currentUser = System.Web.Security.Membership.Provider.GetUser(username, false /* userIsOnline */);
                string email = e.Values["Email"].ToString();

                currentUser.Email = email;
                System.Web.Security.Membership.Provider.UpdateUser(currentUser);

                ChangePassword(e);
            }

            if (e.Values.ContainsKey("IsApproved"))
            {
                if (e.PrevRow != null)
                {
                    Field field          = e.View.Fields["IsApproved"];
                    bool  isApproved     = Convert.ToBoolean(e.Values["IsApproved"].ToString());
                    bool  prevIsApproved = (bool)e.PrevRow["IsApproved"];

                    if (isApproved != prevIsApproved)
                    {
                        string username = e.PrevRow["Username"].ToString();
                        System.Web.Security.MembershipUser user = System.Web.Security.Membership.Provider.GetUser(username, true);
                        user.IsApproved = isApproved;
                        System.Web.Security.Membership.UpdateUser(user);
                    }
                }
            }
            base.AfterEditBeforeCommit(e);
        }
Пример #4
0
        private void UpdatePLMBEStatusToBeforeCR(EditEventArgs e, int?newPLMId)
        {
            string plmBEStatusFieldName = "FK_PLMBEStatus_v_PLM_Parent";

            Field field = (e.View.Fields.ContainsKey(plmBEStatusFieldName) ? e.View.Fields[plmBEStatusFieldName] : null);

            string prevPlmBEStatusId = field.GetValue(e.PrevRow);

            if (newPLMId.HasValue && field != null && prevPlmBEStatusId != string.Empty)
            {
                SqlAccess sqlAccess = new SqlAccess();

                string v_PLMViewName = "v_PLM";
                Dictionary <string, Durados.View> views = e.View.Database.Views;

                if (!views.ContainsKey(v_PLMViewName))
                {
                    throw new DuradosException("v_PLM View is missing");
                }
                View v_PLMView = (View)views[v_PLMViewName];
                Dictionary <string, object> values = new Dictionary <string, object>();


                values.Add(plmBEStatusFieldName, prevPlmBEStatusId);

                string id = newPLMId.Value.ToString(); //field.View.GetPkValue(e.PrevRow).

                sqlAccess.Edit(v_PLMView, values, id, null, null, null, null, (SqlCommand)e.Command, e.History, e.UserId);
            }
        }
Пример #5
0
        private void editEmployeeBtn_Click(object sender, EventArgs e)
        {
            string   name     = nameTextBox.Text;
            string   surname  = surnameTextBox.Text;
            string   lastName = lastNameTextBox.Text;
            string   egn      = egnTextBox.Text;
            string   position = positionComboBox.Text;
            DateTime hireDate = hireDateTimePicker.Value;

            if (IsValidName(name, "Name") &&
                IsValidName(surname, "Surname") &&
                IsValidName(lastName, "Last Name") &&
                IsValidEgn(egn) &&
                IsValidPosition(position) &&
                IsValidHireDate(hireDate, (DateTime)employee.EmployeeHiredate))
            {
                employee.EmployeeName     = name;
                employee.EmployeeSurname  = surname;
                employee.EmployeeLastname = lastName;
                employee.EmployeeEgn      = egn;
                employee.EmployeePosition = position;
                employee.EmployeeHiredate = hireDate;

                EditEventArgs args = new EditEventArgs();
                args.RowIndex = rowIndex;
                args.Employee = employee;

                EditEventHandler?.Invoke(this, args);
                this.Close();
            }
        }
Пример #6
0
        protected override void BeforeEdit(EditEventArgs e)
        {
            if (User == null || User.Identity == null || User.Identity.Name == null)
            {
                throw new AccessViolationException();
            }

            int?userID = Durados.Web.Mvc.Specifics.DataAccess.User.GetUserID(User.Identity.Name);

            if (!userID.HasValue)
            {
                throw new AccessViolationException();
            }

            int productID = Convert.ToInt32(e.Values["FK_Bug_Product_Parent"]);

            int?companyID = Durados.Web.Mvc.Specifics.DataAccess.Product.GetCompanyID(productID);

            if (!companyID.HasValue)
            {
                throw new AccessViolationException();
            }

            e.Values.Add("FK_Bug_User_Parent", userID.ToString());
            e.Values.Add("ModifiedDate", DateTime.Now.ToString());
            e.Values.Add("FK_Bug_Company_Parent", companyID.Value.ToString());

            base.BeforeEdit(e);
        }
Пример #7
0
        protected override void AfterCompleteStepAfterCommit(EditEventArgs e)
        {
            base.AfterCompleteStepAfterCommit(e);

            int plmId = Convert.ToInt32(e.PrimaryKey);

            using (SqlConnection connection = new SqlConnection(e.View.Database.ConnectionString))
            {
                connection.Open();
                using (SqlCommand command = new SqlCommand())
                {
                    command.Connection = connection;
                    if (HasPLMBEStatusChangedFromCRToPOR(e))
                    {
                        ExecProc("Durados_Allegro_PLM_CR_to_POR_State", command, "@PLMId", plmId);
                    }
                }
            }
            int?newPLMId;

            Duplicate(e, out newPLMId);

            if (HasPLMBEStatusChangedToCR(e))
            {
                UpdatePLMBEStatusToBeforeCR(e, newPLMId);
            }
        }
Пример #8
0
        private void editTaskBtn_Click(object sender, EventArgs e)
        {
            int    taskHours = 0;
            string task      = taskTextBox.Text;

            decimal employeeMaxWorkingHoursOnProject = project.ProjectMaxhours != null
            ? (decimal)project.ProjectMaxhours
            : (decimal)int.MaxValue;
            decimal employeeCurrentWorkingHoursOnProject =
                this.employee.ProjectHours.Where(ph => ph.ProjectId == project.ProjectId).Sum(ph => ph.ProjectHours1) - this.task.ProjectHours1;

            if (IsValidTask(task) && IsValidHours(ref taskHours, employeeCurrentWorkingHoursOnProject, employeeMaxWorkingHoursOnProject))
            {
                this.task.ProjectTask   = task;
                this.task.ProjectHours1 = taskHours;

                var args = new EditEventArgs()
                {
                    RowIndex = this.rowIndex,
                    Task     = this.task
                };

                EditEventHandler?.Invoke(this, args);
                this.Close();
            }
        }
Пример #9
0
        protected override void BeforeEdit(EditEventArgs e)
        {
            string[] views = new string[4] {
                ShadeViews.Job.ToString(), ShadeViews.V_Contact.ToString(), ShadeViews.v_Proposal.ToString(), ShadeViews.Organization.ToString()
            };
            if (views.Contains(e.View.Name))
            {
                Durados.ParentField parentField = e.View.GetParentField("d_LastUpdatedBy");
                if (parentField != null)
                {
                    string fieldName = parentField.Name;
                    if (!e.Values.ContainsKey(fieldName))
                    {
                        e.Values.Add(fieldName, ((Database)e.View.Database).GetUserID());
                    }
                    else
                    {
                        e.Values[fieldName] = ((Database)e.View.Database).GetUserID();
                    }
                }

                if (!e.Values.ContainsKey("d_LastUpdateDate"))
                {
                    e.Values.Add("d_LastUpdateDate", DateTime.Now.ToString());
                }
                else
                {
                    e.Values["d_LastUpdateDate"] = DateTime.Now.ToString();
                }
            }
            base.BeforeEdit(e);
        }
Пример #10
0
        protected override void AfterEditAfterCommit(EditEventArgs e)
        {
            base.AfterEditAfterCommit(e);

            //call the site to refresh the content
            Http.AsynWebRequest(RefreshUrl, new ErrorHandling());
        }
Пример #11
0
 protected override void OnAfterEditDetail(EditEventArgs arg)
 {
     if (arg.type == OptType.Add)
     {
         ResetUserPassword(arg.row["UserCode"].ToString());
     }
     base.OnAfterEditDetail(arg);
 }
Пример #12
0
        private void m_valueComboBox_CreatingEditor(object sender, EditEventArgs e)
        {
            var comboBox       = (ComboBox)e.Control;
            var closedFeatNode = (ClosedFeatureNode)e.Node.Tag;

            comboBox.Items.Add(new SymbolicValue(null));
            comboBox.Items.AddRange(closedFeatNode.Feature.ValuesOC.OrderBy(v => v.Abbreviation.BestAnalysisAlternative.Text).Select(v => new SymbolicValue(v)).Cast <object>().ToArray());
            comboBox.SelectedItem = closedFeatNode.Value;
        }
Пример #13
0
        private void geniusTreeView1_OnAfterEdit(GeniusTreeView Sender, EditEventArgs e)
        {
            object value = e.Editor.Value;

            /*
             * if (value != null)
             *      edTrace.AppendText("AfterEdit :" + value.ToString()+Environment.NewLine);
             */
        }
Пример #14
0
        protected virtual void OnEditClick(EditEventArgs e)
        {
            var handler = (EditEventHandler)Events[EditClickKey];

            if (handler != null)
            {
                handler(this, e);
            }
        }
Пример #15
0
 protected override void BeforeEdit(EditEventArgs e)
 {
     if (derivedExpenseViews.Contains(e.View.Name))
     {
         int expenseTypeID = Enum.Parse(typeof(ExpenseType), e.View.Name).GetHashCode();
         e.Values.Add("ExpenseType", expenseTypeID);
     }
     base.BeforeEdit(e);
 }
Пример #16
0
 protected override bool OnBeforeEditRow(EditEventArgs arg)
 {
     if (arg.tabIndex == 0 && arg.dataAction == OptType.Del)
     {
         db.Sql(@"delete from sys_rolePermissionMap where PermissionCode = @0"
                , arg.dataNew.Value <string>("_id")).Execute();
     }
     return(base.OnBeforeEditRow(arg));
 }
Пример #17
0
        protected override void OnAfterEditRow(EditEventArgs arg)
        {
            if (arg.tabIndex == 0 && arg.dataAction == OptType.Add)
            {
                ResetUserPassword(arg.dataNew["UserCode"].ToString());
            }

            base.OnAfterEditRow(arg);
        }
Пример #18
0
 private void geniusTreeView1_OnInitEdit(GeniusTreeView Sender, EditEventArgs e)
 {
     if (e.Editor != null && e.Editor.Control is ComboBox && e.DisplayColumn == 2)
     {
         (e.Editor.Control as ComboBox).Items.Clear();
         (e.Editor.Control as ComboBox).Items.Add("Item 1");
         (e.Editor.Control as ComboBox).Items.Add("Item 2");
         (e.Editor.Control as ComboBox).Items.Add("Item 3");
     }
 }
Пример #19
0
        protected override bool OnBeforeEditRow(EditEventArgs arg)
        {
            if (arg.tabIndex == 0 && arg.dataAction == OptType.Del)
            {
                var codeType = arg.dataNew.Value <string>("CodeType");
                db.Sql(@"delete from sys_code where codetype = @0", codeType).Execute();
            }

            return(base.OnBeforeEditRow(arg));
        }
Пример #20
0
 protected override void BeforeEdit(EditEventArgs e)
 {
     if (e.View.Name == "durados_App")
     {
         e.IgnorePermanentFilter = true;
         e.History = new History();
         e.UserId  = System.Convert.ToInt32(Maps.Instance.DuradosMap.Database.GetUserID());
     }
     base.BeforeEdit(e);
 }
Пример #21
0
        protected override void AfterEditAfterCommit(EditEventArgs e)
        {
            base.AfterEditAfterCommit(e);

            //if (e.Values[Proposal.WordDocument.ToString()].ToString().EndsWith(".docx"))
            if (e.Values[WordDocumentFieldName].ToString().EndsWith(".docx"))
            {
                CreateDocument((View)e.View, e.Values, true);
            }
        }
Пример #22
0
        protected override void BeforeEdit(EditEventArgs e)
        {
            base.BeforeEdit(e);
            PlmParameterChangesUtil plmParamUtil = new PlmParameterChangesUtil();

            if (plmParamUtil.IsInChangeRequest(e) && plmParamUtil.HasParametersChanged(e.View, e.PrevRow, e.Values))
            {
                plmParamUtil.UpdateBEResponseStatus(e);
            }
        }
Пример #23
0
        protected override void AfterEditAfterCommit(EditEventArgs e)
        {
            if (e.Values.ContainsKey("IsApproved"))
            {
                if (e.PrevRow != null)
                {
                    Field field          = e.View.Fields["IsApproved"];
                    bool  isApproved     = Convert.ToBoolean(e.Values["IsApproved"].ToString());
                    bool  prevIsApproved = (bool)e.PrevRow["IsApproved"];

                    if (isApproved != prevIsApproved)
                    {
                        if (isApproved)
                        {
                            if (e.PrevRow["NewUser"].Equals(true))
                            {
                                string firstName = string.Empty;
                                if (e.Values.ContainsKey("FirstName"))
                                {
                                    firstName = e.Values["FirstName"].ToString();
                                }
                                else
                                {
                                    firstName = e.PrevRow["FirstName"].ToString();
                                }

                                string lastName = string.Empty;
                                if (e.Values.ContainsKey("LastName"))
                                {
                                    lastName = e.Values["LastName"].ToString();
                                }
                                else
                                {
                                    lastName = e.PrevRow["LastName"].ToString();
                                }

                                string email = string.Empty;
                                if (e.Values.ContainsKey("Email"))
                                {
                                    email = e.Values["Email"].ToString();
                                }
                                else
                                {
                                    email = e.PrevRow["Email"].ToString();
                                }

                                SendRegistrationApproval(email, firstName, lastName);
                            }
                        }
                    }
                }
            }
            base.AfterEditAfterCommit(e);
        }
Пример #24
0
        protected override void AfterEditAfterCommit(EditEventArgs e)
        {
            base.AfterEditAfterCommit(e);

            string word = e.Values[Proposal.WordDocument.ToString()].ToString();

            if (word.EndsWith(".docx") || word.EndsWith(".doc"))
            {
                CreateDocument((View)e.View, e.Values, true);
            }
        }
Пример #25
0
        protected override void AfterEditBeforeCommit(EditEventArgs e)
        {
            if (e.Command == null)
            {
                throw new DuradosException("Missing command in after edit before commit");
            }

            CreateCapacities(Convert.ToInt32(e.PrimaryKey), Convert.ToInt32(((Durados.Web.Mvc.Database)Database).GetUserID()), (SqlCommand)e.Command);

            base.AfterEditBeforeCommit(e);
        }
Пример #26
0
        private void DuplicateShellow(EditEventArgs e, SqlCommand command, out int?plmIdDuplicatedOutput, out int?beTechnicalIdToDuplicateOutput, out int?beTechnicalIdDuplicatedOutput)
        {
            int    plmIdToDuplicate = Convert.ToInt32(e.PrimaryKey);
            string sqName           = "Durados_Allegro_DuplicatePLM";
            string plmIdToDuplicateParameterName               = "@PLMId";
            string plmIdDuplicatedOutputParameterName          = "@NewPLMId";
            string beTechnicalIdDuplicatedOutputParameterName  = "@NewBETechnicalId";
            string beTechnicalIdToDuplicateOutputParameterName = "@BETechnicalId";

            DuplicateShellow(plmIdToDuplicate, command, sqName, plmIdToDuplicateParameterName, plmIdDuplicatedOutputParameterName, beTechnicalIdToDuplicateOutputParameterName, beTechnicalIdDuplicatedOutputParameterName, out plmIdDuplicatedOutput, out beTechnicalIdToDuplicateOutput, out beTechnicalIdDuplicatedOutput);
        }
Пример #27
0
        protected override void AfterEditBeforeCommit(EditEventArgs e)
        {
            string username = e.Values["Username"].ToString();

            System.Web.Security.MembershipUser currentUser = System.Web.Security.Membership.Provider.GetUser(username, false /* userIsOnline */);
            string email = e.Values["Email"].ToString();

            currentUser.Email = email;
            System.Web.Security.Membership.Provider.UpdateUser(currentUser);
            base.AfterEditBeforeCommit(e);
        }
Пример #28
0
        protected override void BeforeEdit(EditEventArgs e)
        {
            if (User == null || User.Identity == null || User.Identity.Name == null)
            {
                throw new AccessViolationException();
            }

            int?userID = Durados.Web.Mvc.Specifics.Bugit.DataAccess.User.GetUserID(User.Identity.Name);

            if (!userID.HasValue)
            {
                throw new AccessViolationException();
            }

            int productID;

            if (e.Values.ContainsKey("FK_Issue_Project_Parent"))
            {
                productID = Convert.ToInt32(e.Values["FK_Issue_Project_Parent"]);
            }
            else
            {
                int id = Int32.Parse(e.PrimaryKey);
                productID = Durados.Web.Mvc.Specifics.Bugit.DataAccess.Issue.GetProductID(id).Value;
            }

            int?companyID = Durados.Web.Mvc.Specifics.Bugit.DataAccess.Project.GetCompanyID(productID);

            if (!companyID.HasValue)
            {
                throw new AccessViolationException();
            }
            if (e.Values.ContainsKey("FK_Issue_User_Report_Parent"))
            {
                e.Values["FK_Issue_User_Report_Parent"] = userID.ToString();
            }
            else
            {
                e.Values.Add("FK_Issue_User_Report_Parent", userID.ToString());
            }

            if (e.Values.ContainsKey("ModifiedDate"))
            {
                e.Values["ModifiedDate"] = DateTime.Now.ToString();
            }
            else
            {
                e.Values.Add("ModifiedDate", DateTime.Now.ToString());
            }
            //e.Values.Add("FK_Issue_Company_Parent", companyID.Value.ToString());

            base.BeforeEdit(e);
        }
Пример #29
0
        void Inspector_ValueChange(IEditable sender, EditEventArgs args, Event nativeEvent)
        {
            if (sender is Control)
            {
                Control control = sender as Control;

                if (m_inspectorFields.ContainsKey(control))
                {
                    m_inspectorFields[control].SetValue(m_inspectorTarget, args.newValue, null);
                }
            }
        }
Пример #30
0
        protected override void AfterEditBeforeCommit(EditEventArgs e)
        {
            base.AfterEditBeforeCommit(e);

            PlmChangesUtil plmUtil = new PlmChangesUtil();

            if (plmUtil.IsInChangeRequest(e) && plmUtil.IsParametersChanged(e.View, e.OldNewValues))
            {
                plmUtil.UpdateBEResponseStatus(e, "11");

                e.Values.Add("ParameterChanged", "1");
            }
        }
Пример #31
0
 protected virtual void OnCreatingEditor(EditEventArgs args)
 {
     if (CreatingEditor != null)
         CreatingEditor(this, args);
 }
Пример #32
0
 public override CompilationPart UpdateWith(AstSourceDocumentEdit edit, IList<CompilationPart> updatedParts, out EditEventArgs editEventArgs, out EditEventArgs/*?*/ symbolTableEditEventArgs)
   //^^ requires this.SourceLocation.SourceDocument == edit.SourceLocationBeforeEdit.SourceDocument;
   //^^ requires edit.SourceLocationBeforeEdit.SourceDocument.GetType() == edit.SourceDocumentAfterEdit.GetType();
   //^^ requires this.RootNamespace.SourceLocation.Contains(edit.SourceLocationBeforeEdit);
   //^^ ensures result.GetType() == this.GetType();
 {
   SmallBasicCompilationPart result = (SmallBasicCompilationPart)base.UpdateWith(edit, updatedParts, out editEventArgs, out symbolTableEditEventArgs);
   ISourceDocument docAfterEdit = edit.SourceDocumentAfterEdit;
   //^ assume docAfterEdit is SmallBasicDocument; //since it has the same type as this.SourceLocation.SourceDocument and the constructor
   //guarantees that this.SourceLocation.SourceDocument is an instance of SmallBasicDocument.
   SmallBasicDocument doc = (SmallBasicDocument)docAfterEdit;
   doc.smallBasicCompilationPart = result;
   return result;
 }
 private void request_Completed(object sender, RequestEventArgs e)
 {
     JsonObject jsonObject = (JsonObject)JsonObject.Parse(e.Result);
     EditResult result = EditResult.FromJson(jsonObject);
     LastResult = result;
     EditEventArgs args = new EditEventArgs(result, e.Result, e.UserState);
     OnProcessCompleted(args);
 }
 private void OnProcessCompleted(EditEventArgs args)
 {
     if (ProcessCompleted != null)
     {
         Application.Current.RootVisual.Dispatcher.BeginInvoke(ProcessCompleted, new object[] { this, args });
     }
 }