Esempio n. 1
0
 private string GetRakeNumberFromTempGross()
 {
     using (var db = new DBEngine())
     {
         return(db.ExecuteQuery("Select Max(RakeNo) from TempGross"));
     }
 }
Esempio n. 2
0
        private DataTable GetSourceList()
        {
            var db       = new DBEngine();
            var dtVendor = new DataSet();

            db.ExecuteQuery("Select SourName from Source", null, dtVendor, "Vendors");
            return(dtVendor.Tables[0]);
        }
Esempio n. 3
0
        private DataTable GetDefaultData()
        {
            var db       = new DBEngine();
            var dtVendor = new DataSet();

            db.ExecuteQuery("Select Product, Source,Destination,Type from [Default]", null, dtVendor, "Default");
            return(dtVendor.Tables[0]);
        }
Esempio n. 4
0
        private DataTable GetRakeNoList()
        {
            var db       = new DBEngine();
            var dtVendor = new DataSet();

            db.ExecuteQuery("Select Distinct RakeNo from temp where Tare=0", null, dtVendor, "Rake");
            return(dtVendor.Tables[0]);
        }
Esempio n. 5
0
        public static DataSet LoadPortingValue()
        {
            var db        = new DBEngine();
            var dtPorting = new DataSet();

            db.ExecuteQuery("Select Commtrack1, commBaud1,IsStaticDynamic from ScreenCommon", null, dtPorting, "Porting");
            return(dtPorting);
        }
Esempio n. 6
0
        private DataTable GetDestList()
        {
            var db       = new DBEngine();
            var dtVendor = new DataSet();

            db.ExecuteQuery("Select DestName from Destination", null, dtVendor, "Destination");
            return(dtVendor.Tables[0]);
        }
Esempio n. 7
0
        private DataTable GetProductCommodityList()
        {
            var db       = new DBEngine();
            var dtVendor = new DataSet();

            db.ExecuteQuery("select ProdName from Product", null, dtVendor, "Product");
            return(dtVendor.Tables[0]);
        }
Esempio n. 8
0
        private DataTable GetWagonList()
        {
            var db       = new DBEngine();
            var dtVendor = new DataSet();

            db.ExecuteQuery("Select Wtype from Wagon", null, dtVendor, "Wagon");
            return(dtVendor.Tables[0]);
        }
Esempio n. 9
0
        private bool LoadPortingValue()
        {
            var db        = new DBEngine();
            var dtPorting = new DataSet();

            db.ExecuteQuery("Select IsStaticDynamic from ScreenCommon", null, dtPorting, "Porting");
            if (dtPorting.Tables[0] != null && dtPorting.Tables[0].Rows.Count > 0 && !string.IsNullOrEmpty(dtPorting.Tables[0].Rows[0][0].ToString()))
            {
                if (!string.IsNullOrEmpty(dtPorting.Tables[0].Rows[0][0].ToString()))
                {
                    return(Convert.ToBoolean(dtPorting.Tables[0].Rows[0][0].ToString()));
                }
            }
            return(false);
        }
Esempio n. 10
0
        private bool IsPortingSet()
        {
            var db        = new DBEngine();
            var dtPorting = new DataSet();

            db.ExecuteQuery("Select Commtrack1, commBaud1 from ScreenCommon", null, dtPorting, "Porting");
            if (dtPorting.Tables[0] != null && dtPorting.Tables[0].Rows.Count > 0 && !string.IsNullOrEmpty(dtPorting.Tables[0].Rows[0][0].ToString()) && !string.IsNullOrEmpty(dtPorting.Tables[0].Rows[0][1].ToString()))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 11
0
        private void StaticWeighment_Load(object sender, EventArgs e)
        {
            var db       = new DBEngine();
            var dtVendor = new DataSet();

            lblTitle.Text = db.ExecuteQuery("Select Screen1,Commtrack1, commBaud1 from ScreenCommon");

            txtDate.Text = DateTime.Now.ToString(Shared_Variables.DateFormat);


            DataTable dt = GetDefaultData();

            WagonType = dt.Rows[0][3].ToString();
            From      = dt.Rows[0][1].ToString();
            To        = dt.Rows[0][2].ToString();
            Product   = dt.Rows[0][0].ToString();

            string tempTare  = GetRakeNumberFromTempTare();
            string tempGross = GetRakeNumberFromTempGross();

            if (string.IsNullOrEmpty(tempTare) && string.IsNullOrEmpty(tempGross))
            {
                txtRakeNo.Text = DateTime.Now.Year + "000" + "001";
            }
            else
            {
                if (string.IsNullOrEmpty(tempTare))
                {
                    tempTare = "0";
                }

                if (string.IsNullOrEmpty(tempGross))
                {
                    tempGross = "0";
                }

                if (int.Parse(tempTare) > int.Parse(tempGross))
                {
                    txtRakeNo.Text = tempTare.ToString();
                }
                else
                {
                    txtRakeNo.Text = (int.Parse(tempGross) + 1).ToString();
                }
            }
        }
Esempio n. 12
0
        private void txtRakeNo_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)Keys.Enter)
            {
                if (!string.IsNullOrEmpty(txtRakeNo.Text))
                {
                    string query    = string.Format("Select slno,wagonno,wagontype,tare,pcc,cc,gross,net,UL,OL from temp where RakeNo={0} and Tare=0 order by val(slno)", txtRakeNo.Text);
                    var    db       = new DBEngine();
                    var    dtVendor = new DataSet();
                    db.ExecuteQuery(query, null, dtVendor, "Rake");

                    dgRakeView.DataSource = dtVendor.Tables[0];
                    AssignDefaultValueForEmptyColumn();

                    //dgRakeView.Columns["datein"].Visible = false;
                    //dgRakeView.Columns["timein"].Visible = false;
                    txtWagonNo.Focus();
                    txtSlno.Text = "1";
                }
            }
        }
Esempio n. 13
0
        private void txtPassword_KeyPress(object sender, KeyPressEventArgs e)
        {
            //update Login set Pwd='{0}' where LoginType='{1}' and UserName='******'
            if (e.KeyChar == (char)Keys.Enter)
            {
                if (string.IsNullOrEmpty(txtPassword.Text))
                {
                    return;
                }
                var    dbengine = new DBEngine();
                string pwd      = dbengine.ExecuteQuery("select Pwd from Login where LoginType='Login' and UserName='******'");

                if (txtUserName.Text == "RLYINMWB" && txtPassword.Text == pwd)
                {
                    this.Hide();
                    new frmDefaultImage().Show();
                }
                else
                {
                    MessageBox.Show("UserName And Password Is Incorrect");
                    return;
                }
            }
        }