示例#1
0
        private void submit_Click(object sender, RoutedEventArgs e)
        {
            double total;
            Repository repo = new Repository();
            total=Double.Parse((repo.ExecuteQuery("SELECT total from stax where bill_no='"+billNo.Text+"'").ToString() ));

            double received = Double.Parse(receivedAmt.Text);
            double tds=(1-(received/total))*100;
            DateTime date1 = dateCheque.SelectedDate.Value;
            string rDate = date1.ToString("yyyy-MM-dd");
            DateTime date2 = dateReceived.SelectedDate.Value;
            string cDate = date2.ToString("yyyy-MM-dd");
            String bill = billNo.Text;

            String cheque = chequeNo.Text;
            String query="UPDATE STAX SET RECEIVED_AMT= "+received
                +", CHEQUE_NO='"+cheque
                + "', CHEQUE_DATE='"+cDate
                +"', RECEIVED_DATE='"+rDate
                +"',TDS="+tds
                +"WHERE BILL_NO='"+bill+"'";

            repo.ExecuteQuery(query);
            if(MessageBox.Show("TDS Added Successfully.", "Result", MessageBoxButton.OK,MessageBoxImage.Asterisk)==MessageBoxResult.OK)
                this.Close();
        }
示例#2
0
文件: RaiseInvoice.cs 项目: vrao/Rank
 //Since the travel details vary, am using overloaded functions..
 //Contains all the fields
 public void Invoice(string refNo,string billNo,string dateBill,string subject,string cliamNo,string insurer,
     string insured,string policyNo,string dateOfLoss,string placeOfSurvey,string datesOfSurvey,double fees,
     double loss,double travelCar,double travelAir,double travelBoarding,double localConveyance,double bataNo,double bata,
     double hotel,double photo,double misc)
 {
     var repo = new Repository();
     double gross = fees + travelAir + travelBoarding + travelCar + localConveyance + bata + hotel + (photo*photoRate) + misc;
     double tax = ((taxRate / 100) * gross);
     double total = tax  + gross;
     string query = "INSERT INTO SURVEY (ref_no,bill_no,date_bill,subject,claim_no,insurer,insured,policy_no,date_loss,place_survey,dates_survey,loss,professional_fees,travel_exp_car,travel_exp_air,travel_exp_boardingplace,local_conveyance,bata,hotel_charges,photo,misc,total_gross,tax,total_net) VALUES"+refNo;
     //"INSERT INTO " .answers. " (teamID,teamname,ans1,ans2,ans3,ans4,ans5,ans6,ans7,ans8,ans9,ans10,ans11,ans12,ans13,ans14,ans15,ans16,ans17,ans18,ans19,ans20,ans21,ans22,ans23,ans24,ans25) VALUES ('".$_SESSION['teamid']."',
     // string query = ("SELECT PASS FROM LOGIN WHERE ID = '" + username + "' ");
     repo.ExecuteQuery(query);
 }
示例#3
0
 public void loginButton_Click(object sender, RoutedEventArgs e)
 {
     string username = userName.Text;
     string password = passwordBox1.Password;
     string query = ("SELECT PASS FROM LOGIN WHERE ID = '" + username + "' ");
     var repo = new Repository();
     var result=repo.ExecuteQuery(query) as String;
     if (password.Equals(result))
     {
         test.Text = "Success";
         var home = new Home();
         home.Show();
         this.Close();
        }
     else
         test.Text = "Failure";
 }
示例#4
0
        //Since the travel details vary, am using overloaded functions..
        //Contains all the fields
        public void Invoice(string refNo,string billNo,string dateBill,string subject,string claimNo,string insurer,
            string insured,string policyNo,string dateOfLoss,string placeOfSurvey,string datesOfSurvey,double fees,
            double loss,double travelCar,double travelAir,double travelTrain,double localConveyance,double bata,
            double hotel,double photo,double misc)
        {
            var repo = new Repository();
            double others = travelAir + travelTrain + travelCar + localConveyance + bata + hotel + (photo * photoRate) + misc;
            double gross = fees + others;
            double tax = ((taxRate / 100) * gross);
            double total = tax  + gross;
            string query = "INSERT INTO SURVEY (ref_no,bill_no,date_bill,subject,claim_no,insurer,insured,policy_no,date_loss,place_survey,dates_survey,loss,fees,travel_exp_car,travel_exp_air,travel_exp_train,local_conveyance,bata,hotel_charges,photo,misc,total_gross,tax,total_net) VALUES"+
                 "('" + refNo + "','" + billNo + "','" + dateBill + "','" + subject + "','" + claimNo + "','"
                + insurer + "','" + insured + "','" + policyNo + "','" + dateOfLoss + "','" + placeOfSurvey + "','" + datesOfSurvey + "','" + loss + "','"
                + fees + "','" + travelCar + "','" + travelAir + "','" + travelTrain + "','" + localConveyance + "','" + bata + "','" + hotel + "','" + photo + "','" + misc + "','" + gross + "','" + tax + "','" + total + "')";

            repo.ExecuteQuery(query);
            ServiceTax(billNo,dateBill,insured,fees,others,tax);
        }
示例#5
0
 public RaiseInvoice()
 {
     repo = new Repository();
     photoRate = float.Parse(repo.ExecuteQuery("SELECT photo_rate from admin") as string) ;
     taxRate = float.Parse(repo.ExecuteQuery("SELECT service_tax from admin") as string);
 }