Ejemplo n.º 1
0
        private void DtgRelationship_CellEditEnded(object sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e)
        {
            //e.Cell.
            if (e.Cell.Column == colIndependentDataEntryNonSuspicious)
            {
                if (e.Cell.DataContext is TableImportItem)
                {
                    var tableImportItem = e.Cell.DataContext as TableImportItem;

                    var cell = e.Cell.ParentRow.Cells.FirstOrDefault(x => x.Column.Name == "colRelationshipsSuspicious" ||
                                                                     x.Column.Name == "colRelationshipsNonSuspicious");
                    if (cell != null)
                    {
                        DecideCellEnabled(tableImportItem, cell);
                    }
                }
            }
            if (e.Cell.Column == colRelationshipsNonSuspicious)
            {
                if (e.Cell.DataContext is TableImportItem)
                {
                    var tableImportItem = e.Cell.DataContext as TableImportItem;
                    SetRelatedEntityNames(tableImportItem);
                }
            }
        }
 private void DtgConditions_CellEditEnded(object sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e)
 {
     if (e.Cell.Column == colReportRelationshipTail)
     {
         if (e.Cell.DataContext is DataMenuSearchableReportRelationshipDTO)
         {
             var condition = (e.Cell.DataContext as DataMenuSearchableReportRelationshipDTO);
             SetRelationshipReports(MyProjectManager.GetMyProjectManager.GetRequester(), condition);
         }
     }
     else if (e.Cell.Column == colDataViewRelationshipTail)
     {
         if (e.Cell.DataContext is DataMenuDataViewRelationshipDTO)
         {
             var condition = (e.Cell.DataContext as DataMenuDataViewRelationshipDTO);
             SetRelationshipDataMenus(MyProjectManager.GetMyProjectManager.GetRequester(), condition);
         }
     }
     else if (e.Cell.Column == colDataGridRelationshipTail)
     {
         if (e.Cell.DataContext is DataMenuGridViewRelationshipDTO)
         {
             var condition = (e.Cell.DataContext as DataMenuGridViewRelationshipDTO);
             SetRelationshipDataMenus(MyProjectManager.GetMyProjectManager.GetRequester(), condition);
         }
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 发生于一个单元格编辑已被确认或取消
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DG1_CellEditEnded(object sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e)
        {
            Telerik.Windows.Controls.GridViewCellEditEndedEventArgs edata = e;
            if (edata.NewData != "")
            {
                DataRowView mySelectedElement = (DataRowView)DG1.SelectedItem;
                string[]    data = new string[7];

                //要添加这条件
                if (mySelectedElement != null)
                {
                    for (int i = 0; i < 7; i++)
                    {
                        data[i] = mySelectedElement.Row[i].ToString();
                    }
                    //    SingleChannelCalibration(data);
                }

                if (edata.NewData != edata.OldData && edata.NewData.ToString() != "")
                {
                    SingleRowCalibration(edata.Cell.Column.Header.ToString(), edata.NewData.ToString(), data);
                }
            }
            else
            {
                MessageBox.Show("输入格式不正确!");
            }
        }
 void grdSoTien_CellEditEnded(object sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e)
 {
     if (!e.Cell.Column.UniqueName.IsNullOrEmpty() && e.Cell.Column.UniqueName.Equals("TY_LE") && !e.NewData.Equals(e.OldData))
     {
         DataRowView r = e.Cell.ParentRow.Item as DataRowView;
         r["TY_LE"]            = e.NewData;
         r["DU_TRU"]           = Convert.ToDecimal(r["GIA_TRI"]) * Convert.ToDecimal(r["TY_LE"]) / 100;
         grdSoTien.CurrentItem = r;
     }
 }
Ejemplo n.º 5
0
 private void DtgRelationships_CellEditEnded(object sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e)
 {
     if (e.Cell.Column == colRelationshipTail)
     {
         if (e.Cell.DataContext is DataLinkRelationshipTailDTO)
         {
             var condition = (e.Cell.DataContext as DataLinkRelationshipTailDTO);
             SetRelationshipTailDataMenuList(condition);
         }
     }
 }
Ejemplo n.º 6
0
 void gvwEquipmentDetails_CellEditEnded(object sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e)
 {
     if (e.NewData != null && e.Cell.ParentRow.Item != null)
     {
         BookingRoomEquipmentDetail currentRow = (BookingRoomEquipmentDetail)e.Cell.ParentRow.Item;
         string columnName = e.Cell.Column.UniqueName;
         if (currentRow != null && columnName == "Quantity")
         {
             currentRow.TotalPrice = currentRow.Price * currentRow.Quantity;
         }
     }
 }
Ejemplo n.º 7
0
 private void DtgColumnValueRange_CellEditEnded(object sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e)
 {
     if (e.Cell.ParentRow != null && e.Cell.ParentRow.DataContext is UIColumnValueRangeDTO)
     {
         var item = e.Cell.ParentRow.DataContext as UIColumnValueRangeDTO;
         if (item.ColumnValueRangeID != 0)
         {
             BizColumnValueRange bizColumnValueRange = new BizColumnValueRange();
             var list = bizColumnValueRange.GetColumnValueRangeValues(item.ColumnValueRangeID, item.EnumTag);
             item.vwCandidateValues = list;
         }
     }
 }
 private void grid_CellEditEnded(object sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e)
 {
     try
     {
         DataRowView dr = (DataRowView)grid.CurrentCellInfo.Item;
         dr["TONG"]       = Convert.ToDecimal(dr["DU_NO_RUI_RO_STIEN"]) + Convert.ToDecimal(dr["TY_LE_BEN_VUNG_STIEN"]) + Convert.ToDecimal(dr["SO_KH_TANG_STIEN"]) + Convert.ToDecimal(dr["DU_NO_BINH_QUAN_STIEN"]);
         grid.CurrentItem = dr;
     }
     catch (Exception ex)
     {
         CommonFunction.ThongBaoLoi(ex);
         LLogging.WriteLog(System.Reflection.MethodInfo.GetCurrentMethod().ToString(), LLogging.LogType.ERR, ex);
     }
 }
Ejemplo n.º 9
0
        private void grdTaiSanDamBao_CellEditEnded(object sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e)
        {
            if (grdTaiSanDamBao.Items.Count == 0)
            {
                return;
            }
            _listTSDB = (List <DANH_SACH_TSDB>)grdTaiSanDamBao.ItemsSource;
            decimal decGiaTri = 0;

            for (int i = 0; i < _listTSDB.Count; i++)
            {
                decGiaTri      = _listTSDB[i].GTRI_TSDB_XLN;
                _decTongTaiSan = _decTongTaiSan + decGiaTri;
            }
            TToanTrichLapDuPhongChiPhi();
        }
Ejemplo n.º 10
0
        private void grDuAn_CellEditEnded(object sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e)
        {
            string      column = e.Cell.Column.Name;
            DataRowView dr     = null;

            if (column.Equals("SO_TIEN"))
            {
                decimal tongTien   = 0;
                decimal soTien     = 0;
                decimal soTienNhap = 0;
                int     idHoSo     = 0;

                soTienNhap = Convert.ToDecimal(((DataRowView)grDuAn.CurrentItem)["SO_TIEN"]);
                if (soTienNhap < 0)
                {
                    ((DataRowView)grDuAn.CurrentItem)["SO_TIEN"] = 0;
                }

                //Tính tổng số tiền
                idHoSo = Convert.ToInt32(((DataRowView)grDuAn.Items[0])["ID_HSO"]);
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    if ((int)row["ID_HSO"] == idHoSo)
                    {
                        tongTien = Convert.ToDecimal(row["TONG_THUC_NHAN"]);
                        break;
                    }
                }

                //Tính số tiền từ dòng 2 trở đi
                for (int i = 1; i < grDuAn.Items.Count; i++)
                {
                    dr     = (DataRowView)grDuAn.Items[i];
                    soTien = soTien + (decimal)dr["SO_TIEN"];
                }

                if (soTien > tongTien)
                {
                    LMessage.ShowMessage("Số tiền không hợp lệ", LMessage.MessageBoxType.Warning);
                    ((DataRowView)grDuAn.CurrentItem)["SO_TIEN"] = 0;
                }
                else
                {
                    ((DataRowView)grDuAn.Items[0])["SO_TIEN"] = tongTien - soTien;
                }
            }
        }
Ejemplo n.º 11
0
 private void RadGridView1_CellEditEnded(object sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e)
 {
     if (e.EditAction == Telerik.Windows.Controls.GridView.GridViewEditAction.Commit)
     {
         int quaOld = 0, quaNew = 0;
         if (e.OldData != DBNull.Value)
         {
             quaOld = Convert.ToInt32(e.OldData);
         }
         if (e.NewData != DBNull.Value)
         {
             quaNew = Convert.ToInt32(e.NewData);
         }
         DataRowView row = e.Cell.ParentRow.DataContext as DataRowView;
         row["剩余可用库存"] = Convert.ToInt32(row["剩余可用库存"]) - (quaNew - quaOld);
     }
 }
Ejemplo n.º 12
0
        private void grid_CellEditEnded(object sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e)
        {
            string column = e.Cell.Column.Name;

            if (column.Equals("BAC1"))
            {
                string truoc   = "";
                string hienTai = "";
                for (int i = 2; i <= soBacLuong; i++)
                {
                    truoc   = "BAC" + (i - 1).ToString();
                    hienTai = "BAC" + i.ToString();

                    DataRowView dr = (DataRowView)grid.CurrentCellInfo.Item;
                    dr[hienTai]      = (Convert.ToDecimal(dr[truoc])) * (decimal)1.1;
                    grid.CurrentItem = dr;
                }
            }
        }
Ejemplo n.º 13
0
 private void gridView_CellEditEnded(object sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e)
 {
 }
Ejemplo n.º 14
0
        private void DtgNewRelationships_CellEditEnded(object sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e)
        {
            if (e.Cell.DataContext is RelationshipImportItem)
            {
                if (e.Cell.Column.Name == "colRelationshipType")
                {
                    var data = (e.Cell.DataContext as RelationshipImportItem);
                    if (data.Relationship.OrginalTypeEnum == Enum_OrginalRelationshipType.SuperToSub)
                    {
                        if (string.IsNullOrEmpty(data.Relationship.OrginalRelationshipGroup))
                        {
                            string name = "";
                            if (data.Relationship.FKSidePKColumnsAreFkColumns)
                            {
                                var eRel = listNew.FirstOrDefault(x => !string.IsNullOrEmpty(x.Relationship.OrginalRelationshipGroup) && x.Relationship.FKSidePKColumnsAreFkColumns && x.Relationship.Entity1 == data.Relationship.Entity1 && x.Relationship.OrginalTypeEnum == Enum_OrginalRelationshipType.SuperToSub);
                                if (eRel == null)
                                {
                                    name = "ISA_OnPK_" + data.Relationship.Entity1;
                                }
                                else
                                {
                                    name = eRel.Relationship.OrginalRelationshipGroup;
                                }
                            }
                            else
                            {
                                var eRel = listNew.FirstOrDefault(x => !string.IsNullOrEmpty(x.Relationship.OrginalRelationshipGroup) && !x.Relationship.FKSidePKColumnsAreFkColumns && x.Relationship.Entity1 == data.Relationship.Entity1 && x.Relationship.OrginalTypeEnum == Enum_OrginalRelationshipType.SuperToSub);
                                if (eRel == null)
                                {
                                    name = "ISA_" + data.Relationship.Entity1;
                                }
                                else
                                {
                                    name = eRel.Relationship.OrginalRelationshipGroup;
                                }
                            }
                            data.Relationship.OrginalRelationshipGroup = name;
                        }
                    }
                    if (data.Relationship.OrginalTypeEnum == Enum_OrginalRelationshipType.SubUnionToUnion)
                    {
                        if (string.IsNullOrEmpty(data.Relationship.OrginalRelationshipGroup))
                        {
                            string name = "";

                            var eRel = listNew.FirstOrDefault(x => !string.IsNullOrEmpty(x.Relationship.OrginalRelationshipGroup) && x.Relationship.Entity2 == data.Relationship.Entity2 && x.Relationship.OrginalTypeEnum == Enum_OrginalRelationshipType.SubUnionToUnion);
                            if (eRel == null)
                            {
                                name = "Union_" + data.Relationship.Entity2;
                            }
                            else
                            {
                                name = eRel.Relationship.OrginalRelationshipGroup;
                            }

                            data.Relationship.OrginalRelationshipGroup = name;
                        }
                    }
                }
            }
        }
Ejemplo n.º 15
0
 private void DgFZYS_CellEditEnded(object sender, Telerik.Windows.Controls.GridViewCellEditEndedEventArgs e)
 {
     MgtZWPZK.ReCalculate(DgPZFL.SelectedItem as ZWPZFL);
     DgPZFL.Items.Refresh();
 }