private void Dis_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { this.CalculateNetAmount(); OtherCharges.Focus(); } }
protected void GridInword_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.DataRow && !string.IsNullOrEmpty(Convert.ToString(DataBinder.Eval(e.Row.DataItem, "InwardNo")))) { //Taxamt += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "DiscAmnt")); SubTotal += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "SubTotal")); Discount += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Discount")); Vat += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "Vat")); DekhrekhAmt += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "DekhrekhAmt")); HamaliAmt += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "HamaliAmt")); CESSAmt += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "CESSAmt")); FreightAmt += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "FreightAmt")); PackingAmt += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "PackingAmt")); PostageAmt += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "PostageAmt")); OtherCharges += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "OtherCharges")); GrandTotal += Convert.ToDecimal(DataBinder.Eval(e.Row.DataItem, "GrandTotal")); } if (e.Row.RowType == DataControlRowType.Footer) { e.Row.Cells[6].Text = "Total"; e.Row.Cells[7].Text = SubTotal.ToString("0.00"); e.Row.Cells[8].Text = Discount.ToString("0.00"); e.Row.Cells[9].Text = Vat.ToString("0.00"); e.Row.Cells[10].Text = DekhrekhAmt.ToString("0.00"); e.Row.Cells[11].Text = HamaliAmt.ToString("0.00"); e.Row.Cells[12].Text = CESSAmt.ToString("0.00"); e.Row.Cells[13].Text = FreightAmt.ToString("0.00"); e.Row.Cells[14].Text = PackingAmt.ToString("0.00"); e.Row.Cells[15].Text = PostageAmt.ToString("0.00"); e.Row.Cells[16].Text = OtherCharges.ToString("0.00"); e.Row.Cells[17].Text = GrandTotal.ToString("0.00"); } } catch (Exception ex) { throw new Exception(ex.Message); } }
public OtherCharges GetOtherChargesRecord(string recordID, string UserSNo) { OtherCharges otherCharges = new OtherCharges(); SqlDataReader dr = null; try { SqlParameter[] Parameters = { new SqlParameter("@SNo", recordID), new SqlParameter("@UserID", Convert.ToInt32(UserSNo)) }; dr = SqlHelper.ExecuteReader(DMLConnectionString.WebConfigConnectionString, CommandType.StoredProcedure, "GetOtherChargesRecord", Parameters); if (dr.Read()) { //SNo,AirlineSNo,AirLine,OtherChargesSNo,OtherCharges,IsOtherChargeMandatory,OriginLevelSNo,OriginLevel,DestinationLevelSNo,DestinationLevel,DueChargeType, //Status,StatusText,UnitText,CurrencySNo,Currency,ChargeType,ChargeTypeText,PaymentType,PaymentText,MinimumCharge,Charge,IsTaxable, //IsCommissionable,ValidFrom,ValidTo,OriginSNo,OriginText,DestinationSNo,DestinationText,CreatedUser,UpdatedUser otherCharges.SNo = Convert.ToInt32(dr["SNo"]); otherCharges.AirlineSNo = Convert.ToString(dr["AirlineSNo"]); otherCharges.Text_AirlineSNo = Convert.ToString(dr["AirLine"]); otherCharges.DueCarrierCodeSNo = Convert.ToString(dr["OtherChargesSNo"]); otherCharges.Text_OCCodeSNo = Convert.ToString(dr["OtherCharges"]); otherCharges.IsOtherChargeMandatory = Convert.ToBoolean(dr["IsOtherChargeMandatory"]); otherCharges.OtherChargeMandatory = Convert.ToString(dr["OtherChargeMandatory"]); otherCharges.OriginType = Convert.ToInt32(dr["OriginLevelSNo"]); otherCharges.Text_OriginType = Convert.ToString(dr["OriginLevel"]); otherCharges.DestinationType = Convert.ToInt32(dr["DestinationLevelSNo"]); otherCharges.Text_DestinationType = Convert.ToString(dr["DestinationLevel"]); otherCharges.DueChargeTypeText = Convert.ToString(dr["DueChargeType"]); otherCharges.Text_ApplicableOn = Convert.ToString(dr["Text_ApplicableOn"]); otherCharges.DueChargeType = Convert.ToString(dr["DueChargeTypeText"]); otherCharges.Status = Convert.ToInt32(dr["Status"]); otherCharges.Text_Active = Convert.ToString(dr["StatusText"]); otherCharges.UnitText = Convert.ToString(dr["UnitText"]); otherCharges.CurrencySNo = Convert.ToInt32(dr["CurrencySNo"]); otherCharges.Text_CurrencySNo = Convert.ToString(dr["Currency"]); otherCharges.ChargeType = Convert.ToInt32(dr["ChargeType"]); otherCharges.Text_ChargeType = Convert.ToString(dr["ChargeTypeText"]); otherCharges.PaymentType = Convert.ToInt32(dr["PaymentType"]); otherCharges.Text_PaymentType = Convert.ToString(dr["PaymentText"]); otherCharges.MinimumCharge = Convert.ToDecimal(dr["MinimumCharge"]); otherCharges.Charge = Convert.ToDecimal(dr["Charge"]); otherCharges.IsTaxable = Convert.ToBoolean(dr["IsTaxable"]); otherCharges.Taxable = Convert.ToString(dr["Taxable"]); otherCharges.IsCommissionable = Convert.ToBoolean(dr["IsCommissionable"]); otherCharges.ReferenceNumber = Convert.ToString(dr["ReferenceNumber"]); otherCharges.Commissionable = Convert.ToString(dr["Commissionable"]); otherCharges.ValidFrom = Convert.ToDateTime(dr["ValidFrom"]); otherCharges.ValidTo = Convert.ToDateTime(dr["ValidTo"]); otherCharges.OriginAirPortSNo = Convert.ToInt32(dr["OriginSNo"]); otherCharges.Text_OriginAirPortSNo = Convert.ToString(dr["OriginText"]); otherCharges.Text_OriginSNo = Convert.ToString(dr["OriginText"]); otherCharges.DestinationAirPortSNo = Convert.ToInt32(dr["DestinationSNo"]); otherCharges.Text_DestinationAirPortSNo = Convert.ToString(dr["DestinationText"]); otherCharges.Text_DestinationSNo = Convert.ToString(dr["DestinationText"]); otherCharges.CreatedUser = Convert.ToString(dr["CreatedUser"]); otherCharges.UpdatedUser = Convert.ToString(dr["UpdatedUser"]); otherCharges.IsReplanCharges = Convert.ToBoolean(dr["IsReplanCharges"]); otherCharges.Text_IsReplanCharges = Convert.ToString(dr["Text_IsReplanCharges"]); otherCharges.SlabCount = 0; otherCharges.RemarksCount = 0; } } catch (Exception ex) // { dr.Close(); throw ex; } return(otherCharges); }