Exemplo n.º 1
0
        private void bbi_Delete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (!MspTool.PermissionControl(AppMain.User.username, SecRightType.Delete, (int)DocumentType.Satis, AppMain.CompanyRecId))
            {
                return;
            }

            SaleOwnerDTO oRow = (SaleOwnerDTO)gridView1.GetFocusedRow();

            if (oRow != null)
            {
                if (mspTool.get_Question("Kayıt Silinecektir. Onaylıyor musunuz?"))
                {
                    var result = _repository.Run <SaleService, ActionResponse <SaleOwnerDTO> >(x => x.Delete_Sale(oRow));
                    if (result.ResponseType != ResponseType.Ok)
                    {
                        XtraMessageBox.Show(result.Message);
                    }
                    else
                    {
                        do_refresh(dt_Date.DateTime);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void btnAddNewCustomer_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {

            if (!MspTool.PermissionControl(AppMain.User.username, SecRightType.Insert, (int)DocumentType.MusteriList, AppMain.CompanyRecId)) return;

            frmCustomerEdit frm = new frmCustomerEdit();
            frm._FormOpenType = Msp.Infrastructure.FormOpenType.New;
            frm.Show(0);
        }
Exemplo n.º 3
0
 private void do_Form(CustomersDTO Customers)
 {
     Form _Form = MspTool.get_OpenForm("frmSatis");
     if (_Form != null)
     {
         ((frmSatis)_Form).CustomerSelect(Customers);
     }
     _Form = null;
 }
Exemplo n.º 4
0
        private void btnBankEntryAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (!MspTool.PermissionControl(AppMain.User.username, SecRightType.Insert, (int)DocumentType.BankEntry, AppMain.CompanyRecId))
            {
                return;
            }
            frmBankEntryEdit frm = new frmBankEntryEdit();

            frm._FormOpenType = Msp.Infrastructure.FormOpenType.New;
            frm.Show(0);
        }
Exemplo n.º 5
0
 private void bbi_save_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (!MspTool.PermissionControl(AppMain.User.username, SecRightType.Insert, (int)DocumentType.CurrentGroupDefinitions, AppMain.CompanyRecId))
     {
         return;
     }
     if (oTool.get_Question("Kaydedilecektir Onaylıyor musunuz ?"))
     {
         gridView1.CloseEditor();
         do_save();
     }
 }
Exemplo n.º 6
0
        private void bbi_New_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (!MspTool.PermissionControl(AppMain.User.username, SecRightType.Insert, (int)DocumentType.Company, AppMain.CompanyRecId))
            {
                return;
            }

            FrmCompanyEdit _Form = new FrmCompanyEdit();

            _Form._FormOpenType = Infrastructure.FormOpenType.New;
            _Form.Show(0);
        }
Exemplo n.º 7
0
 public void do_indirimUygula()
 {
     if (indirimTutar > 0)
     {
         Form _Form = MspTool.get_OpenForm("frmSatis");
         if (_Form != null)
         {
             ((frmSatis)_Form).IskontoUygula(indirimTutar);
         }
         _Form = null;
         this.Close();
     }
 }
Exemplo n.º 8
0
        private void btnRemCustomer_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (!MspTool.PermissionControl(AppMain.User.username, SecRightType.Delete, (int)DocumentType.MusteriList, AppMain.CompanyRecId)) return;

            CustomersDTO oRow = (CustomersDTO)gcvCustomers.GetFocusedRow();

            if (oRow != null)
            {
                if (get_Question("Kayıt Silinecektir. Onaylıyor musunuz?"))
                {
                    var result = _repository.Run<CustomerService, ActionResponse<CustomersDTO>>(x => x.DeleteCostumers(oRow.id));
                    do_refresh();
                }
            }
        }
Exemplo n.º 9
0
        public void do_edit()
        {
            if (!MspTool.PermissionControl(AppMain.User.username, SecRightType.Update, (int)DocumentType.KasaHareketi, AppMain.CompanyRecId))
            {
                return;
            }
            var oRow = (CaseMovementDTO)gridView1.GetFocusedRow();

            if (oRow != null)
            {
                frmKasaHareketi frm = new frmKasaHareketi();
                frm._FormOpenType = FormOpenType.Edit;
                frm.Show(oRow.RecId);
            }
        }
Exemplo n.º 10
0
        public void do_Edit()
        {
            if (!MspTool.PermissionControl(AppMain.User.username, SecRightType.Update, (int)DocumentType.CariList, AppMain.CompanyRecId))
            {
                return;
            }
            CTransactionsDTO Orow = (CTransactionsDTO)gcv_CurTrans.GetFocusedRow();

            if (Orow != null)
            {
                frmCariEdit frm = new frmCariEdit();
                frm._FormOpenType = Msp.Infrastructure.FormOpenType.Edit;
                frm.Show(Orow.CurID);
            }
        }
Exemplo n.º 11
0
        public void do_Edit()
        {
            if (!MspTool.PermissionControl(AppMain.User.username, SecRightType.Update, (int)DocumentType.Depot, AppMain.CompanyRecId))
            {
                return;
            }
            DepotDTO Orow = (DepotDTO)gcv_Depot.GetFocusedRow();

            if (Orow != null)
            {
                frmDepoEdit frm = new frmDepoEdit();
                frm._FormOpenType = Infrastructure.FormOpenType.Edit;
                frm.Show(Orow.DID);
            }
        }
Exemplo n.º 12
0
        public void do_Edit()
        {
            if (!MspTool.PermissionControl(AppMain.User.username, SecRightType.Update, (int)DocumentType.BankEntry, AppMain.CompanyRecId))
            {
                return;
            }
            BankEntryDTO Orow = (BankEntryDTO)gcv_BankEntry.GetFocusedRow();

            if (Orow != null)
            {
                frmBankEntryEdit frm = new frmBankEntryEdit();
                frm._FormOpenType = Infrastructure.FormOpenType.Edit;
                frm.Show(Orow.bid);
            }
        }
Exemplo n.º 13
0
        public void do_Edit()
        {
            if (!MspTool.PermissionControl(AppMain.User.username, SecRightType.Update, (int)DocumentType.MusteriList, AppMain.CompanyRecId)) return;
            CustomersDTO Orow = (CustomersDTO)gcvCustomers.GetFocusedRow();
            if (Orow != null)
            {
                frmCustomerEdit frm = new frmCustomerEdit();
                frm._FormOpenType = Infrastructure.FormOpenType.Edit;
                frm.Show(Orow.id);

            }




        }
Exemplo n.º 14
0
        private void do_edit()
        {
            if (!MspTool.PermissionControl(AppMain.User.username, SecRightType.Update, (int)DocumentType.Company, AppMain.CompanyRecId))
            {
                return;
            }

            CompanyDTO oRow = (CompanyDTO)gcv_company.GetFocusedRow();

            if (oRow != null)
            {
                FrmCompanyEdit _Form = new FrmCompanyEdit();
                _Form._FormOpenType = Infrastructure.FormOpenType.Edit;
                _Form.Show(oRow.RecId);
            }
        }
Exemplo n.º 15
0
        private void btnRemoveDepot_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (!MspTool.PermissionControl(AppMain.User.username, SecRightType.Delete, (int)DocumentType.Depot, AppMain.CompanyRecId))
            {
                return;
            }
            DepotDTO oRow = (DepotDTO)gcv_Depot.GetFocusedRow();

            if (oRow != null)
            {
                if (get_Question("Kayıt Silinecektir. Onaylıyor musunuz?"))
                {
                    var result = _repository.Run <DepotService, ActionResponse <DepotDTO> >(x => x.DeleteDepot(oRow.DID));
                    do_refresh();
                }
            }
        }
Exemplo n.º 16
0
        private void bbi_Delete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            PaymentTypeDTO oRow = (PaymentTypeDTO)gridView1.GetFocusedRow();

            if (oRow != null)
            {
                if (!MspTool.PermissionControl(AppMain.User.username, SecRightType.Delete, (int)DocumentType.CurrentGroupDefinitions, AppMain.CompanyRecId))
                {
                    return;
                }

                if (oTool.get_Question("Kayıt Silinecektir. Onaylıyor musunuz?"))
                {
                    var result = _repository.Run <DepotStockService, ActionResponse <CurrentGroupDefinitionsDTO> >(x => x.Delete__CurrentGroupDefinitions(oRow.RecId));
                    do_refresh();
                }
            }
        }
Exemplo n.º 17
0
        private void do_Form(int RecId)
        {
            Form _Form_Satis = MspTool.get_OpenForm("frmSatis");

            if (_Form_Satis != null)
            {
                ((frmSatis)_Form_Satis).Insert_Product(RecId);
            }

            Form _Form_Satis_ProducM = MspTool.get_OpenForm("frmSaleProductMovemnet");

            if (_Form_Satis_ProducM != null)
            {
                ((frmSaleProductMovemnet)_Form_Satis_ProducM).Insert_Product(RecId);
            }

            _Form_Satis_ProducM = null;
            _Form_Satis         = null;
        }
Exemplo n.º 18
0
 public void do_select()
 {
     try
     {
         var  oRow  = (OrderOwnerDTO)gcv_OrderList.GetFocusedRow();
         Form _Form = MspTool.get_OpenForm("InvoiceEdit");
         if (_Form != null)
         {
             ((InvoiceEdit)_Form).do_SiparisSec(oRow.RecId);
         }
         _Form = null;
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(ex.Message);
     }
     finally
     {
         this.Close();
     }
 }
Exemplo n.º 19
0
 private void btnRemCustomer_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         if (!MspTool.PermissionControl(AppMain.User.username, SecRightType.Delete, (int)DocumentType.KasaHareketi, AppMain.CompanyRecId))
         {
             XtraMessageBox.Show("Silme Yetkiniz Yoktur.", "", MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
         }
         var oRow = (CaseMovementDTO)gridView1.GetFocusedRow();
         if (oRow != null)
         {
             if (mspTool.get_Question("Kayıt Silinecektir. Onaylıyor musunuz?"))
             {
                 var result = _repository.Run <CaseService, ActionResponse <CaseMovementDTO> >(x => x.Delete_Case(oRow));
                 do_refresh();
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
Exemplo n.º 20
0
        private void btnRemProduct_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (!MspTool.PermissionControl(AppMain.User.username, SecRightType.Delete, (int)DocumentType.StockList, AppMain.CompanyRecId))
            {
                return;
            }
            ProductDTO oRow = (ProductDTO)gcvProducts.GetFocusedRow();

            if (oRow != null)
            {
                if (get_Question("Kayıt Silinecektir. Onaylıyor musunuz?"))
                {
                    var result = _repository.Run <DepotStockService, ActionResponse <ProductDTO> >(x => x.DeleteProduct(oRow.PID));
                    if (result.ResponseType != ResponseType.Error)
                    {
                        if (AppMain.Products.Any(x => x.PID == oRow.PID))
                        {
                            AppMain.Products.Remove(oRow);
                        }
                    }
                    do_refresh();
                }
            }
        }
Exemplo n.º 21
0
        private void bbi_Delete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            PaymentTypeDTO oRow = (PaymentTypeDTO)gridView1.GetFocusedRow();

            if (oRow != null)
            {
                if (!MspTool.PermissionControl(AppMain.User.username, SecRightType.Delete, (int)DocumentType.PaymentType, AppMain.CompanyRecId))
                {
                    return;
                }

                if (oRow.Remark.Trim() == "Nakit" || oRow.Remark.Trim() == "Pos" || oRow.Remark.Trim() == "Pos & Nakit")
                {
                    XtraMessageBox.Show("Silinemiycek Kayıtdır.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }

                if (oTool.get_Question("Kayıt Silinecektir. Onaylıyor musunuz?"))
                {
                    var result = _repository.Run <DepotStockService, ActionResponse <PaymentTypeDTO> >(x => x.DeletePayment(oRow.RecId));
                    do_refresh();
                }
            }
        }
Exemplo n.º 22
0
        private void Set_Form()
        {
            #region CreateFile
            string root = @"C:\Msp";
            if (!Directory.Exists(root))
            {
                Directory.CreateDirectory(root);
            }
            string MspBacUp = @"C:\Msp\BackUp";
            if (!Directory.Exists(MspBacUp))
            {
                Directory.CreateDirectory(MspBacUp);
            }
            string MspModuls = @"C:\Msp\Moduls";
            if (!Directory.Exists(MspModuls))
            {
                Directory.CreateDirectory(MspModuls);
            }
            string path = @"C:\Msp\ConnectString.txt";
            if (!File.Exists(path))
            {
                using (StreamWriter sw = File.CreateText(path))
                {
                    string sifrele = SecurityExtension.Sifrele("data source=DG;initial catalog=msp;user id=sa;password=123D654!;");
                    sw.WriteLine(sifrele);
                }
                AppMain.LocalConnect = false;
            }
            #endregion

            if (!AppMain.LocalConnect)
            {
                string[] conArry;
                using (StreamReader sr = File.OpenText(path))
                {
                    string str = SecurityExtension.Sifre_Coz(sr.ReadLine());
                    conArry = str.Split(';');
                }
                List <string> conn = new List <string>();
                foreach (var item in conArry)
                {
                    int position = item.IndexOf("=");
                    if (position < 0)
                    {
                        continue;
                    }
                    conn.Add(item.Substring(position + 1));
                }
                AppMain.SqlConnection = new ConnectionDTO
                {
                    Database = conn[1], //Global.SqlConnection.Database,
                    Server   = conn[0], //"R00T\\SQLEXPRESS", //Global.SqlConnection.Server,
                    Password = conn[3], //Global.SqlConnection.Password,
                    UserId   = conn[2]  //Global.SqlConnection.UserId
                };

                if (MspTool.sqlKontrol(AppMain.SqlConnection.Server, AppMain.SqlConnection.Database, AppMain.SqlConnection.UserId, AppMain.SqlConnection.Password) == false)
                {
                    XtraMessageBox.Show("Bağlantı hatası.Veritabanı ayarlarınızı kontrol ediniz...", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }
            else
            {
                string[] conArry;
                using (StreamReader sr = File.OpenText(path))
                {
                    string str = SecurityExtension.Sifre_Coz(sr.ReadLine());
                    conArry = str.Split(';');
                }
                List <string> conn = new List <string>();
                foreach (var item in conArry)
                {
                    int position = item.IndexOf("=");
                    if (position < 0)
                    {
                        continue;
                    }
                    conn.Add(item.Substring(position + 1));
                }
                AppMain.SqlConnection = new ConnectionDTO
                {
                    Database = conn[1],
                    Server   = conn[0]
                };
                if (MspTool.sqlKontrol(AppMain.SqlConnection.Server, AppMain.SqlConnection.Database) == false)
                {
                    XtraMessageBox.Show("Bağlantı hatası.Veritabanı ayarlarınızı kontrol ediniz...", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }


            LoadDatabase();
        }