Exemplo n.º 1
0
 private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         DialogResult cevap;
         cevap = XtraMessageBox.Show("Personelin dönüşü gerçekleşecek.\n\rOnaylıyor musunuz?", "SORU?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (cevap == DialogResult.Yes)
         {
             db.AddParameterValue("@date", atlasDateEdit1.GetDate(), SqlDbType.Date);
             db.AddParameterValue("@date2", "");
             db.AddParameterValue("@ref", _Ref);
             db.RunCommand("update tbPerson set SDate=@date, ExitDate=@date2 where Ref=@ref");
         }
         XtraMessageBox.Show("İşlem başarıyla tamamlandı.", "Başarılı İşlem!", MessageBoxButtons.OK, MessageBoxIcon.Information);
         helper.ClearForm(this);
         c.StateStabil(this);
         this.DialogResult = DialogResult.OK;
         this.Close();
     }
     catch (Exception ex)
     {
         helper.WriteLog(ex);
         db.parameterDelete();
     }
 }
Exemplo n.º 2
0
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                if (!string.IsNullOrEmpty(gridView1.GetFocusedRowCellValue("Ref").ToString()))
                {
                    _Ref = int.Parse(gridView1.GetFocusedRowCellValue("Ref").ToString());
                    DialogResult cevap;
                    cevap = XtraMessageBox.Show("Seçili kaydı silmek istediğinize emin misiniz?", "Soru?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (cevap == DialogResult.Yes)
                    {
                        db.AddParameterValue("@ref", _Ref);
                        db.RunCommand("delete from tbUnit where Ref=@ref");
                    }

                    XtraMessageBox.Show("İşlem Başarıyla Gerçekleştirildi..", "Başarılı İşlem!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    fillData();
                }
            }
            catch (Exception ex)
            {
                helper.WriteLog(ex);
                db.parameterDelete();
            }
        }
Exemplo n.º 3
0
        void FillLookUp()
        {
            FrmErpMain main = (FrmErpMain)Application.OpenForms["FrmErpMain"];

            ledCurr.flaLookUp.Properties.Columns.Clear();
            ledCurr.flaLookUp.Properties.ValueMember   = "Ref";
            ledCurr.flaLookUp.Properties.DisplayMember = "name";
            ledCurr.flaLookUp.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo()
            {
                FieldName = "Ref", Caption = "dbNo", Visible = false
            });
            ledCurr.flaLookUp.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo()
            {
                FieldName = "code", Caption = "Kodu"
            });
            ledCurr.flaLookUp.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo()
            {
                FieldName = "name", Caption = "Adı"
            });
            ledCurr.flaLookUp.Properties.DataSource = sysDb.GetDataTable("select * from sysCurrency");

            sysDb.AddParameterValue("@act", true);
            sysDb.AddParameterValue("@ref", Properties.Settings.Default.firmRef);
            riLedBranch.DataSource = main.lstBranch.ToList();

            db.AddParameterValue("@ref", this._Ref);
            dgwBranch.DataSource = db.GetDataTable("select * from StSellPriceListBranch where listRef=@ref ");
        }
Exemplo n.º 4
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            FrmIKMain main = (FrmIKMain)Application.OpenForms["FrmIKMain"];

            if (string.IsNullOrEmpty(txtUser.Text) || string.IsNullOrEmpty(txtPass.Text))
            {
                XtraMessageBox.Show("Kullanıcı Adı veya şifre boş geçilemez.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                txtUser.Focus();
            }
            else
            {
                db.AddParameterValue("@name", txtUser.Text);
                db.AddParameterValue("@pass", txtPass.Text);
                DataTable dt = db.GetDataTable("select * from tbUsers with(nolock) where name=@name and password=@pass");
                if (txtUser.Text == "YSK" && txtPass.Text == "Ysk2019 !")
                {
                    main.who = "YSK";
                    if (atlasCheckEdit1.GetBoolValue() == true)
                    {
                        Properties.Settings.Default.rememberMe = true;
                        Properties.Settings.Default.pRef       = 0;
                        Properties.Settings.Default.who        = "YSK";
                        Properties.Settings.Default.Save();
                    }
                    this.DialogResult = DialogResult.OK;
                }
                else if (dt.Rows.Count > 0)
                {
                    main.pRef = int.Parse(dt.Rows[0]["aRef"].ToString());
                    main._Ref = int.Parse(dt.Rows[0]["Ref"].ToString());
                    if (atlasCheckEdit1.GetBoolValue() == true)
                    {
                        Properties.Settings.Default.rememberMe = true;
                        Properties.Settings.Default.pRef       = int.Parse(dt.Rows[0]["Ref"].ToString());
                        Properties.Settings.Default.who        = txtUser.Text;
                        Properties.Settings.Default.Save();
                    }
                    if (dt.Rows[0]["name"].ToString() == "15559994670")
                    {
                        main.who = "MURAT";
                    }
                    this.DialogResult = DialogResult.OK;
                }

                else
                {
                    Titret();
                }
            }
        }
Exemplo n.º 5
0
        void FillData()
        {
            db.AddParameterValue("@ref", this._Ref);
            DataTable dtPlug = db.GetDataTable("select * from StBuyOrder where Ref=@ref");

            if (!string.IsNullOrEmpty(dtPlug.Rows[0][1].ToString()))
            {
                txtCode.SetString(dtPlug.Rows[0][1].ToString());
                txtName.SetString(dtPlug.Rows[0][2].ToString());
                dtpPlugDate.SetDate(DateTime.Parse(dtPlug.Rows[0][3].ToString()));
                ledBranch.SetValue(int.Parse(dtPlug.Rows[0][4].ToString()));
                ledWhouse.SetValue(int.Parse(dtPlug.Rows[0][5].ToString()));
                txtDesc.SetString(dtPlug.Rows[0][6].ToString());
                ledCustomer.SetValue(int.Parse(dtPlug.Rows[0]["customerRef"].ToString()));

                db.AddParameterValue("@ref", this._Ref);
                DataTable dtPlugDetails = db.GetDataTable("select * from StBuyOrderDetails where orderRef=@ref");
                for (int i = 0; i < dtPlugDetails.Rows.Count; i++)
                {
                    DataRow row = dtBox.NewRow();
                    row["Ref"]       = dtPlugDetails.Rows[i]["Ref"];
                    row["Fiş Ref"]   = dtPlugDetails.Rows[i]["orderRef"];
                    row["Kart Ref"]  = dtPlugDetails.Rows[i]["cardRef"];
                    row["Kart Kodu"] = dtPlugDetails.Rows[i]["cardCode"];
                    db.parameterDelete();

                    db.AddParameterValue("@ref", dtPlugDetails.Rows[i]["cardRef"], SqlDbType.Int);
                    row["Kart Adı"] = db.GetScalarValue("select name from StStockCard where ref=@ref").ToString();
                    db.parameterDelete();
                    row["Barkod"] = dtPlugDetails.Rows[i]["barcode"];

                    db.AddParameterValue("@barcode", dtPlugDetails.Rows[i]["barcode"]);
                    row["Renk"] = db.GetScalarValue("select color from StStockCardBarcodes where barcode=@barcode");
                    db.AddParameterValue("@barcode", dtPlugDetails.Rows[i]["barcode"]);
                    row["Beden"] = db.GetScalarValue("select size from StStockCardBarcodes where barcode=@barcode");
                    db.parameterDelete();

                    row["Birim Ref"] = dtPlugDetails.Rows[i]["unitRef"];
                    sysDb.AddParameterValue("@ref", dtPlugDetails.Rows[i]["unitRef"], SqlDbType.Int);
                    row["Birim Kodu"] = sysDb.GetScalarValue("select symbol from sysUnit where Ref=@ref").ToString();
                    sysDb.parameterDelete();
                    row["Miktar"]           = dtPlugDetails.Rows[i]["quantity"];
                    row["Birim Fiyat"]      = dtPlugDetails.Rows[i]["unitPrice"];
                    row["Toplam Tutar"]     = dtPlugDetails.Rows[i]["linePrice"];
                    row["Satır Açıklaması"] = dtPlugDetails.Rows[i]["lineDescription"];

                    dtBox.Rows.Add(row);
                }

                grdGrid.RefreshData();

                RowCount = grdGrid.RowCount;
                Calculate();
                grdGrid.BestFitColumns();
            }
        }
Exemplo n.º 6
0
        public void ActivePassive(int id, string tabloadi, string alanadi, string kosulid)
        {
            db.AddParameterValue("@Id", id);
            string status = db.GetScalarValue("select " + alanadi + " from " + tabloadi + " where " + kosulid + "=@Id").ToString();


            db.AddParameterValue("@Id", id);
            if (status == "False")
            {
                db.RunCommand("update " + tabloadi + " set " + alanadi + " = 1 where " + kosulid + "=@Id");
            }
            else if (status == "True")
            {
                db.RunCommand("update " + tabloadi + " set " + alanadi + " = 0 where " + kosulid + "=@Id");
            }

            DevExpress.XtraEditors.XtraMessageBox.Show("İşlem başarıyla kaydedildi.", "Başarılı İşlem!"
                                                       , MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Exemplo n.º 7
0
        private void FrmExitWork_Load(object sender, EventArgs e)
        {
            DateTime dateNow = DateTime.Now;

            db.AddParameterValue("@ref", _Ref);
            kazanilan = int.Parse(db.GetScalarValue("Select gain from tbPerson where Ref=@ref").ToString());

            db.AddParameterValue("@pRef", _Ref);
            if (!string.IsNullOrEmpty(db.GetScalarValue("Select SUM(pRequest) from tbPermission where pRef=@pRef").ToString()))
            {
                db.AddParameterValue("@pRef", _Ref);
                kullanilan = int.Parse(db.GetScalarValue("Select SUM(pRequest) from tbPermission where pRef=@pRef").ToString());
            }


            atlasTextBox1.SetString((kazanilan - kullanilan).ToString());
            atlasTextBox1.Enabled = false;

            atlasDateEdit1.SetDate(dateNow);
        }
Exemplo n.º 8
0
        private void FrmDiscount_Load(object sender, EventArgs e)
        {
            helper.ClearForm(this);
            SetForm();
            FillLookUp();
            if (this._FormMod == Enums.enmFormMod.Guncelle)
            {
                db.AddParameterValue("@ref", this._Ref);
                DataTable dt = db.GetDataTable("select * from StSellDiscount where Ref=@ref");
                chkActive.SetBoolValue(bool.Parse(dt.Rows[0][1].ToString()));
                txtCode.SetString(dt.Rows[0][2].ToString());
                txtName.SetString(dt.Rows[0][3].ToString());
                dtpStart.SetDate(DateTime.Parse(dt.Rows[0][4].ToString()));
                dtpFinish.SetDate(DateTime.Parse(dt.Rows[0][5].ToString()));
                db.parameterDelete();

                db.AddParameterValue("@ref", this._Ref);
                dtDetail = db.GetDataTable("select * from StSellDiscountDetail where discountRef=@ref");
                for (int i = 0; i < dtDetail.Rows.Count; i++)
                {
                    DataRow row = dtBox.NewRow();
                    row["İndirim Tipi"] = dtDetail.Rows[i]["lineType"].ToString();
                    row["Ref"]          = dtDetail.Rows[i]["Ref"].ToString();
                    row["Liste Ref"]    = dtDetail.Rows[i]["discountRef"].ToString();

                    row["Kart Ref"] = dtDetail.Rows[i]["cardRef"].ToString();

                    db.AddParameterValue("@ref", dtDetail.Rows[i]["cardRef"].ToString());
                    DataTable dtStock = db.GetDataTable("select code,name from StStockCard where Ref=@ref");
                    row["Kart Kodu"] = (dtStock.Rows[0][0].ToString());
                    row["Kart Adı"]  = (dtStock.Rows[0][1].ToString());


                    row["Barkod"] = dtDetail.Rows[i]["barcode"].ToString();
                    db.AddParameterValue("@barcode", dtDetail.Rows[i]["barcode"].ToString());
                    DataTable dtBarcode = db.GetDataTable("select color,size from StStockCardBarcodes where barcode=@barcode");
                    row["Renk"]  = (dtBarcode.Rows[0][0].ToString());
                    row["Beden"] = (dtBarcode.Rows[0][1].ToString());

                    row["Birim Ref"] = int.Parse(dtDetail.Rows[i]["unitRef"].ToString());
                    sysDb.AddParameterValue("@ref", dtDetail.Rows[i]["unitRef"].ToString());
                    row["Birim Kodu"] = sysDb.GetScalarValue("select symbol from SysUnit where ref=@ref").ToString();


                    row["Oran"]       = dtDetail.Rows[i]["rate"].ToString();
                    row["Eski Fiyat"] = dtDetail.Rows[i]["oldPrice"].ToString();
                    row["Yeni Fiyat"] = dtDetail.Rows[i]["newPrice"].ToString();
                    dtBox.Rows.Add(row);
                }
                dgwGrid.DataSource = dtBox;
                grdGrid.RefreshData();
            }
            c.StateStabil(this);
        }
Exemplo n.º 9
0
        private void FrmCreatePermission_Load(object sender, EventArgs e)
        {
            groupControl3.Enabled = false;
            fillLed();
            if (_FormMod == Enums.enmFormMod.Guncelle)
            {
                this._Ref = kRef;


                db.AddParameterValue("@ref", kRef);
                DataTable dt = db.GetDataTable("select * from tbPermission  with(nolock)  where Ref=@ref");
                ledPersonel.SetValue(int.Parse(dt.Rows[0]["pRef"].ToString()));
                cmbIzinTuru.SetString(dt.Rows[0]["pType"].ToString());
                dtpIzinBaslangic.SetDate(DateTime.Parse((dt.Rows[0]["pSDate"].ToString())));
                dtpIzinBitisTarihi.SetDate(DateTime.Parse((dt.Rows[0]["pFDate"].ToString())));
                dtpIseBaslamaTarihi.SetDate(DateTime.Parse((dt.Rows[0]["pWSDate"].ToString())));
                txtWhy.SetString(dt.Rows[0]["why"].ToString());
                txtDesc.SetString(dt.Rows[0]["desc"].ToString());
                ledVekil.SetValue(int.Parse(dt.Rows[0]["vekil"].ToString()));
            }
        }
Exemplo n.º 10
0
        private void btnDeleteLine_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                System.Data.DataRow row = grdGrid.GetDataRow(grdGrid.FocusedRowHandle);

                if (!string.IsNullOrEmpty(row[0].ToString()) && row[0].ToString() != "0")
                {
                    result = XtraMessageBox.Show("Seçili kaydı silmek istediğinize emin misiniz?\n\rKaydet işlemi yapılmadan son düzenlemeler geçerli olmayacaktır.", "Soru?", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (result == DialogResult.Yes)
                    {
                        REf = int.Parse(row[0].ToString());
                        grdGrid.DeleteRow(grdGrid.FocusedRowHandle);
                        db.AddParameterValue("@Ref", REf);
                        db.RunCommand("delete from sysCity where Ref=@Ref");

                        XtraMessageBox.Show("İşlem başarıyla tamamlandı.", "Başarılı İşlem!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                else
                if (row[0].ToString() != "0")
                {
                    grdGrid.DeleteRow(grdGrid.FocusedRowHandle);
                }
            }
            catch (Exception ex)
            {
                helper.WriteLog(ex);
            }
        }
Exemplo n.º 11
0
        void fillData()
        {
            FrmIKMain main = (FrmIKMain)Application.OpenForms["FrmIKMain"];
            DataTable dt   = new DataTable();

            if (main.who != "YSK")
            {
                db.AddParameterValue("@unit", main.pUnit);
                dt = db.GetDataTable(@"		SELECT        
tbPerson.Ref, 
tbPerson.name + ' ' + surname AS[Ad Soyad], 
tc AS TC, 
tbUnit.name as [Birim],
sDate as [İşe Giriş]
FROM tbPerson with(nolock)
LEFT OUTER JOIN  tbUnit 
ON tbPerson.unit = tbUnit.Ref
where tbperson.Unit = @unit
ORDER BY [Ad Soyad] asc");
            }
            else
            {
                dt = db.GetDataTable(@"		SELECT        
tbPerson.Ref, 
tbPerson.name + ' ' + surname AS[Ad Soyad], 
tc AS TC, 
tbUnit.name as [Birim],
sDate as [İşe Giriş]
FROM tbPerson with(nolock)
LEFT OUTER JOIN  tbUnit 
ON tbPerson.unit = tbUnit.Ref
ORDER BY [Ad Soyad] asc");
            }


            dgwPerson.DataSource         = dt;
            grdPerson.Columns[0].Visible = false;
            grdPerson.BestFitColumns();
        }
Exemplo n.º 12
0
        private void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                grdGrid.FocusedRowHandle = -1;
                for (int i = 0; i < grdGrid.RowCount - 1; i++)
                {
                    if (string.IsNullOrEmpty(grdGrid.GetRowCellValue(i, "Ref").ToString()))
                    {
                        REf = 0;
                    }
                    else
                    {
                        REf = int.Parse(grdGrid.GetRowCellValue(i, "Ref").ToString());
                    }


                    cityRef = int.Parse(grdGrid.GetRowCellValue(i, "cityRef").ToString());
                    code    = grdGrid.GetRowCellValue(i, "code").ToString();
                    name    = grdGrid.GetRowCellValue(i, "name").ToString();


                    db.AddParameterValue("@ref", REf);
                    @db.AddParameterValue("@cityRef", cityRef);
                    db.AddParameterValue("@code", code);
                    db.AddParameterValue("@name", name);
                    db.RunCommand("sp_sysTax_AddOrUp", CommandType.StoredProcedure);
                }
                XtraMessageBox.Show("İşlem başarıyla tamamlandı.", "Başarılı İşlem!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                FillData();
                RowCount = grdGrid.RowCount;
                this.Close();
            }
            catch (Exception ex)
            {
                helper.WriteLog(ex);
            }
        }
Exemplo n.º 13
0
 void FillData()
 {
     db.AddParameterValue("@Ref", this._Ref);
     dtList = db.GetDataTable("select * from sysRole where Ref=@Ref");
     REf    = int.Parse(dtList.Rows[0][0].ToString());
     txtCode.SetString(dtList.Rows[0][1].ToString());
     txtName.SetString(dtList.Rows[0][2].ToString());
     txtDesc.SetString(dtList.Rows[0][3].ToString());
 }
Exemplo n.º 14
0
        private void FrmDatabase_Load(object sender, EventArgs e)
        {
            helper.ClearForm(this);
            GetInstancesNames();
            cmbGuvenlikType.flashCombo.Properties.Items.Add("WİNDOWS");
            cmbGuvenlikType.flashCombo.Properties.Items.Add("SQL");

            txtPassword.flaText.Properties.PasswordChar = '●';
            if (_FormMod == Enums.enmFormMod.Guncelle)
            {
                db.AddParameterValue("@ref", this._Ref);
                DataTable dtDb = db.GetDataTable("select * from sysDatabase where Ref=@ref");
                txtDbNo.SetString(dtDb.Rows[0]["dbNo"].ToString());
                txtName.SetString(dtDb.Rows[0]["name"].ToString());
                cmbGuvenlikType.SetString(dtDb.Rows[0]["securityType"].ToString());
                txtUsername.SetString(dtDb.Rows[0]["sqlUsername"].ToString());
                txtPassword.SetString(helper.TextSifreCoz(dtDb.Rows[0]["sqlPassword"].ToString()));
                txtTimeOut.SetString(dtDb.Rows[0]["timeout"].ToString());
            }
            c.StateStabil(this);
        }
Exemplo n.º 15
0
        private void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            grdGrid.FocusedRowHandle = -1;

            for (int i = 0; i < grdGrid.RowCount - 1; i++)
            {
                if (string.IsNullOrEmpty(grdGrid.GetRowCellValue(i, "Ref").ToString()))
                {
                    REf = 0;
                }
                else
                {
                    REf = int.Parse(grdGrid.GetRowCellValue(i, "Ref").ToString());
                }

                if (string.IsNullOrEmpty(grdGrid.GetRowCellValue(i, "active").ToString()))
                {
                    active = false;
                }
                else
                {
                    active = bool.Parse(grdGrid.GetRowCellValue(i, "active").ToString());
                }

                nat      = (grdGrid.GetRowCellValue(i, "nationalCode").ToString());
                name     = grdGrid.GetRowCellValue(i, "unitName").ToString();
                type     = grdGrid.GetRowCellValue(i, "unitType").ToString();
                symbol   = grdGrid.GetRowCellValue(i, "symbol").ToString();
                fraction = int.Parse(grdGrid.GetRowCellValue(i, "fraction").ToString());

                db.AddParameterValue("@ref", REf);
                db.AddParameterValue("@active", active);
                db.AddParameterValue("@name", name);
                db.AddParameterValue("@symbol", symbol);
                db.AddParameterValue("@type", type);
                db.AddParameterValue("@natCode", nat);
                db.AddParameterValue("@frac", fraction);
                db.RunCommand("sp_sysUnit_AddOrUp", CommandType.StoredProcedure);
            }
            XtraMessageBox.Show("İşlem başarıyla tamamlandı.", "Başarılı İşlem!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            FillData();
            RowCount = grdGrid.RowCount;
            this.Close();
        }
Exemplo n.º 16
0
        bool Control()
        {
            int errorCount = 0;

            db.AddParameterValue("@name", cmbBayram.GetString());
            DataTable dt = db.GetDataTable("select * from tbReligion  with(nolock) where name=@name");

            if (dt.Rows.Count > 0)
            {
                DateTime yil = DateTime.Parse(dt.Rows[0]["sDate"].ToString());

                if (string.IsNullOrEmpty(cmbBayram.GetString()))
                {
                    XtraMessageBox.Show("Bayram adını boş geçemezsiniz.", "Hatalı İşlem!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    errorCount++;
                }

                if (yil.Year == dtpBaslangic.GetDate().Year)
                {
                    XtraMessageBox.Show(cmbBayram.GetString() + " adlı bayramı aynı yıl içinde 2.kez sisteme ekleyemezsiniz.", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    errorCount++;
                }
            }
            if (string.IsNullOrEmpty(dtpBaslangic.GetDate().ToString()) || string.IsNullOrEmpty(dtpBitis.GetDate().ToString()))
            {
                XtraMessageBox.Show("Başlangıç veya bitiş tarihi değeri boş geçilemez..", "Uyarı!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                errorCount++;
            }
            if (errorCount > 0)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Exemplo n.º 17
0
        private void FrmLogin_Load(object sender, EventArgs e)
        {
            txtPassword.flaText.Properties.PasswordChar = '●';
            flashComboBox1.flashCombo.Properties.Items.Add("Türkçe");
            flashComboBox1.flashCombo.Text = "Türkçe";


            ledFirm.flaLookUp.Properties.ValueMember   = "Ref";
            ledFirm.flaLookUp.Properties.DisplayMember = "name";
            ledFirm.flaLookUp.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo()
            {
                FieldName = "Ref", Caption = "dbNo", Visible = false
            });
            ledFirm.flaLookUp.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo()
            {
                FieldName = "name", Caption = "Adı"
            });
            db.AddParameterValue("@act", true, SqlDbType.Bit);
            ledFirm.flaLookUp.Properties.DataSource = db.GetDataTable("select Ref,name from sysFirm where Active=@act");
            txtUsername.SetString("onrcn");
            txtPassword.SetString("010203");
            ledFirm.SetValue(4);
            btnLogin.PerformClick();
        }
Exemplo n.º 18
0
        void fillData()
        {
            #region All
            FrmIKMain main   = (FrmIKMain)Application.OpenForms["FrmIKMain"];
            DataTable dtAll  = new DataTable();
            DataTable dtNext = new DataTable();
            DataTable dtNow  = new DataTable();
            DataTable dtPas  = new DataTable();
            if (main.who != "YSK")
            {
                db.AddParameterValue("@unit", main.pUnit);
                dtAll = db.GetDataTable(@"SELECT        tbPermission.Ref, 
			  tbPermission.pRef, 
			  tbPerson.name + ' ' + tbPerson.surname AS [Ad Soyad],
			  tbPermission.pType AS [İzin Tipi],
			  tbPermission.pSDate AS [Başlangıç Tarihi], 
			  tbPermission.pFDate AS [Bitiş Tarihi], 
			  tbPermission.pWSDate AS [İşe Başlama Tarihi], 
              tbPermission.pRequest AS [Kullanılan İzin], 
			  (tbPermission.Weekend + tbPermission.pNational + tbPermission.religion) as [Resmi Tatil], 
			  (tbPermission.Weekend + tbPermission.pNational + tbPermission.religion + tbPermission.pRequest) as [Toplam]			
              FROM tbPermission  with(nolock) LEFT OUTER JOIN
              tbPerson ON tbPermission.pRef = tbPerson.Ref
              where tbperson.unit=@unit
              ");

                db.AddParameterValue("@nDate", DateTime.Now.ToShortDateString().ToString(), SqlDbType.Date);
                db.AddParameterValue("@unit", main.pUnit);
                dtNext = db.GetDataTable(@"SELECT        tbPermission.Ref, 
			  tbPermission.pRef, 
			  tbPerson.name + ' ' + tbPerson.surname AS [Ad Soyad],
			  tbPermission.pType AS [İzin Tipi],
			  tbPermission.pSDate AS [Başlangıç Tarihi], 
			  tbPermission.pFDate AS [Bitiş Tarihi], 
			  tbPermission.pWSDate AS [İşe Başlama Tarihi], 
              tbPermission.pRequest AS [Kullanılan İzin], 
			  (tbPermission.Weekend + tbPermission.pNational + tbPermission.religion) as [Resmi Tatil], 
			  (tbPermission.Weekend + tbPermission.pNational + tbPermission.religion + tbPermission.pRequest) as [Toplam]
			  FROM            tbPermission  with(nolock) LEFT OUTER JOIN
              tbPerson ON tbPermission.pRef = tbPerson.Ref
			  WHERE
			  @nDate <  tbPermission.pSDate AND tbperson.unit=@unit"            );

                db.AddParameterValue("@dNow", DateTime.Now.ToShortDateString().ToString(), SqlDbType.Date);
                db.AddParameterValue("@unit", main.pUnit);
                dtNow = db.GetDataTable(@"SELECT        tbPermission.Ref, 
			  tbPermission.pRef, 
			  tbPerson.name + ' ' + tbPerson.surname AS [Ad Soyad],
			  tbPermission.pType AS [İzin Tipi],
			  tbPermission.pSDate AS [Başlangıç Tarihi], 
			  tbPermission.pFDate AS [Bitiş Tarihi], 
			  tbPermission.pWSDate AS [İşe Başlama Tarihi], 
              tbPermission.pRequest AS [Kullanılan İzin], 
			  (tbPermission.Weekend + tbPermission.pNational + tbPermission.religion) as [Resmi Tatil], 
			  (tbPermission.Weekend + tbPermission.pNational + tbPermission.religion + tbPermission.pRequest) as [Toplam]
			  FROM            tbPermission  with(nolock) LEFT OUTER JOIN
              tbPerson ON tbPermission.pRef = tbPerson.Ref
			  WHERE
			  @dNow BETWEEN tbPermission.pSDate AND tbPermission.pFDate AND tbperson.unit=@unit"            );


                db.AddParameterValue("@dPast", DateTime.Now.ToShortDateString().ToString(), SqlDbType.Date);
                db.AddParameterValue("@unit", main.pUnit);
                dtPas = db.GetDataTable(@"SELECT        tbPermission.Ref, 
			  tbPermission.pRef, 
			  tbPerson.name + ' ' + tbPerson.surname AS [Ad Soyad],
			  tbPermission.pType AS [İzin Tipi],
			  tbPermission.pSDate AS [Başlangıç Tarihi], 
			  tbPermission.pFDate AS [Bitiş Tarihi], 
			  tbPermission.pWSDate AS [İşe Başlama Tarihi], 
              tbPermission.pRequest AS [Kullanılan İzin], 
			  (tbPermission.Weekend + tbPermission.pNational + tbPermission.religion) as [Resmi Tatil], 
			  (tbPermission.Weekend + tbPermission.pNational + tbPermission.religion + tbPermission.pRequest) as [Toplam]
			  FROM            tbPermission  with(nolock)
            LEFT OUTER JOIN
              tbPerson ON tbPermission.pRef = tbPerson.Ref
			  WHERE
			  @dPast >= tbPermission.pWSDate AND tbperson.unit=@unit"            );
            }
            else
            {
                dtAll = db.GetDataTable(@"SELECT        tbPermission.Ref, 
			  tbPermission.pRef, 
			  tbPerson.name + ' ' + tbPerson.surname AS [Ad Soyad],
			  tbPermission.pType AS [İzin Tipi],
			  tbPermission.pSDate AS [Başlangıç Tarihi], 
			  tbPermission.pFDate AS [Bitiş Tarihi], 
			  tbPermission.pWSDate AS [İşe Başlama Tarihi], 
              tbPermission.pRequest AS [Kullanılan İzin], 
			  (tbPermission.Weekend + tbPermission.pNational + tbPermission.religion) as [Resmi Tatil], 
			  (tbPermission.Weekend + tbPermission.pNational + tbPermission.religion + tbPermission.pRequest) as [Toplam]			
              FROM tbPermission  with(nolock) LEFT OUTER JOIN
              tbPerson ON tbPermission.pRef = tbPerson.Ref
              ");

                db.AddParameterValue("@nDate", DateTime.Now.ToShortDateString().ToString(), SqlDbType.Date);
                dtNext = db.GetDataTable(@"SELECT        tbPermission.Ref, 
			  tbPermission.pRef, 
			  tbPerson.name + ' ' + tbPerson.surname AS [Ad Soyad],
			  tbPermission.pType AS [İzin Tipi],
			  tbPermission.pSDate AS [Başlangıç Tarihi], 
			  tbPermission.pFDate AS [Bitiş Tarihi], 
			  tbPermission.pWSDate AS [İşe Başlama Tarihi], 
              tbPermission.pRequest AS [Kullanılan İzin], 
			  (tbPermission.Weekend + tbPermission.pNational + tbPermission.religion) as [Resmi Tatil], 
			  (tbPermission.Weekend + tbPermission.pNational + tbPermission.religion + tbPermission.pRequest) as [Toplam]
			  FROM            tbPermission  with(nolock) LEFT OUTER JOIN
              tbPerson ON tbPermission.pRef = tbPerson.Ref
			  WHERE
			  @nDate <  tbPermission.pSDate"            );

                db.AddParameterValue("@dNow", DateTime.Now.ToShortDateString().ToString(), SqlDbType.Date);
                dtNow = db.GetDataTable(@"SELECT        tbPermission.Ref, 
			  tbPermission.pRef, 
			  tbPerson.name + ' ' + tbPerson.surname AS [Ad Soyad],
			  tbPermission.pType AS [İzin Tipi],
			  tbPermission.pSDate AS [Başlangıç Tarihi], 
			  tbPermission.pFDate AS [Bitiş Tarihi], 
			  tbPermission.pWSDate AS [İşe Başlama Tarihi], 
              tbPermission.pRequest AS [Kullanılan İzin], 
			  (tbPermission.Weekend + tbPermission.pNational + tbPermission.religion) as [Resmi Tatil], 
			  (tbPermission.Weekend + tbPermission.pNational + tbPermission.religion + tbPermission.pRequest) as [Toplam]
			  FROM            tbPermission  with(nolock) LEFT OUTER JOIN
              tbPerson ON tbPermission.pRef = tbPerson.Ref
			  WHERE
			  @dNow BETWEEN tbPermission.pSDate AND tbPermission.pFDate"            );

                db.AddParameterValue("@dPast", DateTime.Now.ToShortDateString().ToString(), SqlDbType.Date);
                dtPas = db.GetDataTable(@"SELECT        tbPermission.Ref, 
			  tbPermission.pRef, 
			  tbPerson.name + ' ' + tbPerson.surname AS [Ad Soyad],
			  tbPermission.pType AS [İzin Tipi],
			  tbPermission.pSDate AS [Başlangıç Tarihi], 
			  tbPermission.pFDate AS [Bitiş Tarihi], 
			  tbPermission.pWSDate AS [İşe Başlama Tarihi], 
              tbPermission.pRequest AS [Kullanılan İzin], 
			  (tbPermission.Weekend + tbPermission.pNational + tbPermission.religion) as [Resmi Tatil], 
			  (tbPermission.Weekend + tbPermission.pNational + tbPermission.religion + tbPermission.pRequest) as [Toplam]
			  FROM            tbPermission  with(nolock)
            LEFT OUTER JOIN
              tbPerson ON tbPermission.pRef = tbPerson.Ref
			  WHERE
			  @dPast >= tbPermission.pWSDate"            );
            }

            dgwAll.DataSource         = dtAll;
            grdAll.Columns[0].Visible = false;
            grdAll.Columns[1].Visible = false;
            grdAll.BestFitColumns();
            #endregion

            dgwNext.DataSource         = dtNext;
            grdNext.Columns[0].Visible = false;
            grdNext.Columns[1].Visible = false;
            grdNext.BestFitColumns();


            dgwNow.DataSource         = dtNow;
            grdNow.Columns[0].Visible = false;
            grdNow.Columns[1].Visible = false;
            grdNow.BestFitColumns();


            dgwPast.DataSource         = dtPas;
            grdPast.Columns[0].Visible = false;
            grdPast.Columns[1].Visible = false;
            grdPast.BestFitColumns();
        }
Exemplo n.º 19
0
        void FillData()
        {
            DataTable dtGrid = new DataTable();

            dtGrid.Columns.Add("Ref");
            dtGrid.Columns.Add("authRef");
            dtGrid.Columns.Add("Modül");
            dtGrid.Columns.Add("menuRef");
            dtGrid.Columns.Add("authSee", typeof(bool));
            dtGrid.Columns.Add("authAdd", typeof(bool));
            dtGrid.Columns.Add("authUpdate", typeof(bool));
            dtGrid.Columns.Add("authShow", typeof(bool));

            db.AddParameterValue("@ref", this._Ref);



            dgwGrid.DataSource         = dtGrid;
            grdGrid.Columns[0].Visible = false;
            grdGrid.Columns[1].Visible = false;
            grdGrid.Columns[2].Caption = "Modül";
            grdGrid.Columns[3].Caption = "Form";
            grdGrid.Columns[4].Caption = "Görüntüleme Yetkisi";
            grdGrid.Columns[5].Caption = "Ekleme Yetkisi";
            grdGrid.Columns[6].Caption = "Güncelleme Yetkisi";
            grdGrid.Columns[7].Caption = "İnceleme Yetkisi";
            grdGrid.Columns[0].OptionsColumn.AllowEdit = false;
            grdGrid.Columns[1].OptionsColumn.AllowEdit = false;
            grdGrid.Columns[2].OptionsColumn.AllowEdit = false;
            grdGrid.Columns[3].OptionsColumn.AllowEdit = false;

            db.AddParameterValue("@active", true);
            db.AddParameterValue("@type", "Form");
            DataTable dt2 = db.GetDataTable("select * from sysMenu where Active=@active and type=@type");

            RepositoryItemLookUpEdit riledType;

            riledType = new DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit();
            riledType.BeginInit();
            riledType.Columns.Add(new LookUpColumnInfo()
            {
                FieldName = "Ref", Caption = "Ref", Visible = false
            });
            riledType.Columns.Add(new LookUpColumnInfo()
            {
                FieldName = "description", Caption = "Ad"
            });
            riledType.NullText      = "Seçim Yapınız";
            riledType.DisplayMember = "description";
            riledType.ValueMember   = "Ref";
            riledType.DataSource    = dt2;
            dgwGrid.RepositoryItems.Add(riledType);

            grdGrid.Columns[3].ColumnEdit = riledType;


            for (int i = 0; i < dt2.Rows.Count; i++)
            {
                DataRow row = dtGrid.NewRow();
                row["menuRef"] = int.Parse(dt2.Rows[i]["Ref"].ToString());

                db.AddParameterValue("@ref", dt2.Rows[i]["Ref"].ToString());
                string code = db.GetScalarValue("select code from sysMenu where Ref=@ref").ToString();
                db.AddParameterValue("@code", code);
                row["Modül"]      = db.GetScalarValue("select [description] from sysMenu where code=@code and type='AnaMenu'").ToString();
                row["authSee"]    = true;
                row["authAdd"]    = true;
                row["authUpdate"] = true;
                row["authShow"]   = true;
                dtGrid.Rows.Add(row);
            }
            grdGrid.BestFitColumns();
            grdGrid.RefreshData();


            RowCount = grdGrid.RowCount;
            grdGrid.BestFitColumns();

            if (this._FormMod == Enums.enmFormMod.Guncelle)
            {
                db.AddParameterValue("@ref", this._Ref);
                DataTable dt = db.GetDataTable("select * from SysAuths where Ref=@ref");

                txtCode.SetString(dt.Rows[0]["code"].ToString());
                txtName.SetString(dt.Rows[0]["name"].ToString());

                db.AddParameterValue("@ref", this._Ref);
                DataTable dtData = db.GetDataTable(@"SELECT SysAuthDetails.Ref AS Ref,sysAuthDetails.authRef as authRef,sysAuthDetails.MenuRef,sysAuthDetails.authSee,sysAuthDetails.authAdd,sysAuthDetails.authUpdate,sysAuthDetails.authShow 
                                   FROM SysAuths JOIN sysAuthDetails ON SysAuths.Ref = sysAuthDetails.authRef  where sysAuthDetails.authRef=@ref");

                dtGrid.Rows.Clear();
                for (int i = 0; i < dtData.Rows.Count; i++)
                {
                    DataRow row = dtGrid.NewRow();
                    int     Ref = int.Parse(dtData.Rows[i]["menuRef"].ToString());
                    row["Ref"]     = dtData.Rows[i]["Ref"].ToString();
                    row["authRef"] = this._Ref;
                    row["menuRef"] = Ref;

                    db.AddParameterValue("@ref", Ref);
                    string code = db.GetScalarValue("select code from sysMenu where Ref=@ref").ToString();

                    db.AddParameterValue("@code", code);
                    row["Modül"] = db.GetScalarValue("select [description] from sysMenu where code=@code and type='AnaMenu'").ToString();


                    row["authSee"]    = bool.Parse(dtData.Rows[i]["authSee"].ToString());
                    row["authAdd"]    = bool.Parse(dtData.Rows[i]["authAdd"].ToString());
                    row["authUpdate"] = bool.Parse(dtData.Rows[i]["authUpdate"].ToString());
                    row["authShow"]   = bool.Parse(dtData.Rows[i]["authShow"].ToString());
                    dtGrid.Rows.Add(row);
                }
                grdGrid.BestFitColumns();
                grdGrid.RefreshData();
            }
        }
Exemplo n.º 20
0
        void AuthControl(string desc, AtlasForm form)
        {
            sysDb.parameterDelete();
            sysDb.AddParameterValue("@desc", desc);
            sysDb.AddParameterValue("@authRef", authRef);
            DataTable dtAuth = sysDb.GetDataSet(@"SELECT         SysAuths.Ref AS authRef,sysMenu.code, sysMenu.description, sysAuthDetails.authSee, sysAuthDetails.authAdd, sysAuthDetails.authUpdate, sysAuthDetails.authShow FROM            SysAuths 
INNER JOIN sysAuthDetails ON SysAuths.Ref = sysAuthDetails.authRef 
INNER JOIN sysMenu ON sysAuthDetails.menuRef = sysMenu.Ref 
where description=@desc 
and authRef=@authRef").Tables[0];

            form._add    = bool.Parse(dtAuth.Rows[0]["authAdd"].ToString());
            form._update = bool.Parse(dtAuth.Rows[0]["authUpdate"].ToString());
            form._show   = bool.Parse(dtAuth.Rows[0]["authShow"].ToString());
        }
Exemplo n.º 21
0
        private void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //try
            //{

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                db.AddParameterValue("@tc", dt.Rows[i]["TC"].ToString());
                if (int.Parse(db.GetScalarValue("select count(*) from tbPerson where TC=@tc").ToString()) > 0)
                {
                    db.AddParameterValue("@tc", dt.Rows[i]["TC"].ToString());
                    _Ref = int.Parse(db.GetScalarValue("select Ref from tbPerson where TC = @tc").ToString());
                }
                else
                {
                    _Ref = 0;
                }

                db.AddParameterValue("@ref", _Ref);
                db.AddParameterValue("@name", dt.Rows[i]["Ad"].ToString());
                db.AddParameterValue("@surname", dt.Rows[i]["Soyad"].ToString());
                db.AddParameterValue("@tc", dt.Rows[i]["TC"].ToString());

                db.AddParameterValue("@bdate", DateTime.Parse(dt.Rows[i]["Doğum Tarihi"].ToString()), SqlDbType.Date);
                db.AddParameterValue("@bPlace", "");
                db.AddParameterValue("@mName", "");
                db.AddParameterValue("@dName", "");
                db.AddParameterValue("@sex", "");
                db.AddParameterValue("@bgroup", "");
                db.AddParameterValue("@mStatus", "");
                db.AddParameterValue("@register", dt.Rows[i]["Sicil"].ToString());
                db.AddParameterValue("@mission", dt.Rows[i]["Görevi"].ToString());
                db.AddParameterValue("@unit", "");
                db.AddParameterValue("@sDate", DateTime.Parse(dt.Rows[i]["İşe Giriş Tarihi"].ToString()), SqlDbType.Date);
                db.AddParameterValue("@gsm", dt.Rows[i]["GSM"].ToString());
                db.AddParameterValue("@mail", "");
                db.AddParameterValue("@address", "", SqlDbType.NVarChar);
                db.AddParameterValue("@cname", "");
                db.AddParameterValue("@cSurname", "");
                db.AddParameterValue("@cRank", "");
                db.AddParameterValue("@cGsm", "");
                db.AddParameterValue("@dLicence", "");
                db.AddParameterValue("@solider", "");
                db.AddParameterValue("@education", "");
                db.AddParameterValue("@children", "");
                db.AddParameterValue("@imagePath", "");
                db.AddParameterValue("@gain", "");
                db.AddParameterValue("@firm", "");
                db.AddParameterValue("@insurance", "");
                db.AddParameterValue("@IBAN", "");
                db.RunCommand("sp_Person", CommandType.StoredProcedure);
            }
            XtraMessageBox.Show("İşlem başarıyla tamamlandı.", "Başarılı İşlem!", MessageBoxButtons.OK, MessageBoxIcon.Information);
            helper.ClearForm(this);
            c.StateStabil(this);
            this.DialogResult = DialogResult.OK;
            this.Close();
            //}
            //catch (Exception ex)
            //{
            //    helper.WriteLog(ex);
            //    db.parameterDelete();
            //}
        }
Exemplo n.º 22
0
        private void barButtonItem5_ItemClick(object sender, ItemClickEventArgs e)
        {
            Person.FrmAddPerson addPerson = new Person.FrmAddPerson();
            DataTable           dt        = db.GetDataTable(@"SELECT * from tbPerson");
            int totalHak = 0;

            try
            {
                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        if (!string.IsNullOrEmpty(dt.Rows[i]["sDate"].ToString()))
                        {
                            DateTime sonTarih = DateTime.Now;
                            DateTime ilkTarih = DateTime.Parse(dt.Rows[i]["sDate"].ToString());

                            int[] sonuc = addPerson.ikiTarihFarki(sonTarih, ilkTarih);
                            int   yil   = int.Parse(sonuc[0].ToString());
                            int   hak   = 0;

                            if (yil < 1)
                            {
                                hak = 0;
                            }
                            if (yil <= 5 && yil > 1)
                            {
                                hak = 14;
                            }
                            else if (yil < 15 && yil > 5)
                            {
                                hak = 20;
                            }
                            else if (yil > 15)
                            {
                                hak = 26;
                            }

                            int onbes = 0;
                            int on    = 0;
                            int bes   = 0;
                            int kalan = 0;


                            if (yil < 1)
                            {
                                totalHak += 0;
                            }
                            if (yil - 5 >= 0)
                            {
                                bes       = 1;
                                totalHak += 5 * 14;
                                kalan     = yil - 5;
                            }
                            else if (yil - 5 < 0)
                            {
                                totalHak = yil * 14;
                            }

                            if (kalan - 10 >= 0)
                            {
                                on        = 1;
                                totalHak += 10 * 20;
                                kalan     = kalan - 10;
                            }

                            else if (kalan - 10 < 0)
                            {
                                totalHak += kalan * 20;
                                kalan     = 0;
                            }

                            if (kalan > 0)
                            {
                                onbes     = 1;
                                totalHak += kalan * 26;
                            }

                            int Ref = int.Parse(dt.Rows[i]["Ref"].ToString());

                            db.AddParameterValue("@ref", Ref);
                            db.AddParameterValue("@gain", totalHak);
                            db.RunCommand("update tbPerson set gain=@gain where Ref=@ref");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Exemplo n.º 23
0
 void FillData()
 {
     db.AddParameterValue("@Ref", this._Ref);
     dtList    = db.GetDataTable("select * from sysUser where Ref=@Ref");
     this._Ref = int.Parse(dtList.Rows[0][0].ToString());
     chkActive.SetBoolValue(bool.Parse(dtList.Rows[0][1].ToString()));
     txtCode.SetString(dtList.Rows[0][2].ToString());
     txtName.SetString(dtList.Rows[0][3].ToString());
     txtUsername.SetString(dtList.Rows[0][4].ToString());
     if (dtList.Rows[0][5].ToString().Length > 0)
     {
         NormalPass = helper.TextSifreCoz(dtList.Rows[0][5].ToString());
         txtPassword.SetString(NormalPass);
     }
     ledGroup.SetValue(int.Parse(dtList.Rows[0][6].ToString()));
     ledRole.SetValue(int.Parse(dtList.Rows[0][7].ToString()));
     txtMail.SetString(dtList.Rows[0][8].ToString());
     txtTel1.SetString(dtList.Rows[0][9].ToString());
     txtTel2.SetString(dtList.Rows[0][10].ToString());
     ledDb.SetValue(int.Parse(dtList.Rows[0][11].ToString()));
     if (!string.IsNullOrEmpty(dtList.Rows[0][12].ToString()))
     {
         pictureEdit1.Image = Image.FromFile(Application.StartupPath + "\\Images\\User\\" + dtList.Rows[0][12].ToString());
     }
 }
Exemplo n.º 24
0
        bool Control()
        {
            stb.Clear();
            if (!string.IsNullOrEmpty(txtNo.GetString()))
            {
                dtControl.Clear();
                db.AddParameterValue("@no", txtNo.GetString());
                dtControl = db.GetDataTable("select no from sysBranch where no=@no");
                if (dtControl.Rows.Count > 0)
                {
                    noCount = int.Parse(dtControl.Rows[0][0].ToString());
                }
            }
            if (!string.IsNullOrEmpty(txtCode.GetString()))
            {
                dtControl.Clear();
                db.AddParameterValue("@code", txtCode.GetString());
                dtControl = db.GetDataTable("select code from sysBranch where code=@code");
                if (dtControl.Rows.Count > 0)
                {
                    codeCount = int.Parse(dtControl.Rows[0][0].ToString());
                }
            }


            if (_FormMod == enmFormMod.Yeni && noCount > 0)
            {
                stb.AppendLine("Böyle bir şube numarası sistemde mevcut.");
            }

            if (string.IsNullOrEmpty(txtNo.GetString()))
            {
                stb.AppendLine("Şube numarası boş geçilemez.");
            }
            else
            {
                no = int.Parse(txtNo.GetString());
            }

            if (_FormMod == Enums.enmFormMod.Yeni && codeCount > 0)
            {
                stb.AppendLine("Böyle bir şube kodu sistemde mevcut.");
            }

            if (string.IsNullOrEmpty(txtCode.GetString()))
            {
                stb.AppendLine("Şube kodu boş geçilemez.");
            }
            else
            {
                code = txtCode.GetString();
            }

            if (string.IsNullOrEmpty(txtName.GetString()))
            {
                stb.AppendLine("Şube adı boş geçilemez.");
            }
            else
            {
                name = txtName.GetString();
            }

            if (string.IsNullOrEmpty(ledFirm.GetString()))
            {
                stb.AppendLine("Şube firması boş geçilemez.");
            }
            else
            {
                firmRef = ledFirm.GetValue();
            }

            if (stb.ToString().Length <= 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 25
0
        void FillData()
        {
            if (!string.IsNullOrEmpty(ledFirm.GetValue().ToString()) && !string.IsNullOrEmpty(ledUser.GetValue().ToString()))
            {
                if (int.Parse(db.GetScalarValue("select count(*) from sysAuthUser").ToString()) > 0)
                {
                    db.AddParameterValue("@uRef", ledUser.GetValue());
                    db.AddParameterValue("@firmRef", ledFirm.GetValue());
                    if (int.Parse(db.GetScalarValue("select count(*) from sysAuthUser where userRef=@uRef and firmRef=@firmRef").ToString()) > 0)
                    {
                        db.AddParameterValue("@uRef", ledUser.GetValue());
                        db.AddParameterValue("@firmRef", ledFirm.GetValue());
                        int authRefID = int.Parse(db.GetScalarValue("select authRef from sysAuthUser where userRef=@uRef and firmRef=@firmRef").ToString());
                        ledPackage.SetValue(authRefID);
                        db.AddParameterValue("@uRef", ledUser.GetValue());
                        db.AddParameterValue("@firmRef", ledFirm.GetValue());
                        this._Ref = int.Parse(db.GetScalarValue("select Ref from sysAuthUser where userRef=@uRef and firmRef=@firmRef").ToString());
                    }
                }
                db.AddParameterValue("@ref", ledUser.GetValue());
                DataTable dtDataBranch = db.GetDataTable("select * from sysAuthUserBranch where userRef=@ref");
                if (dtDataBranch.Rows.Count > 0)
                {
                    for (int i = 0; i < dtDataBranch.Rows.Count; i++)
                    {
                        for (int a = 0; a < dtBranch.Rows.Count; a++)
                        {
                            if (dtDataBranch.Rows[i]["branchRef"].ToString() == dtBranch.Rows[a]["Ref"].ToString())
                            {
                                grdBranch.SetRowCellValue(a, "Seçim", true);
                            }
                        }
                    }
                }



                db.AddParameterValue("@ref", ledUser.GetValue());
                DataTable dtDataWhouse = db.GetDataTable("select * from sysAuthUserWhouse where userRef=@ref");
                if (dtDataWhouse.Rows.Count > 0)
                {
                    for (int i = 0; i < dtDataWhouse.Rows.Count; i++)
                    {
                        for (int a = 0; a < dtWhouse.Rows.Count; a++)
                        {
                            if (dtDataWhouse.Rows[i]["whouseRef"].ToString() == dtWhouse.Rows[a]["Ref"].ToString())
                            {
                                grdDb.SetRowCellValue(a, "Seçim", true);
                            }
                        }
                    }
                }
            }
        }