Ejemplo n.º 1
0
 private void BtnNew_Click(object sender, EventArgs e)
 {
     ClearFld();
     _Tag = "NEW";
     Text = "Purchase Indent [NEW]";
     ControlEnableDisable(false, true);
     TxtVoucherNo.Focus();
     if (ClsGlobal.DateType == "M")
     {
         TxtMiti.Text = _objDate.GetMiti(_objDate.GetServerDate());
         TxtDate.Text = _objDate.GetServerDate().ToShortDateString();
     }
     else
     {
         TxtDate.Text = _objDate.GetServerDate().ToShortDateString();
         TxtMiti.Text = _objDate.GetMiti(Convert.ToDateTime(TxtDate.Text));
     }
     if (TxtDate.Enabled == true)
     {
         Utility.GetVoucherNo1("Purchase Indent", TxtVoucherNo, TxtDate, _Tag, "", _DocId);
     }
     else
     {
         Utility.GetVoucherNo2("Purchase Indent", TxtVoucherNo, txtRequestedBy, _Tag, "", _DocId);
     }
 }
Ejemplo n.º 2
0
        private void BtnNew_Click(object sender, EventArgs e)
        {
            ClearFld();
            _Tag = "NEW";
            ControlEnableDisable(false, true);
            this.Text = "Product Rate Scheme  [NEW]";

            if (ClsGlobal.DateType == "M")
            {
                TxtDateFrom.Text = _objDate.GetMiti(_objDate.GetServerDate());
                TxtDateTo.Text   = _objDate.GetMiti(_objDate.GetServerDate());
            }
            else
            {
                TxtDateFrom.Text = _objDate.GetServerDate().ToShortDateString();
                TxtDateTo.Text   = _objDate.GetServerDate().ToShortDateString();
            }
        }
Ejemplo n.º 3
0
 private void ClearFld()
 {
     this.Tag            = "";
     TxtGridWaiter.Text  = "";
     TxtGridStartNo.Text = "";
     TxtGridEndNo.Text   = "";
     TxtGridUsedNo.Text  = "";
     TxtMiti.Text        = _objDate.GetMiti(_objDate.GetServerDate());
     TxtDate.Text        = _objDate.GetServerDate().ToShortDateString();
     Grid.Rows.Clear();
     Grid.Rows.Add();
 }
Ejemplo n.º 4
0
        private void BtnNew_Click(object sender, EventArgs e)
        {
            _Tag = "NEW";
            ControlEnableDisable(false, true);
            this.Text = "Document Numbering [NEW]";

            if (ClsGlobal.DateType == "M")
            {
                TxtStartDate.Text = _objDateMiti.GetMiti(Convert.ToDateTime(ClsGlobal.CompanyStartDate.ToString()));
                TxtEndDate.Text   = _objDateMiti.GetMiti(Convert.ToDateTime(ClsGlobal.CompanyEndDate.ToString()));
            }
            else
            {
                TxtStartDate.Text = ClsGlobal.CompanyStartDate.ToString();
                TxtEndDate.Text   = ClsGlobal.CompanyEndDate.ToString();
            }
        }
Ejemplo n.º 5
0
 private void ClearFld()
 {
     foreach (Control control in PanelContainer.Controls)
     {
         if (control is TextBox)
         {
             control.Text = "";
         }
     }
     _SalesmanId        = 0;
     TxtDescription.Tag = "0";
     TxtFromDate.Text   = DateTime.Now.ToString();
     TxtFromMiti.Text   = _objDate.GetMiti(Convert.ToDateTime(TxtFromDate.Text));
     TxtToDate.Text     = DateTime.Now.AddDays(365).ToString();
     TxtToMiti.Text     = _objDate.GetMiti(Convert.ToDateTime(TxtToDate.Text));
     CbActive.Checked   = true;
     TxtDescription.Focus();
 }
Ejemplo n.º 6
0
        private void CompanySelect()
        {
            if (Grid.Rows.Count > 0)
            {
                ClsGlobal.Initial          = Grid.Rows[Convert.ToInt32(Grid.CurrentRow.Index)].Cells["IniTial"].Value.ToString();
                ClsGlobal.CompanyName      = Grid.Rows[Convert.ToInt32(Grid.CurrentRow.Index)].Cells["Company Name"].Value.ToString();
                ClsGlobal.CompanyStartDate = Convert.ToDateTime(Grid.Rows[Convert.ToInt32(Grid.CurrentRow.Index)].Cells["Start Date"].Value.ToString()).ToShortDateString();
                ClsGlobal.CompanyEndDate   = Convert.ToDateTime(Grid.Rows[Convert.ToInt32(Grid.CurrentRow.Index)].Cells["End Date"].Value.ToString()).ToShortDateString();
                ClsGlobal.DatabaseName     = Grid.Rows[Convert.ToInt32(Grid.CurrentRow.Index)].Cells["Db Name"].Value.ToString();
                DataAccessLayer.Database._CompDatabaseName = Grid.Rows[Convert.ToInt32(Grid.CurrentRow.Index)].Cells["Db Name"].Value.ToString();
                this.Close();

                DataAccessLayer.SystemSetting.ClsCompany _objCompany = new DataAccessLayer.SystemSetting.ClsCompany();
                DataTable     dt     = _objCompany.GetDataCompany(ClsGlobal.Initial);
                StringBuilder strSql = new StringBuilder();
                strSql.Append(dt.Rows[0]["Address"].ToString());
                if (!string.IsNullOrEmpty(dt.Rows[0]["City"].ToString()))
                {
                    strSql.Append(", " + dt.Rows[0]["City"].ToString());
                }
                if (!string.IsNullOrEmpty(dt.Rows[0]["Country"].ToString()))
                {
                    strSql.Append(", " + dt.Rows[0]["Country"].ToString());
                }
                ClsGlobal.CompanyAddress = strSql.ToString();
                strSql.Clear();
                if (!string.IsNullOrEmpty(dt.Rows[0]["PhoneNo"].ToString()))
                {
                    strSql.Append("Phone No : " + dt.Rows[0]["PhoneNo"].ToString());
                }
                if (!string.IsNullOrEmpty(dt.Rows[0]["AltPhoneNo"].ToString()))
                {
                    strSql.Append(", " + dt.Rows[0]["AltPhoneNo"].ToString());
                }
                ClsGlobal.CompanyPhoneNo = strSql.ToString();

                ClsDateMiti _objDate = new ClsDateMiti();
                if (ClsGlobal.DateType == "D")
                {
                    ClsGlobal.CompanyFiscalYear = Convert.ToDateTime(dt.Rows[0]["StartDate"].ToString()).ToShortDateString() + " - " + Convert.ToDateTime(dt.Rows[0]["EndDate"].ToString()).ToShortDateString();
                }
                else
                {
                    ClsGlobal.CompanyStartMiti  = _objDate.GetMiti(Convert.ToDateTime(dt.Rows[0]["StartDate"].ToString()));
                    ClsGlobal.CompanyEndMiti    = _objDate.GetMiti(Convert.ToDateTime(dt.Rows[0]["EndDate"].ToString()));
                    ClsGlobal.CompanyFiscalYear = ClsGlobal.CompanyStartMiti + " - " + ClsGlobal.CompanyEndMiti;
                }

                //---------START UPDATE COMPANY ------------
                Version          versionInfo       = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
                ClsUpdateCompany _objUpdateCompany = new ClsUpdateCompany();
                if (_objUpdateCompany.GetCompanyVersionNo() != versionInfo.ToString())
                {
                    _objUpdateCompany.UpdateCompanyVersionNo(versionInfo.ToString());
                    _objUpdateCompany.CreateView();
                    _objUpdateCompany.InsertDefaultData();
                }
                //---------END UPDATE COMPANY ------------

                ClsGlobal.TodayDateTime = _objDate.GetServerDateTime();
                ClsGlobal.TodayDate     = _objDate.GetServerDate();
                ClsGlobal.EntryControl("");
                ClsGlobal.UserRestriction(ClsGlobal.LoginUserCode, ClsGlobal.Initial);
            }
        }