Exemplo n.º 1
0
        public void UpdateAPLinkConfig(APLinkConfigDetails Details)
        {
            try
            {
                string SQL = "UPDATE tblERPConfig SET " +
                             "ChartOfAccountIDAPTracking     = @ChartOfAccountIDAPTracking, " +
                             "ChartOfAccountIDAPBills        = @ChartOfAccountIDAPBills, " +
                             "ChartOfAccountIDAPFreight      = @ChartOfAccountIDAPFreight, " +
                             "ChartOfAccountIDAPVDeposit     = @ChartOfAccountIDAPVDeposit, " +
                             "ChartOfAccountIDAPContra       = @ChartOfAccountIDAPContra, " +
                             "ChartOfAccountIDAPLatePayment  = @ChartOfAccountIDAPLatePayment;";



                MySqlCommand cmd = new MySqlCommand();


                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = SQL;

                MySqlParameter prmChartOfAccountIDAPTracking = new MySqlParameter("@ChartOfAccountIDAPTracking", MySqlDbType.Int32);
                prmChartOfAccountIDAPTracking.Value = Details.ChartOfAccountIDAPTracking;
                cmd.Parameters.Add(prmChartOfAccountIDAPTracking);

                MySqlParameter prmChartOfAccountIDAPBills = new MySqlParameter("@ChartOfAccountIDAPBills", MySqlDbType.Int32);
                prmChartOfAccountIDAPBills.Value = Details.ChartOfAccountIDAPBills;
                cmd.Parameters.Add(prmChartOfAccountIDAPBills);

                MySqlParameter prmChartOfAccountIDAPFreight = new MySqlParameter("@ChartOfAccountIDAPFreight", MySqlDbType.Int32);
                prmChartOfAccountIDAPFreight.Value = Details.ChartOfAccountIDAPFreight;
                cmd.Parameters.Add(prmChartOfAccountIDAPFreight);

                MySqlParameter prmChartOfAccountIDAPVDeposit = new MySqlParameter("@ChartOfAccountIDAPVDeposit", MySqlDbType.Int32);
                prmChartOfAccountIDAPVDeposit.Value = Details.ChartOfAccountIDAPVDeposit;
                cmd.Parameters.Add(prmChartOfAccountIDAPVDeposit);

                MySqlParameter prmChartOfAccountIDAPContra = new MySqlParameter("@ChartOfAccountIDAPContra", MySqlDbType.Int32);
                prmChartOfAccountIDAPContra.Value = Details.ChartOfAccountIDAPContra;
                cmd.Parameters.Add(prmChartOfAccountIDAPContra);

                MySqlParameter prmChartOfAccountIDAPLatePayment = new MySqlParameter("@ChartOfAccountIDAPLatePayment", MySqlDbType.Int32);
                prmChartOfAccountIDAPLatePayment.Value = Details.ChartOfAccountIDAPLatePayment;
                cmd.Parameters.Add(prmChartOfAccountIDAPLatePayment);

                base.ExecuteNonQuery(cmd);
            }

            catch (Exception ex)
            {
                {
                }

                throw base.ThrowException(ex);
            }
        }
Exemplo n.º 2
0
        public APLinkConfigDetails APLinkDetails()
        {
            try
            {
                string SQL = "SELECT " +
                             "ChartOfAccountIDAPTracking, " +
                             "ChartOfAccountIDAPBills, " +
                             "ChartOfAccountIDAPFreight, " +
                             "ChartOfAccountIDAPVDeposit, " +
                             "ChartOfAccountIDAPContra, " +
                             "ChartOfAccountIDAPLatePayment " +
                             "FROM tblERPConfig;";

                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = SQL;

                string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName);
                base.MySqlDataAdapterFill(cmd, dt);

                APLinkConfigDetails Details = new APLinkConfigDetails();

                foreach (System.Data.DataRow dr in dt.Rows)
                {
                    Details.ChartOfAccountIDAPTracking    = Int32.Parse(dr["ChartOfAccountIDAPTracking"].ToString());
                    Details.ChartOfAccountIDAPBills       = Int32.Parse(dr["ChartOfAccountIDAPBills"].ToString());
                    Details.ChartOfAccountIDAPFreight     = Int32.Parse(dr["ChartOfAccountIDAPFreight"].ToString());
                    Details.ChartOfAccountIDAPVDeposit    = Int32.Parse(dr["ChartOfAccountIDAPVDeposit"].ToString());
                    Details.ChartOfAccountIDAPContra      = Int32.Parse(dr["ChartOfAccountIDAPContra"].ToString());
                    Details.ChartOfAccountIDAPLatePayment = Int32.Parse(dr["ChartOfAccountIDAPLatePayment"].ToString());
                }

                return(Details);
            }

            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
Exemplo n.º 3
0
        public APLinkConfigDetails APLinkDetails()
        {
            try
            {
                string SQL = "SELECT " +
                                "ChartOfAccountIDAPTracking, " +
                                "ChartOfAccountIDAPBills, " +
                                "ChartOfAccountIDAPFreight, " +
                                "ChartOfAccountIDAPVDeposit, " +
                                "ChartOfAccountIDAPContra, " +
                                "ChartOfAccountIDAPLatePayment " +
                            "FROM tblERPConfig;";

                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = SQL;

                string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName);
                base.MySqlDataAdapterFill(cmd, dt);
				
                APLinkConfigDetails Details = new APLinkConfigDetails();

                foreach (System.Data.DataRow dr in dt.Rows)
                {
                    Details.ChartOfAccountIDAPTracking = Int32.Parse(dr["ChartOfAccountIDAPTracking"].ToString());
                    Details.ChartOfAccountIDAPBills = Int32.Parse(dr["ChartOfAccountIDAPBills"].ToString());
                    Details.ChartOfAccountIDAPFreight = Int32.Parse(dr["ChartOfAccountIDAPFreight"].ToString());
                    Details.ChartOfAccountIDAPVDeposit = Int32.Parse(dr["ChartOfAccountIDAPVDeposit"].ToString());
                    Details.ChartOfAccountIDAPContra = Int32.Parse(dr["ChartOfAccountIDAPContra"].ToString());
                    Details.ChartOfAccountIDAPLatePayment = Int32.Parse(dr["ChartOfAccountIDAPLatePayment"].ToString());
                }

                return Details;
            }

            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
Exemplo n.º 4
0
        public void UpdateAPLinkConfig(APLinkConfigDetails Details)
        {
            try
            {
                string SQL = "UPDATE tblERPConfig SET " +
                                "ChartOfAccountIDAPTracking     = @ChartOfAccountIDAPTracking, " +
                                "ChartOfAccountIDAPBills        = @ChartOfAccountIDAPBills, " +
                                "ChartOfAccountIDAPFreight      = @ChartOfAccountIDAPFreight, " +
                                "ChartOfAccountIDAPVDeposit     = @ChartOfAccountIDAPVDeposit, " +
                                "ChartOfAccountIDAPContra       = @ChartOfAccountIDAPContra, " +
                                "ChartOfAccountIDAPLatePayment  = @ChartOfAccountIDAPLatePayment;";

                

                MySqlCommand cmd = new MySqlCommand();
                
                
                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = SQL;

                MySqlParameter prmChartOfAccountIDAPTracking = new MySqlParameter("@ChartOfAccountIDAPTracking",MySqlDbType.Int32);
                prmChartOfAccountIDAPTracking.Value = Details.ChartOfAccountIDAPTracking;
                cmd.Parameters.Add(prmChartOfAccountIDAPTracking);

                MySqlParameter prmChartOfAccountIDAPBills = new MySqlParameter("@ChartOfAccountIDAPBills",MySqlDbType.Int32);
                prmChartOfAccountIDAPBills.Value = Details.ChartOfAccountIDAPBills;
                cmd.Parameters.Add(prmChartOfAccountIDAPBills);

                MySqlParameter prmChartOfAccountIDAPFreight = new MySqlParameter("@ChartOfAccountIDAPFreight",MySqlDbType.Int32);
                prmChartOfAccountIDAPFreight.Value = Details.ChartOfAccountIDAPFreight;
                cmd.Parameters.Add(prmChartOfAccountIDAPFreight);

                MySqlParameter prmChartOfAccountIDAPVDeposit = new MySqlParameter("@ChartOfAccountIDAPVDeposit",MySqlDbType.Int32);
                prmChartOfAccountIDAPVDeposit.Value = Details.ChartOfAccountIDAPVDeposit;
                cmd.Parameters.Add(prmChartOfAccountIDAPVDeposit);

                MySqlParameter prmChartOfAccountIDAPContra = new MySqlParameter("@ChartOfAccountIDAPContra",MySqlDbType.Int32);
                prmChartOfAccountIDAPContra.Value = Details.ChartOfAccountIDAPContra;
                cmd.Parameters.Add(prmChartOfAccountIDAPContra);

                MySqlParameter prmChartOfAccountIDAPLatePayment = new MySqlParameter("@ChartOfAccountIDAPLatePayment",MySqlDbType.Int32);
                prmChartOfAccountIDAPLatePayment.Value = Details.ChartOfAccountIDAPLatePayment;
                cmd.Parameters.Add(prmChartOfAccountIDAPLatePayment);

                base.ExecuteNonQuery(cmd);
            }

            catch (Exception ex)
            {
                
                
                {
                    
                    
                    
                    
                }

                throw base.ThrowException(ex);
            }
        }
Exemplo n.º 5
0
		private void SaveRecord()
		{

            APLinkConfigDetails clsDetails = new APLinkConfigDetails();

            clsDetails.ChartOfAccountIDAPTracking = Convert.ToInt32(cboChartOfAccountAPTracking.SelectedItem.Value);
            clsDetails.ChartOfAccountIDAPBills = Convert.ToInt32(cboChartOfAccountAPBills.SelectedItem.Value);
            clsDetails.ChartOfAccountIDAPFreight = Convert.ToInt32(cboChartOfAccountAPFreight.SelectedItem.Value);
            clsDetails.ChartOfAccountIDAPVDeposit = Convert.ToInt32(cboChartOfAccountAPVDeposit.SelectedItem.Value);
            clsDetails.ChartOfAccountIDAPContra = Convert.ToInt32(cboChartOfAccountAPContra.SelectedItem.Value);
            clsDetails.ChartOfAccountIDAPLatePayment = Convert.ToInt32(cboChartOfAccountAPLatePayment.SelectedItem.Value);

			ERPConfig clsERPConfig = new ERPConfig();
			clsERPConfig.UpdateAPLinkConfig(clsDetails);

			clsERPConfig.CommitAndDispose();
		}