public MUBHeader(MmlDatum[] buf, iEncoding enc) { this.enc = enc; magic = Cmn.getLE32(buf, 0x0000); dataoffset = Cmn.getLE32(buf, 0x0004); datasize = Cmn.getLE32(buf, 0x0008); tagdata = Cmn.getLE32(buf, 0x000c); tagsize = Cmn.getLE32(buf, 0x0010); pcmdata = Cmn.getLE32(buf, 0x0014); pcmsize = Cmn.getLE32(buf, 0x0018); jumpcount = Cmn.getLE16(buf, 0x001c); jumpline = Cmn.getLE16(buf, 0x001e); if (magic == 0x3842554d) //'MUB8' { ext_flags = Cmn.getLE16(buf, 0x0020); ext_system = (uint)buf[0x0022].dat; ext_target = (uint)buf[0x0023].dat; ext_channel_num = Cmn.getLE16(buf, 0x0024); ext_fmvoice_num = Cmn.getLE16(buf, 0x0026); ext_player = Cmn.getLE32(buf, 0x0028); pad1 = Cmn.getLE32(buf, 0x002c); for (int i = 0; i < 32; i++) { ext_fmvoice[i] = (byte)buf[0x0030 + i].dat; } } srcBuf = buf; }
public bool Save(SaveTutorialContentInputDto inputDTO) { TutorialContent tt = this.tutorialContentRepository.FindBy(x => x.ID == inputDTO.ID).FirstOrDefault(); if (tt == null) { tt = new TutorialContent(); } tt.ParentID = inputDTO.ParentID; tt.Description = Cmn.GetCompressed(inputDTO.Description); tt.DescriptionLength = inputDTO.Description.Length; tt.Title = inputDTO.Title; tt.Type = inputDTO.Type; tt.Seq = inputDTO.Seq; if (inputDTO.ID == 0) { this.tutorialContentRepository.Add(tt); } else { this.tutorialContentRepository.Update(tt); } this.unitOfWork.Commit(); return(true); }
protected void Unnamed1_Click1(object sender, EventArgs e) { rapidInfoModel.Identity a = rapidInfoModel.Identity.GetData(Cmn.ToInt(lblId.Text)); if (a == null) { a = new rapidInfoModel.Identity(); } a.Name = txtName.Text; a.Details = Cmn.GetCompressed(txtDetails.InnerText); a.DetailsLength = txtDetails.InnerText.Length; a.Save(); if (a != null) { string FileName = @"~\Images\identity\" + a.Id + ".jpg"; if (FileUpload.HasFile != false) { try { FileUpload.SaveAs(Server.MapPath(FileName)); RegularExpressionValidator1.Visible = false; } catch (Exception ex) { Cmn.LogError(ex, "Image"); } } } WriteClientScript("parent.GetIdentity();"); }
public void SkontoProzentGovernmentValidTests() { Cmn.Invoice.InvoiceSubtype.VariantOption = ebIModels.Models.InvoiceSubtypes.ValidationRuleSet.Government; _skontoList.LoadFromInvoice(Cmn.Invoice); //_skonto.UpdateFromSkontoListEntry(_skontoList); _skonto.CurrentRuleSet = ebIModels.Models.InvoiceSubtypes.ValidationRuleSet.Government; _skonto.SkontoProzent = 0; _skonto.IsValidSkonto(); Cmn.ListResults(_skonto.Results); Assert.IsTrue(!_skonto.Results.IsValid, "1."); Console.WriteLine("Test = 100"); _skonto.SkontoProzent = 100; _skonto.IsValidSkonto(); Cmn.ListResults(_skonto.Results); Assert.IsTrue(!_skonto.Results.IsValid); Console.WriteLine("Test > 100"); _skonto.SkontoProzent = 110; _skonto.IsValidSkonto(); Cmn.ListResults(_skonto.Results); Assert.IsTrue(!_skonto.Results.IsValid, "2."); Console.WriteLine("Test > 0"); _skonto.SkontoProzent = -5; _skonto.IsValidSkonto(); Cmn.ListResults(_skonto.Results); Assert.IsTrue(!_skonto.Results.IsValid, "3."); }
public void RabattBerechnungTestOk() { DetailsViewModel dView = Cmn.UContainer.Resolve <DetailsViewModel>(new ParameterOverrides() { { "bestPosRequired", false }, { "currentRuleSet", InvVm.CurrentSelectedValidation } }); dView.ArtikelNr = "1001"; dView.Bezeichnung = "Mister Blister"; dView.Menge = new decimal(10.0005); dView.EinzelPreis = new decimal(5.00); dView.VatItem = PlugInSettings.Default.MwStDefaultValue; dView.Einheit = "STK"; dView.Rabatt = 10; dView.BestellBezug = "22"; dView.SaveCommand.Execute(null); Cmn.ListResults(dView.Results); Assert.IsTrue(dView.Results.IsValid); DetailsViewModels dModels = Cmn.UContainer.Resolve <DetailsViewModels>(new ParameterOverrides() { { "bestPosRequired", false }, { "currentRuleSet", InvVm.CurrentSelectedValidation } }); dModels.DetailsViewList.Add(dView); InvVm.DetailsView = dModels.DetailsViewList; InvVm.IsInvoiceValid(); Cmn.ListResults(InvVm.Results); Assert.IsTrue(InvVm.Results.IsValid); InvVm.SaveEbinterfaceCommand.Execute(@"Daten\RabattSaved.xml"); }
void GetIdentity() { List <rapidInfoModel.Identity> list = rapidInfoModel.Identity.GetData(); foreach (rapidInfoModel.Identity a in list) { List <rapidInfoModel.AreaLink> Areas = rapidInfoModel.AreaLink.GetData(Cmn.ToInt(a.Id)); sb.Append(a.Id + "^" + a.Name + "^"); if (Areas.Count != 0) { foreach (rapidInfoModel.AreaLink al in Areas) { rapidInfoModel.Area area = rapidInfoModel.Area.GetData(al.AreaId); sb.Append("<div class='alert alert-warning alert-dismissible' style='display:inline-block;padding:6px;padding-right:25px;' role='alert'>" + "<button type='button' class='close' data-dismiss='alert' onclick='UnlinkAreas(" + al.AreaId + "," + a.Id + ")' aria-label='Close'><span aria-hidden='true'>×</span></button><strong>" + area.Name + "</strong></div> "); } } sb.Append("^"); sb.Append("~"); } }
public ActionResult Selected(int id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Cmn cmn = new Cmn(); cmn.UserName = "******"; if (User.Identity.IsAuthenticated) { cmn.UserName = User.Identity.Name; } Conference conference = db.Conferences.Find(id); if (conference == null) { return(RedirectToAction("", "Home", null)); } UserInformation userInformation = db.UserInformations.Where(p => p.UserAccount == cmn.UserName && p.PermissionEnabled == "Enabled").FirstOrDefault(); if (userInformation == null) { return(RedirectToAction("", "Home", null)); } userInformation.SelectedConference = id; db.Entry(userInformation).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", "Papers", new { id = conference.ID })); }
// GET: Conferences public ActionResult Index() { Cmn cmn = new Cmn(); cmn.UserName = "******"; if (User.Identity.IsAuthenticated) { cmn.UserName = User.Identity.Name; } // Get user information ViewModel_ConferenceProfileSearch viewModel_ConferenceProfileSearch = new ViewModel_ConferenceProfileSearch(); viewModel_ConferenceProfileSearch.UserInformation = db.UserInformations.Where(p => p.UserAccount == cmn.UserName).FirstOrDefault(); viewModel_ConferenceProfileSearch.ViewModel_ConferenceProfiles = (db.Conferences .OrderByDescending(p => p.ID) .Select(p => new ViewModel_ConferenceProfile() { Confernece = p , ControlDates = (db.ControlDates.Where(c => c.ConferenceID == p.ID) .Where(c => c.PeriodFrom <= cmn.CurrentDatetime && c.PeriodTo <= cmn.CurrentDatetime) .ToList()) }) ).ToList(); return(View(viewModel_ConferenceProfileSearch)); // View Menu: // 1. Enabled Manage Paper when selected conference: Papers/Index // 2. Enabled Manage conference as TPC selected conference: Conferences/Manage/5 // 3. Enabled Create new conference as system administrator: Conferences/Create // 4. Enabled Manage conferences as system administator: Conferences/IndexAdmin // List Confernece // 5. Selected conference as Not null of controlDate and user information: Conferences/Select/5 // 6. Linked to Details Conferences/Details/5 }
public static void LogError(Exception ex = null, string Message = "") { string Filename = ""; Filename = HttpContext.Current.Server.MapPath(@"~\Error\Company" + Global.CompanyID + ".txt"); string Error = Cmn.GetIndiaTime().ToString("dd-MMM-yyyy HH.mm") + Environment.NewLine; if (!string.IsNullOrWhiteSpace(Message)) { Error += Message + Environment.NewLine; } if (ex != null) { Error += ex.Message + Environment.NewLine; Error += ex.StackTrace + Environment.NewLine; //Error += ex.InnerException.Message !=null ? ex.InnerException.Message : ""; } try { File.AppendAllText(Filename, Error); } catch { } }
public bool Save(SaveQuestionIutputDto inputQuestion) { QuesList ques = null; if (inputQuestion.ID > 0) { ques = this.questionRepository.FindBy(x => x.ID == inputQuestion.ID).FirstOrDefault(); } if (ques == null) { ques = new QuesList(); } ques.Question = inputQuestion.Question; ques.Answer = Cmn.GetCompressed(inputQuestion.Answer); ques.AnswerLength = inputQuestion.Answer.Length; ques.Language = inputQuestion.Language; ques.Type = inputQuestion.Type; ques.Reviewed = 1; if (inputQuestion.ID == 0) { this.questionRepository.Add(ques); } else { this.questionRepository.Update(ques); } this.unitOfWork.Commit(); return(true); }
public ViewModel_Conference GetViewModel(int?id) { ViewModel_Conference viewModel_Conference = new ViewModel_Conference(); // Return as record null if (id == null) { return(viewModel_Conference); } Conference conference = db.Conferences.Find(id); if (conference == null) { return(viewModel_Conference); } Cmn cmn = new Cmn(); viewModel_Conference.Confernece = conference; List <ControlDate> controlDates = db.ControlDates.Where(p => p.ConferenceID == conference.ID).OrderBy(p => p.Description).ToList(); viewModel_Conference.ControlDates = controlDates; List <Field> Fields = db.Fields.Where(p => p.ConferenceID == conference.ID).OrderBy(p => p.RowNum).ToList(); viewModel_Conference.Fields = Fields; // Disabled // List<ConfigureVPC> ConfigureVPCs = db.ConfigureVPCs.Where(p => p.ConferenceID == conference.ID).OrderBy(p => p.Explanation).ToList(); // viewModel_Conference.ConfigureVPCs = ConfigureVPCs; viewModel_Conference.NumberOfSubmittedPaper = db.Papers.Count(p => p.ConferenceID == conference.ID); viewModel_Conference.NumberOfSubmittedPayment = db.Payments.Count(p => p.ConferenceID == conference.ID); return(viewModel_Conference); }
/// <summary> /// 检测房间在这段时间内被预定或者处于不可预定状态.不可预定状态一般为RoomStatus为D /// </summary> /// <param name="listOrderedInfo">已预定的信息</param> /// <param name="mRoom">预定的房间</param> /// <param name="dtStartTime">预抵时间</param> /// <param name="dtEndTime">预离时间</param> /// <returns>如果验证通过返回True,反之返回False</returns> public bool CheckRoomOrdered(List <OrderInfoModel> listOrderedInfo, BasRoomModel mRoom, DateTime dtStartTime, DateTime dtEndTime) { if (Cmn.CheckEOF(listOrderedInfo)) { var qOrder = listOrderedInfo.Where(c => c.RoomInfo.RoomId == mRoom.RoomId); if (qOrder.Count() > 0 && (qOrder.First().RoomInfo.Status != 'E' || (qOrder.First().CommonInfo.StartDate < dtStartTime && qOrder.First().CommonInfo.EndDate > dtStartTime) || (qOrder.First().CommonInfo.StartDate < dtEndTime && qOrder.First().CommonInfo.EndDate > dtEndTime) )) { if (!Cmn.Confirm("该房间目前处于非可用状态或者已经被预定,是否继续?")) { return(false); } } } else if (mRoom.Status != 'E') { if (!Cmn.Confirm("该房间目前处于非可用状态,是否继续?")) { return(false); } } return(true); }
public void VatBerechtigtOkTest() { SetupSettings(); BillerSettings.IsValid(); Cmn.ListResults(BillerSettings.Results); Assert.AreEqual(true, BillerSettings.Results.IsValid); }
public void VatBerechtigtNotOkTest() { SetupSettings(); BillerSettings.VatId = "0000000"; BillerSettings.IsValid(); Cmn.ListResults(BillerSettings.Results); Assert.AreEqual(false, BillerSettings.Results.IsValid); }
public void VatBerechtigtNotOkTest2() { SetupSettings(); BillerSettings.VatId = PlugInSettings.VatIdDefaultOhneVstBerechtigung; BillerSettings.IsValid(); Cmn.ListResults(BillerSettings.Results); Assert.AreEqual(false, BillerSettings.Results.IsValid); }
public void RelatedDocInvalidRelDocTypeTestOk() { InvVm.VmDocType = DocumentTypeType.CreditMemo.ToString(); SetRelatedDocument(RelatedDocumentViewModel.RefType.Storno, DocumentTypeType.CreditMemo); InvVm.IsInvoiceValid(); Cmn.ListResults(InvVm.Results); Assert.AreEqual(false, InvVm.Results.IsValid); }
public void RelatedDocInvalidInvoiceDocTypeTestOk() { InvVm.VmDocType = DocumentTypeType.FinalSettlement.ToString(); SetRelatedDocument(RelatedDocumentViewModel.RefType.Storno, DocumentTypeType.InvoiceForAdvancePayment); InvVm.IsInvoiceValid(); Cmn.ListResults(InvVm.Results); Assert.AreEqual(false, InvVm.Results.IsValid); }
public List <JFModel> GetPhoneList(JFModel mJf, DateTime dtmNow) { ObjectControls oCtrl = new ObjectControls(); oCtrl.Add(MCtrl.ByPhone); oCtrl.Add(MCtrl.ByStartDate); mJf.PhoneNoGroup = Cmn.RemoveLastDou(mJf.PhoneNoGroup); return(bPhone.GetPhoneDetail(mJf, oCtrl, dtmNow)); }
/// <summary> /// 退房逻辑 /// </summary> /// <param name="listCustomerStayInfo"></param> /// <returns></returns> public bool CheckOutRoom(List <CustomerStayModel> listCustomerStayInfo) { try { ObjectControls oCtrl = new ObjectControls(); foreach (CustomerStayModel mCustomerStay in listCustomerStayInfo) { #region 修改房间状态 mCustomerStay.RoomInfo.Status = 'C'; UpdateRoomStatusByRoomId(mCustomerStay.RoomInfo, new SysUserInfoModel(mCustomerStay.CommonInfo.UpdateUserId)); #endregion #region 更新入住信息 oCtrl.Reset(); oCtrl.Add(MCtrl.SetCustomerStayStatus); oCtrl.Add(MCtrl.SetDeposit); oCtrl.Add(MCtrl.SetEndDate); oCtrl.Add(MCtrl.SetHours); oCtrl.Add(MCtrl.SetNotice); oCtrl.Add(MCtrl.SetPayType); oCtrl.Add(MCtrl.SetPaidMoney); oCtrl.Add(MCtrl.SetStayNo); oCtrl.Add(MCtrl.SetTotal); bCustomerStay.UpdateCustomerStay(mCustomerStay, oCtrl); //退房时将stayhis的入住状态改为离店模式,以区分每个宾客的状态。有时候宾馆房间某一宾客会提前离开,所以需要设置每个宾客的状态。 //如提前离开需修改宾客登记,右击宾客详细列表,在菜单中进行离店操作。 //如要遇到宾客信息登记错误,需要删除,则启用DELETE键删除即可。 if (Cmn.CheckEOF(mCustomerStay.CustomerList)) { foreach (CustomerModel mcustomer in mCustomerStay.CustomerList) { CustomerStayHisModel mcshis = mcustomer.CustomerStayHisInfo; //整个房间退房时,将HIS状态不为O的人改为O:OFF 离店.离店时间为现在.如果该宾客以及事先离店,则不更新. if (mcshis.HisStatus != 'O') { oCtrl.Reset(); mcshis.HisStatus = 'O'; mcshis.CommonInfo.EndDate = Cmn.DateBaseDate; mcshis.CommonInfo.UpdateUserId = mCustomerStay.CommonInfo.UpdateUserId;//更新人员为操作员ID oCtrl.Add(MCtrl.SetEndDate); oCtrl.Add(MCtrl.SetHisStatus); bCustomerStay.UpdateStayHis(mcshis, oCtrl); } } } #endregion } return(true); } catch (Exception err) { throw err; } }
public void KontoLeerNotOkTests() { InitializeKontoTests(); InvVm.CurrentSelectedValidation = InvoiceSubtypes.ValidationRuleSet.Government; InvVm.VmDocType = DocumentTypeType.Invoice.ToString(); InvVm.IsInvoiceValid(); Cmn.ListResults(InvVm.Results); Assert.IsFalse(InvVm.Results.IsValid); }
public void VatNotBerechtigtOkTest() { SetupSettings(); BillerSettings.VatId = PlugInSettings.VatIdDefaultOhneVstBerechtigung; BillerSettings.IsVatBerechtigt = false; BillerSettings.VatText = "ich bin nicht berechtigt"; BillerSettings.IsValid(); Cmn.ListResults(BillerSettings.Results); Assert.AreEqual(true, BillerSettings.Results.IsValid); }
private List <QuesListDisplayOutputDto> GetQuesListOutputDto(List <QuesList> quesList) { return(quesList.Select(q => new QuesListDisplayOutputDto() { id = q.ID, a = Cmn.GetUnCompressed(q.Answer, q.AnswerLength), q = q.Question, t = (int)QuesType.SUBJECTIVE }).ToList()); }
public void VatNotBerechtigtNotOkTest() { SetupSettings(); BillerSettings.IsVatBerechtigt = false; BillerSettings.VatId = PlugInSettings.VatIdDefaultMitVstBerechtigung; // Muss für den Test hier stehen, da sonst überschrieben BillerSettings.VatText = ""; BillerSettings.IsValid(); Cmn.ListResults(BillerSettings.Results); Assert.AreEqual(false, BillerSettings.Results.IsValid); Assert.AreEqual(2, BillerSettings.Results.Count()); }
public int GetFormInt(string FieldName) { NameValueCollection nvc = Request.Form; if (nvc[FieldName] != null) { return(Cmn.ToInt(nvc[FieldName])); } return(0); }
public double GetFormDbl(string FieldName) { NameValueCollection nvc = Request.Form; if (nvc[FieldName] != null) { return(Cmn.ToDbl(nvc[FieldName])); } return(0); }
public DateTime GetFormDate(string FieldName) { NameValueCollection nvc = Request.Form; if (nvc[FieldName] != null) { return(Cmn.ToDate(nvc[FieldName])); } return(Cmn.GetIndiaTime()); }
protected void Page_Load(object sender, EventArgs e) { //Cmn.LogError(null, "test"); Action = QueryString("Action"); Data1 = QueryString("Data1"); Data2 = QueryString("Data2"); Data3 = QueryString("Data3"); Data4 = QueryString("Data4"); Data5 = QueryString("Data5"); Data6 = QueryString("Data6"); Data7 = QueryString("Data7"); Data8 = QueryString("Data8"); string term = QueryString("term"); db = new Database(); db2 = new Database(Global.ConnectionStringrapidInfo); string encode = Cmn.GetEncode(this); try { switch (Action) { case "GetAreas": GetAreas(); break; case "GetIdentity": GetIdentity(); break; case "LinkAreas": LinkAreas(Cmn.ToInt(Data1), Cmn.ToInt(Data2)); break; case "UnlinkAreas": UnlinkAreas(Cmn.ToInt(Data1), Cmn.ToInt(Data2)); break; case "SearchAreas": SearchAreas(term); Cmn.WriteResponse(this, sb.ToString(), encode); return; //SearchAreas } if (!AttachError) { Cmn.WriteResponse(this, sb.ToString(), encode); } else { Cmn.WriteResponse(this, Message + "~" + sb.ToString(), encode); } } catch (Exception ex) { Cmn.WriteResponse(this, Action + "-" + ex.Message + "~" + sb.ToString(), encode); Cmn.LogError(ex, "Data.aspx"); } finally { db.Close(); } }
public void EmailEmptyBundTest() { Cmn.Setup(Common.InvTemplate); // Test mit Template anfangen InvoiceViewModel invoiceView = Cmn.UContainer.Resolve <InvoiceViewModel>(new ParameterOverride("invoice", Cmn.Invoice)); invoiceView.CurrentSelectedValidation = InvoiceSubtypes.ValidationRuleSet.Government; invoiceView.VmBillerMail = ""; bool result = invoiceView.IsInvoiceValid(); Assert.AreEqual(false, result); }
public void UIDNrMissingBelow10000OkTest() { Cmn.Setup(Common.InvTemplate); // Test mit Template anfangen InvoiceViewModel invoiceView = Cmn.UContainer.Resolve <InvoiceViewModel>(new ParameterOverride("invoice", Cmn.Invoice)); invoiceView.CurrentSelectedValidation = InvoiceSubtypes.ValidationRuleSet.Industries; invoiceView.VmRecVatid = ""; bool result = invoiceView.IsInvoiceValid(); Cmn.ListResults(invoiceView.Results); Assert.IsFalse(result, "IsInvoiceValid vor Save ebInterface"); }
public void StornoGutschriftOkTest() { InvVm.VmDocType = "CancelCreditMemo"; InvVm.RelatedDoc = Cmn.UContainer.Resolve <RelatedDocumentViewModel>(); InvVm.RelatedDoc.RefTypeSelected = RelatedDocumentViewModel.RefType.Storno; InvVm.RelatedDoc.RefSelectedDocType = "CreditMemo"; InvVm.RelatedDoc.RefInvNumber = "123123"; InvVm.RelatedDoc.RefInvDate = new DateTime(2013, 12, 13); InvVm.IsInvoiceValid(); Cmn.ListResults(InvVm.Results); Assert.AreEqual(true, InvVm.Results.IsValid); }