Example #1
0
        /// <summary>
        /// 工序下拉选择 后触发
        /// </summary>
        private void rilueOperationName_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
        {
            if (this.gvSubLine.State == GridState.Editing && this.gvSubLine.IsEditorFocused)
            {
                string newOperationName    = Convert.ToString(e.Value);
                string currenOperationName = Convert.ToString(this.gvSubLine.EditingValue);
                if (newOperationName != currenOperationName)
                {
                    //获取选中行的子线主键
                    string subLineKey = gvSubLine.GetFocusedRowCellValue("PRODUCTION_LINE_SUB_KEY").ToString();

                    //获取当前行对应的线别工序信息是否存在设定
                    DataRow[] drs = ((DataTable)gcSubLine.DataSource).Select(string.Format(" PRODUCTION_LINE_SUB_KEY ='{0}' AND OPERATION_NAME = '{1}' ", subLineKey, newOperationName));

                    //判断同工序同线别的设定是否存在
                    if (drs.Length == 0)
                    {
                        gvSubLine.SetFocusedRowCellValue("OPERATION_NAME", newOperationName);
                    }
                    else
                    {
                        e.Value = string.Empty;
                        //MessageBox.Show(string.Format("不允许存在线别【{0}】,工序【{1}】相同的设定", drs[0][FMM_PRODUCTION_LINE_SUB_FIELDS.FIELDS_LINE_NAME], newOperationName));
                        MessageBox.Show(string.Format(StringParser.Parse("${res:FanHai.Hemera.Addins.LineSetting.msg.0001}"), drs[0][FMM_PRODUCTION_LINE_SUB_FIELDS.FIELDS_LINE_NAME], newOperationName));
                    }
                }
            }
            else
            {
                e.Value = string.Empty;
            }

            this.gvSubLine.UpdateCurrentRow();
        }
        private void repositoryItemLookUpEditTenThuoc_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
        {
            if (e.Value == null)
            {
                return;
            }

            bool isNewRow = gridViewPTT.IsNewItemRow(gridViewPTT.FocusedRowHandle);

            if (isNewRow)
            {
                if (gridViewPTT.GetFocusedDataRow() == null)
                {
                    gridViewPTT.AddNewRow();
                }
            }

            DataRow row       = gridViewPTT.GetFocusedDataRow();
            string  thuocGUID = string.Empty;

            if (row["ThuocGUID"] != null && row["ThuocGUID"] != DBNull.Value)
            {
                thuocGUID = row["ThuocGUID"].ToString();
            }
            if (thuocGUID == e.Value.ToString())
            {
                return;
            }

            row["ThuocGUID"] = e.Value;
            UpdateThongTinThuoc(row);
            gridViewPTT.UpdateCurrentRow();
            RefreshNo();
        }
Example #3
0
 private void Control_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
 {
     /*
      * Venta doc = View.CurrentObject as Venta;
      *
      * doc.AddItem();*/
 }
 private void LookUpEdit1_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
 {
     if (popupForm != null && popupForm.CurrentValue != null)
     {
         popupForm.MouseUp -= new MouseEventHandler(popupForm_MouseUp);
     }
 }
Example #5
0
        void riCode_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
        {
            if (e.CloseMode != PopupCloseMode.Normal)
            {
                return;
            }
            object o = gvCT.GetFocusedRowCellValue("NX");

            if (o == null || o.ToString() == "N")
            {
                return;
            }
            GridLookUpEdit glu = sender as GridLookUpEdit;

            if (glu.Properties.View.FocusedRowHandle < 0)
            {
                return;
            }
            DataRowView drHH = glu.Properties.View.GetRow(glu.Properties.View.FocusedRowHandle) as DataRowView;
            string      code = drHH["PNo"].ToString();
            string      nhom = drHH["Nhom"].ToString();
            string      bac  = drHH["Bac"].ToString();

            if (nhom == "" || bac == "")
            {
                return;
            }
            DataTable dt = (glu.Properties.DataSource as BindingSource).DataSource as DataTable;

            DataRow[] drs = dt.Select("Pno = '" + code + "' and Nhom = '" + nhom + "' and Bac > " + bac, "Bac asc");
            if (drs.Length == 0)
            {
                return;
            }
            if (XtraMessageBox.Show("Bạn có muốn xuất tất cả các bậc còn lại không?",
                                    Config.GetValue("PackageName").ToString(), MessageBoxButtons.YesNo) == DialogResult.No)
            {
                return;
            }
            gvCT.SetFocusedRowCellValue(gvCT.Columns["Code"], code);
            gvCT.AddNewRow();
            for (int i = 0; i < drs.Length; i++)
            {
                DataRow dr = drs[i];
                gvCT.UpdateCurrentRow();
                gvCT.SetFocusedRowCellValue(gvCT.Columns["NX"], "X");
                gvCT.SetFocusedRowCellValue(gvCT.Columns["Code"], dr["Pno"]);
                gvCT.SetFocusedRowCellValue(gvCT.Columns["NgayNhap"], dr["NgayCT"]);
                gvCT.SetFocusedRowCellValue(gvCT.Columns["Nhom"], dr["Nhom"]);
                gvCT.SetFocusedRowCellValue(gvCT.Columns["Rong"], dr["Rong"]);
                gvCT.SetFocusedRowCellValue(gvCT.Columns["Dai"], dr["Dai"]);
                gvCT.SetFocusedRowCellValue(gvCT.Columns["Day"], dr["Day"]);
                gvCT.SetFocusedRowCellValue(gvCT.Columns["MaKe"], dr["MaKe"]);
                gvCT.SetFocusedRowCellValue(gvCT.Columns["MaNgan"], dr["MaNgan"]);
                if (i < drs.Length - 1)
                {
                    gvCT.AddNewRow();
                }
            }
        }
Example #6
0
        private void searchSanPham_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
        {
            int focus = dgvDetails.FocusedRowHandle;

            if (focus >= 0)
            {
                SearchLookUpEdit edit = sender as SearchLookUpEdit;
                if (e.AcceptValue)
                {
                    ProductSelect row = (edit.Properties.GetRowByKeyValue(e.Value) as ProductSelect);
                    dgvDetails.SetFocusedRowCellValue("ProductCode", row.ProductCode.ToString());
                    dgvDetails.SetFocusedRowCellValue("ID", row.ID.ToString());
                    dgvDetails.SetFocusedRowCellValue("ProductName", row.ProductName.ToString());
                    dgvDetails.SetFocusedRowCellValue("Price", row.Price.ToString());

                    focus = dgv_Main.FocusedRowHandle;
                    if (focus >= 0)
                    {
                        dgv_Main.SetFocusedRowCellValue("TongTien", listdetails.Sum(o => o.ThanhTien));
                        dgv_Main.BestFitColumns(true);
                    }
                    dgvDetails.BestFitColumns(true);
                }
            }
        }
Example #7
0
        private void sLook_NameEN_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
        {
            if (e.CloseMode == PopupCloseMode.Normal)
            {
                string _nameVN       = "";
                string _nameJP       = "";
                string _group1       = "";
                string _group2       = "";
                string _classifyID   = "1";
                string _classifyDesc = "LK";

                //Get index
                SearchLookUpEdit editor = sender as SearchLookUpEdit;
                int index = editor.Properties.GetIndexByKeyValue(editor.EditValue);

                //Set value to variables
                _nameVN       = Convert.ToString(editor.Properties.View.GetFocusedRowCellValue("NameVN"));
                _nameJP       = Convert.ToString(editor.Properties.View.GetFocusedRowCellValue("NameJP"));
                _group1       = Convert.ToString(editor.Properties.View.GetFocusedRowCellValue("Group1"));
                _group2       = Convert.ToString(editor.Properties.View.GetFocusedRowCellValue("Group2"));
                _classifyID   = Convert.ToString(editor.Properties.View.GetFocusedRowCellValue("ClassifyID"));
                _classifyDesc = Convert.ToString(editor.Properties.View.GetFocusedRowCellValue("ClassifyDesc"));

                //Set value to column NameVN, NameJP
                txt_NameVN.EditValue       = _nameVN;
                txt_NameJP.EditValue       = _nameJP;
                sLook_Group1.EditValue     = _group1;
                sLook_Group2.EditValue     = _group2;
                look_ClassifyID.EditValue  = _classifyID;
                txt_ClassifyDesc.EditValue = _classifyDesc;
            }
        }
Example #8
0
        private void repositoryItemGridLookUpEdit1_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
        {
            GridView view = gridControl1.FocusedView as GridView;

            GridLookUpEdit gridLookUpEdit = sender as GridLookUpEdit;
            int            row            = Convert.ToInt32(view.FocusedRowHandle);
            DataRow        lookupRow      = gridLookUpEdit.Properties.View.GetFocusedDataRow();

            if (lookupRow == null)
            {
                return;
            }
            string D_ID     = lookupRow["Detail_ID"].ToString();
            string S_ID     = lookupRow["Sub_ID"].ToString();
            string D_Code   = lookupRow["Detail_Code"].ToString();
            string S_Code   = lookupRow["Sub_Code"].ToString();
            string AC_Name  = lookupRow["Acc_Name"].ToString();
            string AC_FCY   = lookupRow["FCY"].ToString();
            string D_Ledger = lookupRow["Detail_SubLedger"].ToString();

            view.SetRowCellValue(view.FocusedRowHandle, view.Columns["Acc_Name"], AC_Name);
            view.SetRowCellValue(view.FocusedRowHandle, view.Columns["Detail_ID"], D_ID);
            view.SetRowCellValue(view.FocusedRowHandle, view.Columns["Sub_ID"], S_ID);
            view.SetRowCellValue(view.FocusedRowHandle, view.Columns["Detail_Code"], D_Code);
            view.SetRowCellValue(view.FocusedRowHandle, view.Columns["Sub_Code"], S_Code);
            view.SetRowCellValue(view.FocusedRowHandle, view.Columns["FCY"], AC_FCY);
            view.SetRowCellValue(view.FocusedRowHandle, view.Columns["Detail_Ledger"], D_Ledger);
        }
Example #9
0
        private void repositoryItemLookUpEdit2_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
        {
            DataRowView Look_Row = repositoryItemLookUpEdit2.GetDataSourceRowByKeyValue(e.Value) as DataRowView;

            gridView1.SetRowCellValue(gridView1.FocusedRowHandle, "Unit_DD", Look_Row.Row["Unit_DD"]);
            gridView1.SetRowCellValue(gridView1.FocusedRowHandle, "R_Rate", Look_Row.Row["Item_Rate"]);
        }
Example #10
0
        private void riPopup_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
        {
            int vtRow = gridListNhanvien.FocusedRowHandle;

            if (gvLoaiCong.FocusedRowHandle == gvLoaiCong.RowCount) //chuyen sang row khac de datasource duoc update
            {
                gvLoaiCong.FocusedRowHandle--;
            }
            else
            {
                gvLoaiCong.FocusedRowHandle++;
            }
            //loc bang loai cong de chuyen du lieu vao cell
            DataView dv = new DataView(dtLoaiCong);

            dv.RowFilter = "Chon = 1";
            string s = "";

            if (dv.Count > 0)
            {
                //khai báo mảng chứa giá trị mới
                newValues = new string[dv.Count, 2];
                int i = 0;
                foreach (DataRowView drv in dv)
                {
                    s += drv["KyHieu"].ToString() + ":" + Convert.ToDecimal(drv["SoCong"].ToString().Trim()).ToString("### ### ### ##0.######").Trim() + "; ";
                    //gán giá trị mới
                    newValues[i, 0] = drv["KyHieu"].ToString();
                    newValues[i, 1] = Convert.ToDecimal(drv["SoCong"].ToString()).ToString("### ### ### ##0.######");
                    i++;
                }
            }
            else
            {
                newValues = null;
            }
            if (s != "")
            {
                s = s.Remove(s.Length - 2);
            }
            e.Value = s;

            //gan du lieu vao datasource
            //gridListNhanvien.SetRowCellValue(gridListNhanvien.FocusedRowHandle, gridListNhanvien.FocusedColumn, s);

            //Tinh tong cong
            DataRow row = gridListNhanvien.GetDataRow(gridListNhanvien.FocusedRowHandle);

            int numDayofMonth = DateTime.DaysInMonth(year, thanglamviec);

            if (isError)
            {
                TCongDuyetOneRow(numDayofMonth, row);
                isError = false;
            }
            else
            {
                TongCong(row);
            }
        }
Example #11
0
 private void OpsFrtRepositoryItemImageComboBox_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
 {
     if (gridView1.GetFocusedRowCellValue(colHMT).ToString() == "M" && e.Value.ToString().StartsWith("h"))
     {
         e.AcceptValue = false;
     }
 }
Example #12
0
File: PR.cs Project: AskariSoft/ERP
        private void repositoryItemGridLookUpEdit1_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
        {
            if (gridView1 == null)
            {
                return;
            }
            GridView view = gridView1;

            GridLookUpEdit gridLookUpEdit = sender as GridLookUpEdit;
            DataRow        lookupRow      = gridLookUpEdit.Properties.View.GetFocusedDataRow();

            if (lookupRow != null)
            {
                int SCat_ID = Convert.ToInt32(lookupRow["SCat_ID"]);
                if (SCat_ID != 0)
                {
                    string SCat_DD = lookupRow["SCat_ID"].ToString();

                    view.SetRowCellValue(view.FocusedRowHandle, view.Columns["SCat_ID"], SCat_ID);
                    view.SetRowCellValue(view.FocusedRowHandle, view.Columns["SCat_DD"], SCat_DD);

                    for (int i = 2; i <= gridView1.Columns["R_Qty"].VisibleIndex; i++)
                    {
                        gridView1.SetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns[i], "");
                    }
                    Fill_Items(SCat_ID);
                }
            }
            if (gridView1.GetRowCellValue(view.FocusedRowHandle, gridView1.Columns["SCat_ID"]) != null)
            {
                gridView1.FocusedColumn = gridView1.Columns["Item_ID"];
            }
            gridView1.ShowEditor();
        }
        void ret_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
        {
            RepositoryItemFilterComboBox ret = base.CreateRepositoryItem() as RepositoryItemFilterComboBox;

            ret.Popup   -= new EventHandler(ret_Popup);
            ret.CloseUp -= new DevExpress.XtraEditors.Controls.CloseUpEventHandler(ret_CloseUp);
        }
Example #14
0
        //Hiển thị thông tin MMTB khi chọn lên gridView
        private void Repo_sLookUp_Code_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
        {
            if (e.CloseMode == PopupCloseMode.Normal)
            {
                string   _code          = "";
                string   _ACCcode       = "";
                string   _nameEN        = "";
                string   _nameVN        = "";
                string   _nameJP        = "";
                string   _maker         = "";
                string   _model         = "";
                string   _series        = "";
                string   _orgCountry    = "";
                DateTime _proDate       = DateTime.Now;
                int      _Lifetime      = 0;
                decimal  _netValue      = 0;
                DateTime _startDeprDate = DateTime.Now;
                DateTime _endDeprDate   = DateTime.Now;

                //Get index
                SearchLookUpEdit editor = sender as SearchLookUpEdit;
                int index = editor.Properties.GetIndexByKeyValue(editor.EditValue);

                //Set value to variables
                _code       = Convert.ToString(editor.Properties.View.GetFocusedRowCellValue("Code"));
                _ACCcode    = Convert.ToString(editor.Properties.View.GetFocusedRowCellValue("ACCcode"));
                _nameEN     = Convert.ToString(editor.Properties.View.GetFocusedRowCellValue("NameEN"));
                _nameVN     = Convert.ToString(editor.Properties.View.GetFocusedRowCellValue("NameVN"));
                _nameJP     = Convert.ToString(editor.Properties.View.GetFocusedRowCellValue("NameJP"));
                _maker      = Convert.ToString(editor.Properties.View.GetFocusedRowCellValue("Maker"));
                _model      = Convert.ToString(editor.Properties.View.GetFocusedRowCellValue("Model"));
                _series     = Convert.ToString(editor.Properties.View.GetFocusedRowCellValue("Series"));
                _orgCountry = Convert.ToString(editor.Properties.View.GetFocusedRowCellValue("OrgCountry"));
                if (editor.Properties.View.GetFocusedRowCellValue("ProDate") != null)
                {
                    _proDate = Convert.ToDateTime(editor.Properties.View.GetFocusedRowCellValue("ProDate"));
                }
                _Lifetime      = Convert.ToInt32(editor.Properties.View.GetFocusedRowCellValue("Lifetime"));
                _netValue      = Convert.ToDecimal(editor.Properties.View.GetFocusedRowCellValue("NetValue_Disposal"));
                _startDeprDate = Convert.ToDateTime(editor.Properties.View.GetFocusedRowCellValue("StartDeprDate"));
                _endDeprDate   = Convert.ToDateTime(editor.Properties.View.GetFocusedRowCellValue("EndDeprDate"));

                //Set value to column ACCcode, NameEN, NameVN, Maker, Model...
                gridView.SetRowCellValue(gridView.FocusedRowHandle, "Code", _code);
                gridView.SetRowCellValue(gridView.FocusedRowHandle, "ACCcode", _ACCcode);
                gridView.SetRowCellValue(gridView.FocusedRowHandle, "NameEN", _nameEN);
                gridView.SetRowCellValue(gridView.FocusedRowHandle, "NameVN", _nameVN);
                gridView.SetRowCellValue(gridView.FocusedRowHandle, "NameJP", _nameJP);
                gridView.SetRowCellValue(gridView.FocusedRowHandle, "Maker", _maker);
                gridView.SetRowCellValue(gridView.FocusedRowHandle, "Model", _model);
                gridView.SetRowCellValue(gridView.FocusedRowHandle, "Series", _series);
                gridView.SetRowCellValue(gridView.FocusedRowHandle, "OrgCountry", _orgCountry);
                gridView.SetRowCellValue(gridView.FocusedRowHandle, "ProDate", _proDate);
                gridView.SetRowCellValue(gridView.FocusedRowHandle, "Lifetime", _Lifetime);
                gridView.SetRowCellValue(gridView.FocusedRowHandle, "NetValue_Disposal", _netValue);
                gridView.SetRowCellValue(gridView.FocusedRowHandle, "StartDeprDate", _startDeprDate);
                gridView.SetRowCellValue(gridView.FocusedRowHandle, "EndDeprDate", _endDeprDate);
            }
        }
Example #15
0
 private void fld_lkeARSaleOrderPaymentMethodType_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
 {
     LookUpEdit lke = (LookUpEdit)sender;
     //if (e.Value != null && lke.OldEditValue != e.Value)
     //{
     //    ((SaleOrderModule)Module).SaleOrderPaymentMethod(e.Value.ToString());
     //}
 }
Example #16
0
        private void repositoryItemGridLookUpEdit2_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
        {
            if (gridView1 == null)
            {
                return;
            }
            GridView view = gridView1;

            GridLookUpEdit gridLookUpEdit = sender as GridLookUpEdit;
            DataRow        lookupRow      = gridLookUpEdit.Properties.View.GetFocusedDataRow();

            //string ID = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "SCat_ID").ToString();
            //if (ID == "" && !(gridView1.IsFirstRow))
            //{
            //    int PreRow = gridView1.GetPrevVisibleRow(gridView1.FocusedRowHandle);
            //    string SCat_ID = gridView1.GetRowCellValue(PreRow, "SCat_ID").ToString();
            //    if (SCat_ID != "")
            //    {
            //        //string SCat_D = gridView1.GetRowCellValue(PreRow, "SCat_D").ToString();
            //        string SCat_DD = gridView1.GetRowCellValue(PreRow, "SCat_DD").ToString();

            //        view.SetRowCellValue(view.FocusedRowHandle, view.Columns["SCat_DD"], SCat_DD);
            //        //view.SetRowCellValue(view.FocusedRowHandle, view.Columns["SCat_D"], SCat_D);
            //        view.SetRowCellValue(view.FocusedRowHandle, view.Columns["SCat_ID"], SCat_ID);
            //    }
            //}

            if (lookupRow != null)
            {
                int item_ID = Convert.ToInt32(lookupRow["Item_ID"]);
                if (item_ID != 0)
                {
                    string Sub_ID    = lookupRow["SCat_ID"].ToString();
                    string Item_Name = lookupRow["Item_DD"].ToString();
                    string item_Code = lookupRow["Item_D"].ToString();
                    string color     = lookupRow["Color_DD"].ToString();
                    string Unit      = lookupRow["Item_Unit"].ToString();
                    string Rate      = lookupRow["Item_Rate"].ToString();

                    view.SetRowCellValue(view.FocusedRowHandle, view.Columns["SCat_ID"], Sub_ID);
                    view.SetRowCellValue(view.FocusedRowHandle, view.Columns["Item_ID"], item_ID);
                    view.SetRowCellValue(view.FocusedRowHandle, view.Columns["Item_D"], item_Code);
                    view.SetRowCellValue(view.FocusedRowHandle, view.Columns["Color_DD"], color);
                    view.SetRowCellValue(view.FocusedRowHandle, view.Columns["Item_Unit"], Unit);
                    view.SetRowCellValue(view.FocusedRowHandle, view.Columns["R_Rate"], Rate);
                    view.SetRowCellValue(view.FocusedRowHandle, view.Columns["Item_DD"], Item_Name);
                }
            }
            else
            {
                view.SetRowCellValue(view.FocusedRowHandle, view.Columns["Item_DD"], string.Empty);
            }
            if (view.GetRowCellValue(view.FocusedRowHandle, view.Columns["Item_DD"]).ToString() != "")
            {
                gridView1.FocusedColumn = gridView1.Columns["I_Qty"];
            }
            gridView1.ShowEditor();
        }
Example #17
0
 private void grid_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
 {
     if (findEdit != null)
     {
         findEdit.TextChanged -= findEdit_TextChanged;
         findEdit              = (sender as IPopupControl).PopupWindow.Controls[2].Controls[0].Controls[7] as TextEdit;
         searchText            = findEdit.Text;
     }
 }
Example #18
0
        private void fld_lkeHRTimeSheetType_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
        {
            VinaLookupEdit lke = (VinaLookupEdit)sender;

            if (e.Value != null && lke.OldEditValue != e.Value)
            {
                ((TimeSheetModule)Module).ChangeTimeSheetType(e.Value.ToString());
            }
        }
Example #19
0
        private void fld_lkeFK_ARCustomerID_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
        {
            LookUpEdit lke = (LookUpEdit)sender;

            if (e.Value != null && e.Value != lke.OldEditValue)
            {
                ((ProposalModule)Module).ChangeCustomer(Convert.ToInt32(e.Value));
            }
        }
Example #20
0
        private void fld_lkeFK_ADWorkingShiftID_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
        {
            VinaLookupEdit lke = (VinaLookupEdit)sender;

            if (e.Value != null && e.Value != lke.OldEditValue)
            {
                ((OverTimeModule)Module).UpdateHREmployeeOTByWorkingShift(Convert.ToInt32(e.Value));
            }
        }
Example #21
0
        private void Fld_lkdFK_ICStockID_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
        {
            LookUpEdit lke = (LookUpEdit)sender;

            if (e.Value != null && e.Value != lke.OldEditValue)
            {
                int stockID = Convert.ToInt32(e.Value);
                ((SaleOrderShipmentModule)Module).ChangeStock(stockID);
            }
        }
Example #22
0
        void gluMau6_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
        {
            if (e.CloseMode == PopupCloseMode.Cancel || e.Value == null || e.Value == DBNull.Value)
            {
                return;
            }
            DataRow drMaster = (_data.BsMain.Current as DataRowView).Row;

            drMaster["Hinh6"] = db.GetValue(string.Format(sqlLayMau, e.Value));
        }
Example #23
0
        private void repositoryItemLookUpEdit3_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
        {
            DataRowView Look_Row = repositoryItemLookUpEdit3.GetDataSourceRowByKeyValue(e.Value) as DataRowView;

            if (Look_Row != null)
            {
                Fill_Items(Convert.ToInt32(e.Value));
                gridView1.SetRowCellValue(gridView1.FocusedRowHandle, "SCat_ID", Look_Row.Row["SCat_ID"]);
                gridView1.FocusedColumn = gridView1.Columns["Item_ID"];
            }
        }
Example #24
0
        void riCode_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
        {
            if (e.CloseMode != DevExpress.XtraEditors.PopupCloseMode.Normal)
            {
                return;
            }
            GridLookUpEdit glu = sender as GridLookUpEdit;

            if (glu.Properties.View.FocusedRowHandle < 0)
            {
                return;
            }
            DataRowView drv  = glu.Properties.View.GetRow(glu.Properties.View.FocusedRowHandle) as DataRowView;
            string      code = drv["Pno"].ToString();
            string      nhom = drv["Nhom"].ToString();
            string      bac  = drv["Bac"].ToString();

            if (nhom == "")
            {
                return;
            }
            DataTable dt = (glu.Properties.DataSource as BindingSource).DataSource as DataTable;

            DataRow[] drs = dt.Select("Pno = '" + code + "' and Nhom = '" + nhom + "'");// and Bac <> '" +bac+"'
            if (drs.Length == 0)
            {
                return;
            }
            gvMain.SetFocusedRowCellValue(gvMain.Columns["Code"], code);
            gvMain.UpdateCurrentRow();
            gvMain.ActiveFilterString = "Pno = '" + code + "' and Nhom = '" + nhom + "'";
            for (int i = 0; i < drs.Length; i++)
            {
                DataRow dr = drs[i];
                if (gvMain.DataRowCount > 0 && dr["Bac"].ToString() == bac)
                {
                    continue;
                }
                gvMain.AddNewRow();
                gvMain.SetFocusedRowCellValue(gvMain.Columns["Code"], dr["Pno"]);
                gvMain.SetFocusedRowCellValue(gvMain.Columns["NgayNhap"], dr["NgayCT"]);
                gvMain.SetFocusedRowCellValue(gvMain.Columns["Nhom"], dr["Nhom"]);
                gvMain.SetFocusedRowCellValue(gvMain.Columns["SLTon"], dr["SLTon"]);
                gvMain.SetFocusedRowCellValue(gvMain.Columns["SLCuonTon"], dr["SLCuonTon"]);
                gvMain.SetFocusedRowCellValue(gvMain.Columns["Rong"], dr["Rong"]);
                gvMain.SetFocusedRowCellValue(gvMain.Columns["Dai"], dr["Dai"]);
                gvMain.SetFocusedRowCellValue(gvMain.Columns["Day"], dr["Day"]);
                gvMain.SetFocusedRowCellValue(gvMain.Columns["MaKeCu"], dr["MaKe"]);
                gvMain.SetFocusedRowCellValue(gvMain.Columns["MaNganCu"], dr["MaNgan"]);
                gvMain.UpdateCurrentRow();
            }
            gvMain.ActiveFilterString = "";
            gvMain.BestFitColumns();
        }
Example #25
0
        private void Fld_lkeFK_GECurrencyID_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
        {
            LookUpEdit lke = (LookUpEdit)sender;

            if (e.Value != null && lke.OldEditValue != e.Value)
            {
                int currencyID = 0;
                Int32.TryParse(e.Value.ToString(), out currencyID);
                ((ProposalModule)Module).ChangeCurrency(currencyID);
            }
        }
Example #26
0
 private void cboNhomQuyen_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
 {
     if (e.Value != null)
     {
         NhomQuyen objNhomQuyen = cboNhomQuyen.Properties.GetRowByKeyValue(e.Value) as NhomQuyen;
         if (objNhomQuyen != null)
         {
             //Init
             ChonNhomQuyen(objNhomQuyen.MaNhomQuyen);
         }
     }
 }
Example #27
0
        private void controlState_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
        {
            viewModel.Statuses.Clear();

            for (int i = 0; i < controlState.Properties.Items.Count; i++)
            {
                if (controlState.Properties.Items[i].CheckState == CheckState.Checked)
                {
                    viewModel.Statuses.Add((JointStatus)controlState.Properties.Items[i].Value);
                }
            }
        }
Example #28
0
        private void pipeMillStatus_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
        {
            viewModel.CheckedStatusTypes.Clear();

            for (int i = 0; i < pipeMillStatus.Properties.Items.Count; i++)
            {
                if (pipeMillStatus.Properties.Items[i].CheckState == CheckState.Checked)
                {
                    viewModel.CheckedStatusTypes.Add((PipeMillStatus)pipeMillStatus.Properties.Items[i].Value);
                }
            }
        }
Example #29
0
 private void fld_lkeARSaleOrderPaymentTerm_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
 {
     LookUpEdit lke = (LookUpEdit)sender;
     //if (e.Value != null && lke.OldEditValue != e.Value)
     //{
     //    int paymentTermID = 0;
     //    if (int.TryParse(e.Value.ToString(), out paymentTermID))
     //    {
     //        ((SaleOrderModule)Module).GeneratePaymentTime(paymentTermID);
     //    }
     //}
 }
Example #30
0
        private void pipeSize_CloseUp(object sender, DevExpress.XtraEditors.Controls.CloseUpEventArgs e)
        {
            viewModel.CheckedPipeTypes.Clear();

            for (int i = 0; i < pipeSize.Properties.Items.Count; ++i)
            {
                if (pipeSize.Properties.Items[i].CheckState == CheckState.Checked)
                {
                    viewModel.CheckedPipeTypes
                    .Add(pipeSize.Properties.Items[i].Value as PipeMillSizeType);
                }
            }
        }