public void SingleMoveZ(HoleInfo moveInfo, string axisType, decimal speed = 0) { if (moveInfo.Z.HasValue) { Contra.LogPosZ = GetActPos(AxisSet.ZReadAxis) * AxisSet.ZResolution; Contra.LogPosA = GetLogPos(AxisSet.AxisZ); Contra.TempLogPosA = Contra.LogPosZ + Contra.TempLogPosZ - Contra.LogPosA; Contra.TempLogPosA55 = Contra.LogPosZ + Contra.TempLogPosZ55 - Contra.LogPosA; Contra.TempLogPosA56 = Contra.LogPosZ + Contra.TempLogPosZ56 - Contra.LogPosA; Contra.TempLogPosA57 = Contra.LogPosZ + Contra.TempLogPosZ57 - Contra.LogPosA; Contra.TempLogPosA58 = Contra.LogPosZ + Contra.TempLogPosZ58 - Contra.LogPosA; Contra.TempLogPosA59 = Contra.LogPosZ + Contra.TempLogPosZ59 - Contra.LogPosA; Contra.TempLogPosA60 = Contra.LogPosZ + Contra.TempLogPosZ60 - Contra.LogPosA; Contra.TempLogPosA61 = Contra.LogPosZ + Contra.TempLogPosZ61 - Contra.LogPosA; Contra.TempLogPosA62 = Contra.LogPosZ + Contra.TempLogPosZ62 - Contra.LogPosA; Contra.TempLogPosA63 = Contra.LogPosZ + Contra.TempLogPosZ63 - Contra.LogPosA; Contra.TempLogPosA64 = Contra.LogPosZ + Contra.TempLogPosZ64 - Contra.LogPosA; Contra.TempLogPosA65 = Contra.LogPosZ + Contra.TempLogPosZ65 - Contra.LogPosA; decimal actPosA = Contra.GetActPosZ(axisType); var v = GetMovePosition("Z", moveInfo.Z, actPosA, Contra.LogPosA, isAPlus != isOldAPlus, isOldAPlus, out jianxiA); isAPlus = moveInfo.Z.Value >= actPosA; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisZ, v, Contra.StartSpeed, (int)(speed == 0 ? AxisSet.SpeedZPerSecond : speed), (double)Contra.AddSpeedTime); isOldAPlus = isAPlus; } }
private void ConfContra_MouseEnter(object sender, MouseEventArgs e) { if (clasificador == 1) { EyeOff.Kind = MaterialDesignThemes.Wpf.PackIconKind.Eye; clasificador = -1; ConfContra.Visibility = System.Windows.Visibility.Collapsed; ConfContraV.Visibility = System.Windows.Visibility.Visible; Contra.Visibility = System.Windows.Visibility.Collapsed; ContraV.Visibility = System.Windows.Visibility.Visible; ContraV.Focus(); ConfContraV.Focus(); } else if (clasificador == -1) { EyeOff.Kind = MaterialDesignThemes.Wpf.PackIconKind.EyeOff; clasificador = 1; ConfContra.Visibility = System.Windows.Visibility.Visible; ConfContraV.Visibility = System.Windows.Visibility.Collapsed; Contra.Visibility = System.Windows.Visibility.Visible; ContraV.Visibility = System.Windows.Visibility.Collapsed; Contra.Focus(); ConfContra.Focus(); } }
public Modifier(ModifierType modifierType, TeamModifier team, bool announced, Contra contra = Contra.None) { ModifierType = modifierType; Team = team; Announced = announced; ContraFactor = contra; }
public static void Main(string[] args) { var objMario = new Mario(); var objContra = new Contra(); ActionClass.DoWork(objMario); }
public void SingleMoveW(HoleInfo moveInfo, string axisType) { if (moveInfo.W.HasValue) { decimal actPosW = Contra.GetActPosW(axisType); isWPlus = moveInfo.W.Value >= actPosW; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisW, GetMovePosition("W", moveInfo.W, actPosW, Contra.LogPosW, isWPlus != isOldWPlus, isOldWPlus, out jianxiW), Contra.StartSpeed, (int)AxisSet.SpeedWPerSecond, (double)Contra.AddSpeedTime); isOldWPlus = isWPlus; } }
public void SingleMoveX(HoleInfo moveInfo, string axisType) { if (moveInfo.X.HasValue) { decimal actPosX = Contra.GetActPosX(axisType); isXPlus = moveInfo.X.Value >= actPosX; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisX, GetMovePosition("X", moveInfo.X, actPosX, Contra.LogPosX, isXPlus != isOldXPlus, isOldXPlus, out jianxiX), Contra.StartSpeed, (int)AxisSet.SpeedXPerSecond, (double)Contra.AddSpeedTime); isOldXPlus = isXPlus; } }
public void SingleMoveC(HoleInfo moveInfo, string axisType, int?speed) { if (moveInfo.C.HasValue) { decimal actPosC = Contra.GetActPosC(axisType); isCPlus = moveInfo.C.Value >= actPosC; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisC, GetMovePosition("C", moveInfo.C, actPosC, Contra.LogPosC, isCPlus != isOldCPlus, isOldCPlus, out jianxiC), Contra.StartSpeed, speed ?? (int)AxisSet.SpeedCPerSecond, (double)Contra.AddSpeedTime); isOldCPlus = isCPlus; } }
public void SingleMoveY(HoleInfo moveInfo, string axisType) { if (moveInfo.Y.HasValue) { decimal actPosY = Contra.GetActPosY(axisType); isYPlus = moveInfo.Y.Value >= actPosY; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisY, GetMovePosition("Y", moveInfo.Y, actPosY, Contra.LogPosY, isYPlus != isOldYPlus, isOldYPlus, out jianxiY), Contra.StartSpeed, (int)AxisSet.SpeedYPerSecond, (double)Contra.AddSpeedTime); isOldYPlus = isYPlus; } }
public void SingleMoveB(HoleInfo moveInfo, string axisType) { if (moveInfo.B.HasValue) { decimal actPosB = Contra.GetActPosB(axisType); isBPlus = moveInfo.B.Value >= actPosB; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisB, GetMovePosition("B", moveInfo.B, actPosB, Contra.LogPosB, isBPlus != isOldBPlus, isOldBPlus, out jianxiB), Contra.StartSpeed, (int)AxisSet.SpeedBPerSecond, (double)Contra.AddSpeedTime); isOldBPlus = isBPlus; } }
private async Task OnFinalizar() { try { if (!await CheckInternet()) { return; } if (Contra.IsNullOrEmpty()) { await DisplayMessage("Info", "Ingrese su contraseña"); return; } if (ContraConfirmar.IsNullOrEmpty()) { await DisplayMessage("Info", "Confirme su contraseña"); return; } if (Contra != ContraConfirmar) { await DisplayMessage("Info", "Contraseñas no coinciden"); return; } IsBusy = true; //BusyMessage = "Creando perfil..."; Model.pass = Contra; var response = await _servicio.CrearPerfilUsuario(Model); if (response.IsSuccess) { App.PerfilUsuarioInfo = Model; await CacheHelper.UpdateCache("PerfilUsuarioInfo", App.PerfilUsuarioInfo); Application.Current.MainPage = new PrincipalPage(_navigation, _dialogService); } else { await DisplayApiMessage(response); } } catch (Exception ex) { await DisplayError(ex); } }
public void UnionMove(UnionMoveInfo moveInfo, string axisType) { if (moveInfo.X.HasValue && moveInfo.Y.HasValue) { decimal actPosX = Contra.GetActPosX(axisType); isXPlus = moveInfo.X.Value >= actPosX; decimal actPosY = Contra.GetActPosY(axisType); isYPlus = moveInfo.Y.Value >= actPosY; CtrlCard.Sym_AbsoluteLine2(AxisSet.AxisX, AxisSet.AxisY, GetMovePosition("X", moveInfo.X, actPosX, Contra.LogPosX, isXPlus != isOldXPlus, isOldXPlus, out jianxiX), GetMovePosition("Y", moveInfo.Y, actPosY, Contra.LogPosY, isYPlus != isOldYPlus, isOldYPlus, out jianxiY), Contra.StartSpeed, (int)AxisSet.SpeedXPerSecond, Contra.AddSpeedTime); isOldXPlus = isXPlus; isOldYPlus = isYPlus; } if (moveInfo.W.HasValue && moveInfo.A.HasValue) { decimal actPosW = Contra.GetActPosW(axisType); isWPlus = moveInfo.W.Value >= actPosW; decimal actPosA = Contra.GetActPosA(axisType); isAPlus = moveInfo.A.Value >= actPosA; CtrlCard.Sym_AbsoluteLine2(AxisSet.AxisW, AxisSet.AxisZ, GetMovePosition("W", moveInfo.W, actPosW, Contra.LogPosW, isWPlus != isOldWPlus, isOldWPlus, out jianxiW), GetMovePosition("A", moveInfo.A, actPosA, Contra.LogPosA, isAPlus != isOldAPlus, isOldAPlus, out jianxiA), Contra.StartSpeed, (int)AxisSet.SpeedWPerSecond, Contra.AddSpeedTime); isOldWPlus = isWPlus; isOldAPlus = isAPlus; } if (moveInfo.B.HasValue && moveInfo.C.HasValue) { decimal actPosB = Contra.GetActPosB(axisType); isBPlus = moveInfo.B.Value >= actPosB; decimal actPosC = Contra.GetActPosC(axisType); isCPlus = moveInfo.C.Value >= actPosC; CtrlCard.Sym_AbsoluteLine2(AxisSet.AxisB, AxisSet.AxisC, GetMovePosition("B", moveInfo.B, actPosB, Contra.LogPosB, isBPlus != isOldBPlus, isOldBPlus, out jianxiB), GetMovePosition("C", moveInfo.C, actPosC, Contra.LogPosC, isCPlus != isOldCPlus, isOldCPlus, out jianxiC), Contra.StartSpeed, (int)AxisSet.SpeedWPerSecond, Contra.AddSpeedTime); isOldWPlus = isWPlus; isOldAPlus = isAPlus; } isMove = true; }
private int GetJianxiPosition(string axisType, Nullable <decimal> infoValue, decimal lastPosition, decimal logPosition) { decimal value = logPosition; if (infoValue.HasValue) { value += infoValue.Value; if (isG90) { value -= lastPosition; } } value = Contra.GetJianXiValue(axisType, value, lastPosition, AxisSet); return(Convert.ToInt32(value * 1000)); }
private int GetMovePosition(string axisType, Nullable <decimal> infoValue, decimal lastPosition, decimal logPosition, bool flag, bool flag2, out decimal jianxi) { decimal value = logPosition; jianxi = 0; if (infoValue.HasValue) { value += infoValue.Value; if (isG90) { value -= lastPosition; } } value = Contra.GetRealValue(axisType, value, AxisSet, flag, flag2, out jianxi); return(Convert.ToInt32(value * 1000)); }
//************************************************************************ //************************************************************************ //THESE ARE THE DIRECT CONTROL FROM SORTARRAY.CS //************************************************************************ //************************************************************************ //************************************************************************ private void Alpha_Click_1(object sender, EventArgs e) //************************************************************************ { // Sort Bank array normal if (Bank._badirection == 1) { Bank._badirection = 0; a[0] = 0; string msg = "Bank ArrayList Sort Order has been changed to Normal (Ascending)\r\n"; SortArray.SortBankArray(0); Info.Text = "Normal ( Ascending)"; Info.ForeColor = Color.Black; Bank.form1.ShowText(msg, a, 0); //the method defined in Bank Alpha.Enabled = false; Contra.Enabled = true; Contra.Focus( ); } }
public ActionResult Contra() { Contra model = new Contra(); bool Exists = db.Voucher_Entry_Credit.Any(c => c.voucher_type.Equals("Contra")); if (Exists == true && db.Voucher_Entry_Credit.Select(p => p.record_no).Count() > 0) { var id = (from n in db.Voucher_Entry_Credit.Where(x => x.voucher_type == "Contra") select n.record_no).Max(); int recno = Convert.ToInt32(id) + 1; model.RecordNo = recno.ToString(); } else { model.RecordNo = "1"; } return(View(model)); }
private void Window_Loaded(object sender, RoutedEventArgs e) { Estado = false; Contra.Focus(); }
private bool isMove = false;//TODO public void SingleMove(HoleInfo moveInfo, string axisType) { if (moveInfo.X.HasValue) { decimal actPosX = Contra.GetActPosX(axisType); isXPlus = moveInfo.X.Value >= actPosX; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisX, GetMovePosition("X", moveInfo.X, actPosX, Contra.LogPosX, isXPlus != isOldXPlus, isOldXPlus, out jianxiX), Contra.StartSpeed, (int)AxisSet.SpeedXPerSecond, (double)Contra.AddSpeedTime); isOldXPlus = isXPlus; } if (moveInfo.Y.HasValue) { decimal actPosY = Contra.GetActPosY(axisType); isYPlus = moveInfo.Y.Value >= actPosY; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisY, GetMovePosition("Y", moveInfo.Y, actPosY, Contra.LogPosY, isYPlus != isOldYPlus, isOldYPlus, out jianxiY), Contra.StartSpeed, (int)AxisSet.SpeedYPerSecond, (double)Contra.AddSpeedTime); isOldYPlus = isYPlus; } if (moveInfo.W.HasValue) { decimal actPosW = Contra.GetActPosW(axisType); isWPlus = moveInfo.W.Value >= actPosW; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisW, GetMovePosition("W", moveInfo.W, actPosW, Contra.LogPosW, isWPlus != isOldWPlus, isOldWPlus, out jianxiW), Contra.StartSpeed, (int)AxisSet.SpeedWPerSecond, (double)Contra.AddSpeedTime); isOldWPlus = isWPlus; } if (moveInfo.Z.HasValue) { Contra.LogPosZ = GetActPos(AxisSet.ZReadAxis) * AxisSet.ZResolution; Contra.LogPosA = GetLogPos(AxisSet.AxisZ); Contra.TempLogPosA = Contra.LogPosZ + Contra.TempLogPosZ - Contra.LogPosA; Contra.TempLogPosA55 = Contra.LogPosZ + Contra.TempLogPosZ55 - Contra.LogPosA; Contra.TempLogPosA56 = Contra.LogPosZ + Contra.TempLogPosZ56 - Contra.LogPosA; Contra.TempLogPosA57 = Contra.LogPosZ + Contra.TempLogPosZ57 - Contra.LogPosA; Contra.TempLogPosA58 = Contra.LogPosZ + Contra.TempLogPosZ58 - Contra.LogPosA; Contra.TempLogPosA59 = Contra.LogPosZ + Contra.TempLogPosZ59 - Contra.LogPosA; decimal actPosA = Contra.GetActPosZ(axisType); isAPlus = moveInfo.Z.Value >= actPosA; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisZ, GetMovePosition("Z", moveInfo.Z, actPosA, Contra.LogPosA, isAPlus != isOldAPlus, isOldAPlus, out jianxiA), Contra.StartSpeed, (int)AxisSet.SpeedZPerSecond, (double)Contra.AddSpeedTime); isOldAPlus = isAPlus; } if (moveInfo.B.HasValue) { decimal actPosB = Contra.GetActPosB(axisType); isBPlus = moveInfo.B.Value >= actPosB; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisB, GetMovePosition("B", moveInfo.B, actPosB, Contra.LogPosB, isBPlus != isOldBPlus, isOldBPlus, out jianxiB), Contra.StartSpeed, (int)AxisSet.SpeedBPerSecond, (double)Contra.AddSpeedTime); isOldBPlus = isBPlus; } if (moveInfo.C.HasValue) { decimal actPosC = Contra.GetActPosC(axisType); isCPlus = moveInfo.C.Value >= actPosC; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisC, GetMovePosition("C", moveInfo.C, actPosC, Contra.LogPosC, isCPlus != isOldCPlus, isOldCPlus, out jianxiC), Contra.StartSpeed, (int)AxisSet.SpeedCPerSecond, (double)Contra.AddSpeedTime); isOldCPlus = isCPlus; } isMove = true; }
public void SingleMove(HoleInfo moveInfo, string axisType) { decimal actPosW = Contra.GetActPosW(axisType); decimal moveToW = moveInfo.W ?? actPosW; if (moveState == 0 && actPosW < moveToW) { isWPlus = moveInfo.W.Value >= actPosW; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisW, GetMovePosition("W", moveInfo.W, actPosW, Contra.LogPosW, isWPlus != isOldWPlus, isOldWPlus, out jianxiW), Contra.StartSpeed, (int)AxisSet.SpeedWPerSecond, (double)Contra.AddSpeedTime); isOldWPlus = isWPlus; moveState = 1; } else if (moveState == 1 || (!moveInfo.W.HasValue && moveState != 2) || (moveInfo.W.HasValue && actPosW >= moveToW && moveState != 2)) { if (moveInfo.X.HasValue) { decimal actPosX = Contra.GetActPosX(axisType); isXPlus = moveInfo.X.Value >= actPosX; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisX, GetMovePosition("X", moveInfo.X, actPosX, Contra.LogPosX, isXPlus != isOldXPlus, isOldXPlus, out jianxiX), Contra.StartSpeed, (int)AxisSet.SpeedXPerSecond, (double)Contra.AddSpeedTime); isOldXPlus = isXPlus; } if (moveInfo.Y.HasValue) { decimal actPosY = Contra.GetActPosY(axisType); isYPlus = moveInfo.Y.Value >= actPosY; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisY, GetMovePosition("Y", moveInfo.Y, actPosY, Contra.LogPosY, isYPlus != isOldYPlus, isOldYPlus, out jianxiY), Contra.StartSpeed, (int)AxisSet.SpeedYPerSecond, (double)Contra.AddSpeedTime); isOldYPlus = isYPlus; } if (moveInfo.Z.HasValue) { Contra.LogPosZ = GetActPos(AxisSet.ZReadAxis) * AxisSet.ZResolution; Contra.LogPosA = GetLogPos(AxisSet.AxisZ); Contra.TempLogPosA = Contra.LogPosZ + Contra.TempLogPosZ - Contra.LogPosA; Contra.TempLogPosA55 = Contra.LogPosZ + Contra.TempLogPosZ55 - Contra.LogPosA; Contra.TempLogPosA56 = Contra.LogPosZ + Contra.TempLogPosZ56 - Contra.LogPosA; Contra.TempLogPosA57 = Contra.LogPosZ + Contra.TempLogPosZ57 - Contra.LogPosA; Contra.TempLogPosA58 = Contra.LogPosZ + Contra.TempLogPosZ58 - Contra.LogPosA; Contra.TempLogPosA59 = Contra.LogPosZ + Contra.TempLogPosZ59 - Contra.LogPosA; Contra.TempLogPosA60 = Contra.LogPosZ + Contra.TempLogPosZ60 - Contra.LogPosA; Contra.TempLogPosA61 = Contra.LogPosZ + Contra.TempLogPosZ61 - Contra.LogPosA; Contra.TempLogPosA62 = Contra.LogPosZ + Contra.TempLogPosZ62 - Contra.LogPosA; Contra.TempLogPosA63 = Contra.LogPosZ + Contra.TempLogPosZ63 - Contra.LogPosA; Contra.TempLogPosA64 = Contra.LogPosZ + Contra.TempLogPosZ64 - Contra.LogPosA; Contra.TempLogPosA65 = Contra.LogPosZ + Contra.TempLogPosZ65 - Contra.LogPosA; decimal actPosA = Contra.GetActPosZ(axisType); isAPlus = moveInfo.Z.Value >= actPosA; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisZ, GetMovePosition("Z", moveInfo.Z, actPosA, Contra.LogPosA, isAPlus != isOldAPlus, isOldAPlus, out jianxiA), Contra.StartSpeed, (int)AxisSet.SpeedZPerSecond, (double)Contra.AddSpeedTime); isOldAPlus = isAPlus; } if (moveInfo.B.HasValue) { decimal actPosB = Contra.GetActPosB(axisType); isBPlus = moveInfo.B.Value >= actPosB; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisB, GetMovePosition("B", moveInfo.B, actPosB, Contra.LogPosB, isBPlus != isOldBPlus, isOldBPlus, out jianxiB), Contra.StartSpeed, (int)AxisSet.SpeedBPerSecond, (double)Contra.AddSpeedTime); isOldBPlus = isBPlus; } if (moveInfo.C.HasValue) { decimal actPosC = Contra.GetActPosC(axisType); isCPlus = moveInfo.C.Value >= actPosC; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisC, GetMovePosition("C", moveInfo.C, actPosC, Contra.LogPosC, isCPlus != isOldCPlus, isOldCPlus, out jianxiC), Contra.StartSpeed, (int)AxisSet.SpeedCPerSecond, (double)Contra.AddSpeedTime); isOldCPlus = isCPlus; } moveState = (!moveInfo.W.HasValue || actPosW >= moveToW) ? 2 : 0; } else if (moveState == 2 && actPosW >= moveToW) { if (moveInfo.W.HasValue) { isWPlus = moveInfo.W.Value >= actPosW; CtrlCard.Sym_AbsoluteMove(AxisSet.AxisW, GetMovePosition("W", moveInfo.W, actPosW, Contra.LogPosW, isWPlus != isOldWPlus, isOldWPlus, out jianxiW), Contra.StartSpeed, (int)AxisSet.SpeedWPerSecond, (double)Contra.AddSpeedTime); isOldWPlus = isWPlus; } moveState = 0; } }
// Use this for initialization void Start () { floating = true; cam = Camera.main; contraScript = cam.GetComponent<Contra> (); Velocity = Vector3.zero; }
public RoundModifier(string modifierType, Shared.Enums.TeamModifier team, Guid roundId, bool announced = false, Contra contra = Shared.Enums.Contra.None) { this.ModifierType = modifierType; this.Team = (int)team; this.Announced = announced; this.Contra = (int)contra; this.RoundId = roundId; }
public ActionResult ContraBill(Contra model) { try { int CurrentYear = DateTime.Today.Year; int PreviousYear = DateTime.Today.Year - 1; int NextYear = DateTime.Today.Year + 1; string PreYear = PreviousYear.ToString(); string NexYear = NextYear.ToString(); string CurYear = CurrentYear.ToString(); string FinYear = null; if (DateTime.Today.Month > 3) { FinYear = CurYear + "-" + NexYear; } else { FinYear = PreYear + "-" + CurYear; } //int Pid = (from p in db.tblPurchaseOrderMasters where p.OutletId == OutletId select p.PurchaseOrderId).Max(); for (int i = 0; i < model.LedgerAccId.Length; i++) { Voucher_Entry_Credit tb = new Voucher_Entry_Credit(); tb.voucher_no = model.VoucherNo; tb.Voucher_date = model.Date; tb.record_no = model.RecordNo.ToString(); tb.record_date = model.Date; tb.voucher_sno = i + 1; tb.voucher_tb = "To"; tb.voucher_type = "Contra"; tb.voucher_year = FinYear; tb.from_form_name = "Contra"; tb.userid = WebSecurity.CurrentUserId; tb.account_type = "Contra"; //tb.Refrenceno = model.Refrenceno[i]; string name = model.LedgerAccId[i]; var id = (from n in db.tblLedgerMasters.Where(x => x.LedgerName == name) select n.LedgerMasterId).SingleOrDefault(); tb.from_form_id = 0; tb.voucher_ledger_accout_id = Convert.ToInt32(id); tb.voucher_cr_amount = model.CreditAmount[i]; tb.voucher_narration = model.CrNarration[i]; tb.create_date = DateTime.Now; db.Voucher_Entry_Credit.Add(tb); db.SaveChanges(); } for (int j = 0; j < model.ByAccount.Length; j++) { Voucher_Entry_Debit tb1 = new Voucher_Entry_Debit(); tb1.voucher_no = model.VoucherNo; tb1.voucher_date = model.Date; tb1.record_no = model.RecordNo.ToString(); tb1.record_date = model.Date; tb1.voucher_sno = j + 1; tb1.voucher_tb = "By"; tb1.voucher_type = "Contra"; tb1.voucher_year = FinYear; tb1.from_form_name = "Contra"; tb1.userid = WebSecurity.CurrentUserId; tb1.account_type = "Contra"; tb1.Refrenceno = model.Refrenceno[j]; tb1.from_form_id = 0; string accountname = model.ByAccount[j]; var idl = (from n in db.tblLedgerMasters.Where(x => x.LedgerName == accountname) select n.LedgerMasterId).SingleOrDefault(); tb1.voucher_ledger_accout_id = Convert.ToInt32(idl); tb1.voucher_dbt_amount = model.DrAmount[j]; tb1.voucher_narration = model.DrNarration[j]; tb1.create_date = DateTime.Now; db.Voucher_Entry_Debit.Add(tb1); db.SaveChanges(); } TempData["Perror"] = "Inserted Successfully !"; return(View("Contra")); } catch (Exception ex) { //return View(ex); TempData["Perror"] = "Please Enter the Details Correctlly !"; return(RedirectToAction("Contra")); } }