Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            fgm_moduler = new FGMModule("FDM", "TT2", "TagGroupDetector");
            Detector_Grid.SettingsDetail.ShowDetailRow = true;
            detector.Columns.Add("Voting1");
            detector.Columns.Add("Voting2");
            DetectorVoting.Tables.AddRange(new DataTable[] { detector, Effect });

            if (!IsPostBack)
            {
                Setup_Zone();
                DetectorVoting.Clear();
            }
            zone = ddl_zone.SelectedValue;
            tagType_HiddenField.Value = zone;


            makeDetectorGridView();
            makeEffectGridView();

            Session["Dataset"] = DetectorVoting;

            Detector_Grid.DataSource = DetectorVoting;
            Detector_Grid.DataBind();
        }
Esempio n. 2
0
        protected void DetectorVoting_Inserting(object sender, ASPxDataInsertingEventArgs e)
        {
            SqlCommand cmd;

            ASPxComboBox combo_voting_cnt  = (ASPxComboBox)Detector_Grid.FindEditRowCellTemplateControl((GridViewDataColumn)Detector_Grid.Columns[1], "combo_voting_cnt");
            ASPxComboBox combo_voting2_cnt = (ASPxComboBox)Detector_Grid.FindEditRowCellTemplateControl((GridViewDataColumn)Detector_Grid.Columns[3], "combo_voting2_cnt");
            DropDownList combo_type1       = (DropDownList)Detector_Grid.FindEditRowCellTemplateControl((GridViewDataColumn)Detector_Grid.Columns[0], "TYPE1_COMBO");
            DropDownList combo_type2       = (DropDownList)Detector_Grid.FindEditRowCellTemplateControl((GridViewDataColumn)Detector_Grid.Columns[2], "TYPE2_COMBO");

            string voting1 = combo_voting_cnt.Text;
            string voting2 = combo_voting2_cnt.Text;
            string type1   = combo_type1.Text;
            string type2   = combo_type2.Text;

            string qry = "insert into TBLDETECTOR_VOTING(OBID, TYPE1, VOTING_CNT1, TYPE2, VOTING_CNT2, N1CREATIONDATE, N1CREATIONSESID, N1PROJECTNAME, Zone) ";

            qry = qry + "values (NEWID(), '" + type1 + "','" + voting1 + "','" + type2 + "', '" + voting2 + "',  REPLACE(REPLACE(CONVERT(varchar(23), GETDATE(), 121), '-','/'),'  ', '-'), ";
            qry = qry + "'" + SessionInfo.UserName + "', '" + fgm_moduler.func_Class.project_Name + "', '" + zone + "')";

            cmd = new SqlCommand(qry, fgm_moduler.func_Class.conn);
            cmd.ExecuteNonQuery();

            e.Cancel = true;
            Detector_Grid.CancelEdit();
        }
Esempio n. 3
0
        public void Effect_Inserting(object sender, ASPxDataInsertingEventArgs e)
        {
            ASPxGridView detailGridView = (ASPxGridView)sender;

            ASPxGridView   editform_gv = (ASPxGridView)detailGridView.FindEditFormTemplateControl("cnr").FindControl("gv1");
            ASPxFormLayout fl          = (ASPxFormLayout)detailGridView.FindEditFormTemplateControl("cnr").FindControl("Effect_Layout_Form");


            for (int i = 0; i < editform_gv.Selection.Count; i++)
            {
                SqlCommand cmd;
                string     effect_obid   = editform_gv.GetSelectedFieldValues("OBID")[i].ToString();
                string     detector_obid = detailGridView.GetMasterRowKeyValue().ToString();
                string     load_qry      = "insert into TB_DE_LINK(OBID, LEFTREL, RIGHTREL, N1CREATIONDATE, N1CREATIONSESID)  ";
                load_qry = load_qry + "VALUES (NEWID(), '" + detector_obid + "', '" + effect_obid + "',  ";
                load_qry = load_qry + "REPLACE(REPLACE(CONVERT(varchar(23), GETDATE(), 121), '-','/'),'  ', '-') , '" + SessionInfo.UserName + "')  ";
                cmd      = new SqlCommand(load_qry, fgm_moduler.func_Class.conn);
                cmd.ExecuteNonQuery();
            }

            e.Cancel = true;
            Detector_Grid.CancelEdit();

            //makeDetectorGridView();
            //makeEffectGridView();

            //Session["Dataset"] = DetectorVoting;

            //Detector_Grid.DataSource = DetectorVoting;
            //Detector_Grid.DataBind();
        }
Esempio n. 4
0
        public void Effect_Deleting(object sender, ASPxDataDeletingEventArgs e)
        {
            SqlCommand cmd;

            ASPxGridView detailGridView = (ASPxGridView)sender;
            string       Selected_OBID  = e.Keys[detailGridView.KeyFieldName].ToString(); //detailGridView.GetRowValues(detailGridView.FocusedRowIndex, "OBID").ToString();

            string qry = " UPDATE TB_DE_LINK SET N1TERMINATIONDATE = REPLACE(REPLACE(CONVERT(varchar(23), GETDATE(), 121), '-','/'),'  ', '-'),  ";

            qry = qry + "N1TERMINATIONSESID = '" + SessionInfo.UserName + "'  ";
            qry = qry + "WHERE OBID = '" + Selected_OBID + "' ";
            cmd = new SqlCommand(qry, fgm_moduler.func_Class.conn);
            cmd.ExecuteNonQuery();

            e.Cancel = true;
            Detector_Grid.CancelEdit();
        }
Esempio n. 5
0
        public void DetectorVoting_Deleting(object sender, ASPxDataDeletingEventArgs e)
        {
            SqlCommand   cmd;
            ASPxGridView detailGridView = (ASPxGridView)sender;



            string Selected_OBID = e.Keys[Detector_Grid.KeyFieldName].ToString();

            string qry = " UPDATE TBLDETECTOR_VOTING SET N1TERMINATIONDATE = REPLACE(REPLACE(CONVERT(varchar(23), GETDATE(), 121), '-','/'),'  ', '-'),  ";

            qry = qry + "N1TERMINATIONSESID = '" + SessionInfo.UserID + "'  ";
            qry = qry + "WHERE OBID = '" + Selected_OBID + "' ";
            cmd = new SqlCommand(qry, fgm_moduler.func_Class.conn);
            cmd.ExecuteNonQuery();

            e.Cancel = true;
            Detector_Grid.CancelEdit();
            detailGridView.CancelEdit();
            //Detector_Grid.CancelEdit();
        }