Esempio n. 1
0
        private void cmdAdd_Click(object sender, EventArgs e)
        {
            switch (selectedGrid)
            {
            case enumSelectedGrid.MutasiDetailSelected:
                if (this.dataGridMutasiHeader.SelectedCells.Count > 0)
                {
                    string typeMutasi = string.Empty;
                    if (dataGridMutasiHeader.RowCount > 0)
                    {
                        typeMutasi = dataGridMutasiHeader.SelectedCells[0].OwningRow.Cells["Type"].Value.ToString().Trim();
                    }
                    FillHeader();
                    try
                    {
                        GlobalVar.LastClosingDate = (DateTime)dataGridMutasiHeader.SelectedCells[0].OwningRow.Cells["TglMutasi"].Value;
                        if ((DateTime)dataGridMutasiHeader.SelectedCells[0].OwningRow.Cells["TglMutasi"].Value <= GlobalVar.LastClosingDate)
                        {
                            throw new Exception(String.Format(Messages.Error.AlreadyClosingPJT, GlobalVar.LastClosingDate));
                        }
                        ArusStock.frmUpdateMutasiDetail ifrmChild = new ArusStock.frmUpdateMutasiDetail(this, _rowID, _MutasiID, typeMutasi);
                        ifrmChild.MdiParent = Program.MainForm;
                        Program.MainForm.RegisterChild(ifrmChild);
                        ifrmChild.Show();
                    }
                    catch (Exception ex)
                    {
                        Error.LogError(ex);
                    }
                }
                break;

            case enumSelectedGrid.MutasiHeaderSelected:
                if (dataGridMutasiHeader.SelectedCells.Count > 0 || dataGridMutasiHeader.SelectedCells.Count == 0)
                {
                    ArusStock.frmMutasiUpdate ifrmChild = new ArusStock.frmMutasiUpdate(this);
                    ifrmChild.MdiParent = Program.MainForm;
                    Program.MainForm.RegisterChild(ifrmChild);
                    ifrmChild.Show();
                }
                break;
            }
        }
Esempio n. 2
0
        private void cmdEdit_Click(object sender, EventArgs e)
        {
            if (!lUserAccess())
            {
                MessageBox.Show("Belum ada wewenang.");
                return;
            }

            switch (selectedGrid)
            {
            case enumSelectedGrid.MutasiDetailSelected:
                if (this.dataGridMutasiDetail.SelectedCells.Count > 0)
                {
                    string typeMutasi = string.Empty;
                    if (dataGridMutasiHeader.RowCount > 0)
                    {
                        typeMutasi = dataGridMutasiHeader.SelectedCells[0].OwningRow.Cells["Type"].Value.ToString().Trim();
                    }

                    FillDetail();
                    if (dataGridMutasiDetail.SelectedCells[0].OwningRow.Cells["SyncFlagD"].Value.ToString() == "1")
                    {
                        if (!SecurityManager.AskPasswordManager())
                        {
                            return;
                        }
                    }
                    try
                    {
                        GlobalVar.LastClosingDate = (DateTime)dataGridMutasiHeader.SelectedCells[0].OwningRow.Cells["TglMutasi"].Value;
                        if ((DateTime)dataGridMutasiHeader.SelectedCells[0].OwningRow.Cells["TglMutasi"].Value <= GlobalVar.LastClosingDate)
                        {
                            throw new Exception(String.Format(Messages.Error.AlreadyClosingPJT, GlobalVar.LastClosingDate));
                        }
                        ArusStock.frmUpdateMutasiDetail ifrmChild = new ArusStock.frmUpdateMutasiDetail(this, _rowIDD, typeMutasi);

                        ifrmChild.MdiParent = Program.MainForm;
                        Program.MainForm.RegisterChild(ifrmChild);
                        ifrmChild.Show();
                    }
                    catch (System.Exception ex)
                    {
                        Error.LogError(ex);
                    }
                }
                break;

            case enumSelectedGrid.MutasiHeaderSelected:
                if (this.dataGridMutasiHeader.SelectedCells.Count > 0)
                {
                    FillHeader();
                    if (dataGridMutasiHeader.SelectedCells[0].OwningRow.Cells["SyncFlag"].Value.ToString() == "1")
                    {
                        if (!SecurityManager.AskPasswordManager())
                        {
                            return;
                        }
                    }
                    try
                    {
                        GlobalVar.LastClosingDate = (DateTime)dataGridMutasiHeader.SelectedCells[0].OwningRow.Cells["TglMutasi"].Value;
                        if ((DateTime)dataGridMutasiHeader.SelectedCells[0].OwningRow.Cells["TglMutasi"].Value <= GlobalVar.LastClosingDate)
                        {
                            throw new Exception(String.Format(Messages.Error.AlreadyClosingPJT, GlobalVar.LastClosingDate));
                        }

                        ArusStock.frmMutasiUpdate ifrmChild = new ArusStock.frmMutasiUpdate(this, _rowID);
                        ifrmChild.MdiParent = Program.MainForm;
                        Program.MainForm.RegisterChild(ifrmChild);
                        ifrmChild.Show();
                    }
                    catch (System.Exception ex)
                    {
                        Error.LogError(ex);
                    }
                }
                break;
            }
        }
Esempio n. 3
0
        private void cmdAdd_Click(object sender, EventArgs e)
        {
            if (!lUserAccess())
            {
                MessageBox.Show("Belum ada wewenang.");
                return;
            }

            switch (selectedGrid)
            {
            case enumSelectedGrid.MutasiDetailSelected:
                if (this.dataGridMutasiHeader.SelectedCells.Count > 0)
                {
                    //bool isAllowIED = CekFlagOpnameMutasi();
                    //if (isAllowIED)
                    //{
                    string typeMutasi = string.Empty;
                    if (dataGridMutasiHeader.RowCount > 0)
                    {
                        typeMutasi = dataGridMutasiHeader.SelectedCells[0].OwningRow.Cells["Type"].Value.ToString().Trim();
                    }
                    FillHeader();
                    try
                    {
                        GlobalVar.LastClosingDate = (DateTime)dataGridMutasiHeader.SelectedCells[0].OwningRow.Cells["TglMutasi"].Value;
                        if ((DateTime)dataGridMutasiHeader.SelectedCells[0].OwningRow.Cells["TglMutasi"].Value <= GlobalVar.LastClosingDate)
                        {
                            throw new Exception(String.Format(Messages.Error.AlreadyClosingPJT, GlobalVar.LastClosingDate));
                        }
                        ArusStock.frmUpdateMutasiDetail ifrmChild = new ArusStock.frmUpdateMutasiDetail(this, _rowID, _MutasiID, typeMutasi);
                        ifrmChild.MdiParent = Program.MainForm;
                        Program.MainForm.RegisterChild(ifrmChild);
                        ifrmChild.Show();
                    }
                    catch (Exception ex)
                    {
                        Error.LogError(ex);
                    }
                    //}
                    //else
                    //{
                    //    MessageBox.Show("Silahkan Ijin ke HO untuk melakukan Mutasi");
                    //}
                }
                break;

            case enumSelectedGrid.MutasiHeaderSelected:
                if (dataGridMutasiHeader.SelectedCells.Count > 0 || dataGridMutasiHeader.SelectedCells.Count == 0)
                {
                    //bool isAllowIED = CekFlagOpnameMutasi();
                    //if (isAllowIED)
                    //{
                    ArusStock.frmMutasiUpdate ifrmChild = new ArusStock.frmMutasiUpdate(this);
                    ifrmChild.MdiParent = Program.MainForm;
                    Program.MainForm.RegisterChild(ifrmChild);
                    ifrmChild.Show();
                    //}
                    //else
                    //{
                    //    MessageBox.Show("Silahkan Ijin ke HO untuk melakukan Mutasi");
                    //}
                }
                break;
            }
        }