예제 #1
0
 private void gridControlCongViec_DoubleClick(object sender, EventArgs e)
 {
     DataRow row = gridViewCongViec.GetDataRow(gridViewCongViec.FocusedRowHandle);
     if (row == null) return;
     Congviec obj = new Congviec(HelpNumber.ParseInt64(row["PCCV_ID"].ToString()), null);
     HelpProtocolForm.ShowModalDialog(this, obj);
 }
 public override void ShowViewForm(long id)
 {
     Congviec obj = new Congviec(id, null);
     HelpProtocolForm.ShowModalDialog(this, obj);
     gridViewMaster.SelectRow(gridViewMaster.FocusedRowHandle);
 }
 public override void ShowUpdateForm(long id)
 {
     Congviec obj = new Congviec(id, false);
     obj.RefreshAfterInsert += new Congviec.RefreshData(RefreshDataAfterInsert);
     HelpProtocolForm.ShowModalDialog(this, obj);
 }
 public override long[] ShowAddForm()
 {
     Congviec obj = new Congviec(-2, true);
     HelpProtocolForm.ShowModalDialog(this, obj);
     return null;
 }
 private void gridViewCongviec_DoubleClick(object sender, EventArgs e)
 {
     PLGridView grid = (PLGridView)sender;
     if (grid.RowCount <= 0) return;
     else if (!grid.IsGroupRow(grid.FocusedRowHandle))
     {
         if (_IsAdd == null)
         {
             FWWaitingMsg m = new FWWaitingMsg();
             Congviec obj = new Congviec(HelpNumber.ParseInt64(grid.GetDataRow(grid.FocusedRowHandle)["PCCV_ID"]), null);
             m.Finish();
             HelpProtocolForm.ShowModalDialog(this, obj);
         }
             ////HIEUNT:mới thêm sửa công việc từ khách hàng
         else if (_IsAdd == false)
         {
             if (HelpNumber.ParseInt64(grid.GetDataRow(grid.FocusedRowHandle)["TINH_TRANG_ID"]) != 4)
             {
                 FWWaitingMsg m = new FWWaitingMsg();
                 Congviec obj = new Congviec(HelpNumber.ParseInt64(grid.GetDataRow(grid.FocusedRowHandle)["PCCV_ID"]), false);
                 m.Finish();
                 HelpProtocolForm.ShowModalDialog(this, obj);
                 LoadGridViewCongViec();
             }
             else
             {
                 HelpMsgBox.ShowNotificationMessage("Công việc đã hoàn tất không được sửa!");
             }
         }
     }
 }
 /// <summary>
 /// Tạo mới công việc cho dự án
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void repImageTaoCV_Click(object sender, EventArgs e)
 {
     DataRow row = layoutViewDuAn.GetDataRow(layoutViewDuAn.FocusedRowHandle);
     if (HelpNumber.ParseInt32(row["ID_TT"]) != 5)
     {
         Congviec frm = new Congviec(-2, true, DADuAn.Instance.GetLongNguoiThucHien(row["NGUOI_THUC_HIEN"].ToString()));
         frm.UpdateCongViec_DuAn += new Congviec.UpdateKH_DA_CV(InsertDuAn_CongViec);
         HelpProtocolForm.ShowModalDialog(this, frm);
         decimal tiendo = 0;
         int phanTram = 0;
         DataTable v = DADuAn.LoadCongViec(HelpNumber.ParseInt64(row["ID"]));
         foreach (DataRow r in v.Rows)
         {
             tiendo += (HelpNumber.ParseDecimal(r["TIEN_DO"]) * HelpNumber.ParseInt32(r["TONG_PHAN_TRAM_CV"]));
             phanTram += HelpNumber.ParseInt32(r["TONG_PHAN_TRAM_CV"]);
         }
         if (phanTram > 0)
         {
             tiendo = HelpNumber.RoundDecimal(tiendo /= phanTram, 2);
         }
         ////Hieutn: Lưu lại tiến độ khi thay đổi từ form công việc
         DADuAn.CapNhatTienDoDuAn(HelpNumber.ParseInt64(row["ID"]), tiendo);
         LoadCardViewDuAn();
     }
     else
     {
         HelpMsgBox.ShowNotificationMessage("Dự án đã hoàn thành không được tạo thêm công việc!");
     }
 }
 private void btnthemcongviec_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     Congviec frm = new Congviec(-2, true);
     frm.UpdateCongViec_KhachHang += new Congviec.UpdateKH_DA_CV(InsertKhachHang_CongViec);
     HelpProtocolForm.ShowModalDialog(this, frm);
     LoadGridViewCongViec();
 }
예제 #8
0
 private void Them_Cong_Viec(List<object> ids)
 {
     Congviec frm = new Congviec(-2, true);
     frm.UpdateCongViec_KhachHang += new Congviec.UpdateKH_DA_CV(InsertKhachHang_CongViec);
     HelpProtocolForm.ShowModalDialog(this, frm);
     LoadGridCongViec();
 }
예제 #9
0
        private void gridViewCongviec_DoubleClick(object sender, EventArgs e)
        {
            PLGridView grid = (PLGridView)sender;
            if (grid.RowCount <= 0) return;
            else if (!grid.IsGroupRow(grid.FocusedRowHandle))
            {
                FWWaitingMsg m = new FWWaitingMsg();
                Congviec obj = new Congviec(HelpNumber.ParseInt64(grid.GetDataRow(grid.FocusedRowHandle)["PCCV_ID"]), null);
                m.Finish();
                HelpProtocolForm.ShowModalDialog(this, obj);

            }
        }
예제 #10
0
 private void Them_Cong_Viec(List<object> ids)
 {
     if (ids != null && ids.Count > 0)
     {
         DataRow row = gridViewMaster.GetDataRow(gridViewMaster.FocusedRowHandle);
         Congviec frm = new Congviec(-2, true, DADuAn.Instance.GetLongNguoiThucHien(row["NGUOI_THUC_HIEN"].ToString()));
         frm.UpdateCongViec_DuAn += new Congviec.UpdateKH_DA_CV(InsertDuAn_CongViec);
         HelpProtocolForm.ShowModalDialog(this, frm);
         LoadDataForSelectedTab(false);
         decimal tiendo = 0;
         int phanTram = 0;
         DataView v = (DataView)gridViewThongTinLienHe.DataSource;
         foreach (DataRow r in v.Table.Rows)
         {
             tiendo += (HelpNumber.ParseDecimal(r["TIEN_DO"]) * HelpNumber.ParseInt32(r["TONG_PHAN_TRAM_CV"]));
             phanTram += HelpNumber.ParseInt32(r["TONG_PHAN_TRAM_CV"]);
         }
         if (phanTram > 0)
         {
             tiendo = HelpNumber.RoundDecimal(tiendo /= phanTram, 2);
         }
         DADuAn.CapNhatTienDoDuAn(HelpNumber.ParseInt64(row["ID"]), tiendo);
         row["TIEN_DO"] = tiendo;
     }
     GridChange();
 }
예제 #11
0
 private void gridViewThongTinLienHe_DoubleClick(object sender, EventArgs e)
 {
     GuiMail mail = new GuiMail();
     DataRow drow = gridViewMaster.GetDataRow(gridViewMaster.FocusedRowHandle);
     PLGridView grid = (PLGridView)sender;
     if (grid.RowCount <= 0) return;
     else if (!grid.IsGroupRow(grid.FocusedRowHandle))
     {
         FWWaitingMsg m = new FWWaitingMsg();
         string str = drow["NGUOI_THUC_HIEN"].ToString();
         Congviec obj = new Congviec(HelpNumber.ParseInt64(grid.GetDataRow(grid.FocusedRowHandle)["PCCV_ID"]), null, mail.GetLongNguoiThucHien(str));
         m.Finish();
         HelpProtocolForm.ShowModalDialog(this, obj);
         gridControlThongTinLienHe.DataSource = DADuAn.LoadCongViec(HelpNumber.ParseInt64(drow["ID"]));
     }
 }