示例#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);
     }
 }
示例#2
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();
 }
示例#3
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();
            }
        }
示例#4
0
 private void BtnNew_Click(object sender, EventArgs e)
 {
     _Tag = "NEW";
     ControlEnableDisable(false, true);
     Text = "Membership [NEW]";
     if (ClsGlobal.DateType == "M")
     {
         TxtFromMiti.Text = _objDate.GetMiti(_objDate.GetServerDate());
         TxtFromDate.Text = _objDate.GetServerDate().ToShortDateString();
         Fromdate         = Convert.ToDateTime(TxtFromDate.Text.ToString());
         Todate           = Fromdate.AddYears(1);
         TxtToDate.Text   = Todate.ToString();
         TxtToMiti.Text   = _objDate.GetMiti(Todate);
     }
     else
     {
         TxtFromDate.Text = _objDate.GetServerDate().ToShortDateString();
         TxtFromMiti.Text = _objDate.GetMiti(Convert.ToDateTime(TxtFromDate.Text));
         Fromdate         = Convert.ToDateTime(TxtFromDate.Text);
         Todate           = Fromdate.AddYears(1);
         TxtToDate.Text   = Todate.ToString();
         TxtToMiti.Text   = _objDate.GetMiti(Todate);
     }
 }
示例#5
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);
            }
        }