Example #1
0
        protected void GvMonitoringEffectiveness_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            try
            {
                ASPxGridView grid = sender as ASPxGridView;
                int          id   = e.Keys[0].ToInt32(0);
                int          FaultAuditRecordsId = Session["FaultAuditRecordsId"].ToInt32(0);

                QmRepository.DeleteAttachMent(id);

                AttachFileModelList            = QmRepository.GetAttachmentViewEditIA(FaultAuditRecordsId, 4);
                Session["AttachmentME"]        = AttachFileModelList;
                GvContainmentAction.DataSource = AttachFileModelList;
                GvContainmentAction.DataBind();
            }
            catch (Exception ex)
            {
                //PanelMensajes.ShowOnPageLoad = true;
                //LblMensaje.Text = ex.Message;
            }
            finally
            {
                e.Cancel = true;
            }
        }
Example #2
0
        protected void btnSaveAction_Click(object sender, EventArgs e)
        {
            try
            {
                ASPxButton btn  = (ASPxButton)sender;
                var        user = HttpContext.Current.Session["user"] as User;

                ASPxFormLayout frm = (ASPxFormLayout)btn.NamingContainer;
                int            FaultAuditRecordsId     = Session["FaultAuditRecordsId"].ToInt32(0);
                string         ContainmentAction       = frm.GetNestedControlValueByFieldName("ContainmentAction").ToString("");
                string         RootCauseAnalysis       = frm.GetNestedControlValueByFieldName("RootCauseAnalysis").ToString("");
                string         CorrectiveAction        = frm.GetNestedControlValueByFieldName("CorrectiveAction").ToString("");
                string         MonitoringEffectiveness = frm.GetNestedControlValueByFieldName("MonitoringEffectiveness").ToString("");

                QmRepository.UpdateAction(FaultAuditRecordsId, ContainmentAction, RootCauseAnalysis, CorrectiveAction, MonitoringEffectiveness, "", user.UserName);

                var AttachFileModelList   = (List <FaultAuditRecordAttachment>)Session["Attachment"];
                var AttachFileModelListRC = (List <FaultAuditRecordAttachment>)Session["AttachmentRC"];
                var AttachFileModelListCA = (List <FaultAuditRecordAttachment>)Session["AttachmentCA"];
                var AttachFileModelListME = (List <FaultAuditRecordAttachment>)Session["AttachmentME"];


                for (int x = 0; x < AttachFileModelList.Count(); x++)
                {
                    QmRepository.InsertAttachMent(AttachFileModelList[x].FileName, AttachFileModelList[x].FileLocation, 1, FaultAuditRecordsId, user.UserName);
                }

                for (int x = 0; x < AttachFileModelListRC.Count(); x++)
                {
                    QmRepository.InsertAttachMent(AttachFileModelListRC[x].FileName, AttachFileModelListRC[x].FileLocation, 2, FaultAuditRecordsId, user.UserName);
                }

                for (int x = 0; x < AttachFileModelListCA.Count(); x++)
                {
                    QmRepository.InsertAttachMent(AttachFileModelListCA[x].FileName, AttachFileModelListCA[x].FileLocation, 3, FaultAuditRecordsId, user.UserName);
                }

                for (int x = 0; x < AttachFileModelListME.Count(); x++)
                {
                    QmRepository.InsertAttachMent(AttachFileModelListME[x].FileName, AttachFileModelListME[x].FileLocation, 4, FaultAuditRecordsId, user.UserName);
                }
            }
            catch (Exception ex)
            {
                //errorMessageLabel.Text = ex.Message;
                //errorMessageLabel.Visible = true;
            }
        }
Example #3
0
        protected void btnSaveRca_Click(object sender, EventArgs e)
        {
            ASPxButton btn = (ASPxButton)sender;

            GridViewDataRowTemplateContainer container = btn.NamingContainer as GridViewDataRowTemplateContainer;
            ASPxPageControl ASPxPageControl            = btn.NamingContainer as ASPxPageControl;
            var             FaultAuditRecordsId        = Session["FaultAuditRecordsId"].ToInt32(0);
            var             user = HttpContext.Current.Session["user"] as User;

            TextBox TbMan1 = ASPxPageControl.FindControl("TbMan1") as TextBox;
            TextBox TbMan2 = ASPxPageControl.FindControl("TbMan2") as TextBox;
            TextBox TbMan3 = ASPxPageControl.FindControl("TbMan3") as TextBox;
            TextBox TbMan4 = ASPxPageControl.FindControl("TbMan4") as TextBox;
            TextBox TbMan5 = ASPxPageControl.FindControl("TbMan5") as TextBox;

            TextBox TbMachine1 = ASPxPageControl.FindControl("TbMachine1") as TextBox;
            TextBox TbMachine2 = ASPxPageControl.FindControl("TbMachine2") as TextBox;
            TextBox TbMachine3 = ASPxPageControl.FindControl("TbMachine3") as TextBox;
            TextBox TbMachine4 = ASPxPageControl.FindControl("TbMachine4") as TextBox;
            TextBox TbMachine5 = ASPxPageControl.FindControl("TbMachine5") as TextBox;

            TextBox TbMaterial1 = ASPxPageControl.FindControl("TbMaterial1") as TextBox;
            TextBox TbMaterial2 = ASPxPageControl.FindControl("TbMaterial2") as TextBox;
            TextBox TbMaterial3 = ASPxPageControl.FindControl("TbMaterial3") as TextBox;
            TextBox TbMaterial4 = ASPxPageControl.FindControl("TbMaterial4") as TextBox;
            TextBox TbMaterial5 = ASPxPageControl.FindControl("TbMaterial5") as TextBox;

            TextBox TbMethod1 = ASPxPageControl.FindControl("TbMethod1") as TextBox;
            TextBox TbMethod2 = ASPxPageControl.FindControl("TbMethod2") as TextBox;
            TextBox TbMethod3 = ASPxPageControl.FindControl("TbMethod3") as TextBox;
            TextBox TbMethod4 = ASPxPageControl.FindControl("TbMethod4") as TextBox;
            TextBox TbMethod5 = ASPxPageControl.FindControl("TbMethod5") as TextBox;


            QmRepository.UpdateRca(FaultAuditRecordsId.ToInt32(0), TbMan1.Text, TbMan2.Text, TbMan3.Text, TbMan4.Text, TbMan5.Text,
                                   TbMachine1.Text, TbMachine2.Text, TbMachine3.Text, TbMachine4.Text, TbMachine5.Text,
                                   TbMaterial1.Text, TbMaterial2.Text, TbMaterial3.Text, TbMaterial4.Text, TbMaterial5.Text,
                                   TbMethod1.Text, TbMethod2.Text, TbMethod3.Text, TbMethod4.Text, TbMethod5.Text, user.UserName);
        }
Example #4
0
        public static string SetDamageCode(string FaultConstructionGroupId, string FaultLocationId, string FaultTypeId, string FaultDamageTypeId)
        {
            string _FaultConstructionGroupId = "";
            string _FaultLocationId          = "";
            string _FaultTypeId       = "";
            string _FaultDamageTypeId = "";

            if (!string.IsNullOrEmpty(FaultConstructionGroupId))
            {
                _FaultConstructionGroupId = FaultConstructionGroupId.Split("-")[0].ToString("");
            }

            if (!string.IsNullOrEmpty(FaultLocationId))
            {
                _FaultLocationId = FaultLocationId.Split("-")[0].ToString("");
            }
            if (!string.IsNullOrEmpty(FaultTypeId))
            {
                _FaultTypeId = FaultTypeId.Split("-")[0].ToString("");
            }
            if (!string.IsNullOrEmpty(FaultDamageTypeId))
            {
                _FaultDamageTypeId = QmRepository.GetDamageCode(FaultDamageTypeId.Split("-")[0]);
            }


            Object o = new
            {
                damagecode = string.Format("Q{0}{1}{2}{3}", _FaultConstructionGroupId, _FaultLocationId, _FaultTypeId, _FaultDamageTypeId),
                classes    = "1",
                weight     = "1"
            };


            return(new JavaScriptSerializer().Serialize(o));
        }
Example #5
0
        protected void popupReport_WindowCallback(object source, PopupWindowCallbackArgs e)
        {
            var temp = e.Parameter.ToString().Split(";");
            int id   = temp[1].ToInt32(0);

            if (id == 0)
            {
                return;
            }

            Session["FaultAuditRecordsId"] = id;
            frmLayoutCheckingCode.DataBind();
            gvIssue.DataBind();

            QmRcaModels rc = new QmRcaModels();

            rc = QmRepository.GetRca(id);

            TbMan1.Text = rc.Man1;
            TbMan2.Text = rc.Man2;
            TbMan3.Text = rc.Man3;
            TbMan4.Text = rc.Man4;
            TbMan5.Text = rc.Man5;

            TbMachine1.Text = rc.Machine1;
            TbMachine2.Text = rc.Machine2;
            TbMachine3.Text = rc.Machine3;
            TbMachine4.Text = rc.Machine4;
            TbMachine5.Text = rc.Machine5;

            TbMaterial1.Text = rc.Material1;
            TbMaterial2.Text = rc.Material2;
            TbMaterial3.Text = rc.Material3;
            TbMaterial4.Text = rc.Material4;
            TbMaterial5.Text = rc.Material5;

            TbMethod1.Text = rc.Method1;
            TbMethod2.Text = rc.Method2;
            TbMethod3.Text = rc.Method3;
            TbMethod4.Text = rc.Method4;
            TbMethod5.Text = rc.Method5;

            //containment
            AttachFileModelList            = QmRepository.GetAttachmentViewEditIA(id, 1);
            Session["Attachment"]          = AttachFileModelList;
            GvContainmentAction.DataSource = AttachFileModelList;
            GvContainmentAction.DataBind();
            // AttachFileModelList = GetFileAttachment;


            //GvRootCauseAnalysis
            AttachFileModelListRC          = QmRepository.GetAttachmentViewEditIA(id, 2);
            Session["AttachmentRC"]        = AttachFileModelListRC;
            GvRootCauseAnalysis.DataSource = AttachFileModelListRC;
            GvRootCauseAnalysis.DataBind();

            //GvCorrectiveAction
            var AttachFileModelListCA = QmRepository.GetAttachmentViewEditIA(id, 3);

            Session["AttachmentCA"]       = AttachFileModelListCA;
            GvCorrectiveAction.DataSource = AttachFileModelListCA;
            GvCorrectiveAction.DataBind();


            //GvMonitoringEffectiveness
            AttachFileModelListME   = QmRepository.GetAttachmentViewEditIA(id, 4);
            Session["AttachmentME"] = AttachFileModelListME;
            GvMonitoringEffectiveness.DataSource = AttachFileModelListME;
            GvMonitoringEffectiveness.DataBind();
        }