public DirectorWindow(DirectorsDTO director, BLL.BLL BLL_)
 {
     InitializeComponent();
     LoadData(director);
     this.director = director;
     this.BLL_     = BLL_;
 }
예제 #2
0
 static void Main(string[] args)
 {
     BLL.BLL _bll = new BLL.BLL();
     _bll.SomeWork();
     Console.WriteLine("Good!");
     Console.ReadLine();
 }
예제 #3
0
 public WorkerWindow(WorkersDTO worker, BLL.BLL BLL_)
 {
     InitializeComponent();
     LoadData(worker);
     this.worker = worker;
     this.BLL_   = BLL_;
 }
예제 #4
0
파일: Program.cs 프로젝트: senglory/Medcom
        static void Main(string[] args)
        {
            var bll = new BLL.BLL(@"c:\tmp\1");

            bll.Add(new Note
            {
                Name    = "qqq",
                Content = "demo 1"
            });
            bll.Add(new Note
            {
                Name    = "www",
                Content = "demo 2"
            });
            bll.Add(new WebAcc
            {
                Name = "www",
                Url  = "www.jdpa.com"
            });
            bll.Add(new CreditCard
            {
                Name   = "Visa",
                Number = "1111 2222 3333 demo"
            });
            bll.Add(new CreditCard
            {
                Name    = "Amex",
                Number  = "4444 5555 3333 7777",
                ExpDate = DateTime.UtcNow
            });
            bll.Flush();

            var bll2 = new BLL.BLL(@"c:\tmp\1");
            var cc2  = bll2.GetItemById(4);
        }
예제 #5
0
        public ActionResult Index(BLL.User_Details user)
        {
            
            if (ModelState.IsValid)
            {
                LoginBLL bll = new LoginBLL();
                string str = bll.LoginCheck(user);
                if (str == "Admin")
                {
                    //ViewBag.LoginID = user.User_ID;
                    Session["loginDetails"] = TempData["LoginId"] = user_Id = user.User_ID;
                    return RedirectToAction( "NewUserRegistration","Admin");
                }
                else if (str == "Prod_Admin")
                {
                    Session["loginDetails"] = user_Id = user.User_ID; ;
                    return RedirectToAction("ProductAdminHome", "ProdAdmin");
                }
                else if (str == "User")
                {

                    return RedirectToAction("User", "Admin");
                }
                else
                {
                    ModelState.AddModelError("", "Login data is incorrect!");
                    return RedirectToAction("Index");
                }
            }

            return View();
        }
예제 #6
0
 public ProductWindow(ProductsDTO product, BLL.BLL BLL_)
 {
     InitializeComponent();
     LoadData(product);
     this.product = product;
     this.BLL_    = BLL_;
 }
예제 #7
0
 public ShopWindow_(ShopsDTO shop, BLL.BLL BLL_)
 {
     InitializeComponent();
     LoadData(shop);
     this.shop = shop;
     this.BLL_ = BLL_;
 }
예제 #8
0
        //public static void AddNew(SPWeb web, SPListItem item, string nadawca, string odbiorca, string kopiaDla, bool KopiaDoNadawcy, bool KopiaDoBiura, string temat, string tresc, string trescHTML, DateTime planowanaDataNadania, int zadanieId, int klientId)
        //{
        //    AddNew(web, item, nadawca, odbiorca, kopiaDla, KopiaDoNadawcy, KopiaDoBiura, temat, tresc, trescHTML, planowanaDataNadania, item.ID, klientId, BLL.Models.Marker.Ignore);
        //}

        /// <summary>
        /// tworzy zlecenie wysyłki wiadomości bez załączników (nie przekazuje item)
        /// </summary>
        //public static void AddNew(SPWeb web, string nadawca, string odbiorca, string kopiaDla, bool KopiaDoNadawcy, bool KopiaDoBiura, string temat, string tresc, string trescHTML, DateTime planowanaDataNadania, int zadanieId, int klientId)
        //{
        //    AddNew(web, null, nadawca, odbiorca, kopiaDla, KopiaDoNadawcy, KopiaDoBiura, temat, tresc, trescHTML, planowanaDataNadania, zadanieId, klientId);
        //}

        //public static void AddNew(SPListItem item, bool hasAttachements, string nadawca, string odbiorca, string kopiaDla, bool KopiaDoNadawcy, bool KopiaDoBiura, string temat, string tresc, string trescHTML, DateTime planowanaDataNadania, int zadanieId, int klientId)
        //{
        //    AddNew(item.Web, null, nadawca, odbiorca, kopiaDla, KopiaDoNadawcy, KopiaDoBiura, temat, tresc, trescHTML, planowanaDataNadania, zadanieId, klientId);
        //}

        //private static void AddNew(SPListItem item, DateTime reminderDate, string subject, string bodyHtml)
        //{
        //    int klientId = Get_KlientId(item);
        //    string nadawca = string.Empty;
        //    string odbiorca = Get_String(item, "colEmail");
        //    AddNew(item.Web, nadawca, odbiorca, string.Empty, false, false, subject, string.Empty, bodyHtml, reminderDate, item.ID, klientId);
        //}


        public static void AddNew(SPWeb web, SPListItem item, string nadawca, string odbiorca, string kopiaDla, bool KopiaDoNadawcy, bool KopiaDoBiura, string temat, string tresc, string trescHTML, DateTime planowanaDataNadania, int zadanieId, int klientId, BLL.Models.Marker marker)
        {
            SPList list = web.Lists.TryGetList(targetList);
            SPListItem newItem = list.AddItem();
            newItem["Title"] = temat;
            if (string.IsNullOrEmpty(nadawca)) nadawca = BLL.admSetup.GetValue(web, "EMAIL_BIURA");

            newItem["colNadawca"] = nadawca;
            newItem["colOdbiorca"] = odbiorca;
            newItem["colKopiaDla"] = kopiaDla;
            newItem["colTresc"] = tresc;
            newItem["colTrescHTML"] = trescHTML;
            if (!string.IsNullOrEmpty(planowanaDataNadania.ToString()) && planowanaDataNadania != new DateTime())
            {
                newItem["colPlanowanaDataNadania"] = planowanaDataNadania.ToString();
            }
            newItem["colKopiaDoNadawcy"] = KopiaDoNadawcy;
            newItem["colKopiaDoBiura"] = KopiaDoBiura;
            if (zadanieId > 0) newItem["_ZadanieId"] = zadanieId;

            if (klientId > 0) newItem["selKlient_NazwaSkrocona"] = klientId;


            //newItem.SystemUpdate();

            //obsługa wysyłki załączników jeżeli Item został przekazany w wywołaniu procedury
            if (item != null)
            {
                for (int attachmentIndex = 0; attachmentIndex < item.Attachments.Count; attachmentIndex++)
                {
                    string url = item.Attachments.UrlPrefix + item.Attachments[attachmentIndex];
                    SPFile file = item.ParentList.ParentWeb.GetFile(url);

                    if (file.Exists)
                    {
                        //sprawdź markety i dodawaj tylko odpowiednie pliki
                        switch (marker)
                        {
                            case BLL.Models.Marker.ReminderZUS:
                                if (file.Name.StartsWith("DRUK WPŁATY__ZUS")
                                    || file.Name.StartsWith("DRUK WPŁATY__Składka zdrowotna"))
                                    Copy_Attachement(newItem, file);
                                break;
                            case BLL.Models.Marker.ReminderZUS_PIT:
                                if (file.Name.StartsWith("DRUK WPŁATY__PIT"))
                                    Copy_Attachement(newItem, file);
                                break;
                            case BLL.Models.Marker.NoAttachements:
                                break;
                            default:
                                Copy_Attachement(newItem, file);
                                break;
                        }
                    }
                }
            }

            newItem.SystemUpdate();
        }
예제 #9
0
        /*
         * private void button1_Click(object sender, EventArgs e)
         * {
         *
         *  string userName = txtUserName.Text.Trim();
         *  string password = txtPassword.Text;
         *  BLL.BLL mgr = new BLL.BLL();
         *  Model.UserInfo user = mgr.UserLogin(userName, password);
         *
         *
         *  MessageBox.Show("登录用户:" + user.UserName);
         *
         *
         * }
         */

        private void btnGetAll_Click(object sender, EventArgs e)
        {
            //
            BLL.BLL bLL = new BLL.BLL();

            dataGridView1.DataSource = bLL.GetListUser().Tables[0];
            //
        }
예제 #10
0
        public void setStatus(BLL.pub.PagerTClass pageT)
        {
            lbTotPage.Text = pageT.PageCount.ToString();
            lbIndexPage.Text = pageT.IndexPage.ToString();
            lbTotPage1.Text = pageT.PageCount.ToString();

            lbPrePage.Enabled = pageT.PrevShow;
            lbNexPage.Enabled = pageT.NextShow;
        }
예제 #11
0
        //插入数据
        private void btnInsert_Click(object sender, EventArgs e)
        {
            UserInfo userInfo = new UserInfo();

            userInfo.UserName = txtUserName.Text.ToString();
            userInfo.Password = txtPassword.Text.ToString();
            userInfo.Email    = txtEmail.Text.ToString();
            BLL.BLL bLL = new BLL.BLL();
            bLL.Insert(userInfo);
        }
예제 #12
0
        //更新数据
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            UserInfo userInfo = new UserInfo();

            userInfo.ID       = Convert.ToInt32(txtID.Text);
            userInfo.UserName = txtUserName.Text.ToString();
            userInfo.Password = txtPassword.Text.ToString();
            userInfo.Email    = txtEmail.Text.ToString();
            BLL.BLL bLL = new BLL.BLL();
            bLL.Update(userInfo);
        }
예제 #13
0
파일: ZUS_Forms.cs 프로젝트: fraczo/Animus
 /// <summary>
 /// jeżeli klient ma przypisane serwisy ZUS zgodne z zadaną maską i klucz KEY nie jest zdublowany
 /// uruchamiana jest procedura tworzenia zadania
 /// </summary>
 internal static void Manage_ZUS_Form(SPWeb web, int okresId, SPListItem klientItem, BLL.Models.Klient iok)
 {
     if (BLL.Tools.Has_SerwisAssigned(klientItem, "selSewisy", "ZUS-*"))
     {
         string key = BLL.tabZadania.Define_KEY(ctZUS, klientItem.ID, okresId);
         if (BLL.tabZadania.Check_KEY_IsAllowed(key, web, 0))
         {
             BLL.tabZadania.Create_ctZUS_Form(web, ctZUS, klientItem.ID, okresId, key, klientItem, iok);
         }
     }
 }
예제 #14
0
 public static void NotifyRoom(Room room, BLL.RoomTypeSpecDuration bllRoomTypeSpecDuration)
 {
     var settings = new
     {
         CamCount = bllRoomTypeSpecDuration.RoomTypeSpec.MicCount,
         MaxMic = bllRoomTypeSpecDuration.RoomTypeSpec.MicCount,
         TypeID = bllRoomTypeSpecDuration.RoomTypeSpec.ID,
         Color = bllRoomTypeSpecDuration.RoomTypeSpec.Color
     };
     Microsoft.AspNet.SignalR.IHubContext _Rcontext = Microsoft.AspNet.SignalR.GlobalHost.ConnectionManager.GetHubContext<Chat2Connect.SRCustomHubs.ChatRoomHub>();
     _Rcontext.Clients.Group(room.RoomID.ToString()).updateRoomType(room.RoomID.ToString(), settings);
 }
예제 #15
0
        public static int Ensure_KartaKontrolna(SPWeb web, int klientId, int okresId, BLL.Models.Klient iok)
        {
            Debug.WriteLine("BLL.tabKartyKontrolne.Ensure_KartaKontrolna");

            string KEY = Create_KEY(klientId, okresId);
            int formId = Get_KartaKontrolnaId(web, klientId, okresId, KEY, iok);

            if (formId > 0) return formId;
            else
            {
                return Create_KartaKontrolna(web, klientId, okresId, iok, KEY);
            }
        }
예제 #16
0
        private void btnSelect_Click(object sender, EventArgs e)
        {
            UserInfo userInfo = new UserInfo();

            if (txtID.Text.Trim() != String.Empty)
            {
                userInfo.ID = Convert.ToInt32(txtID.Text);
            }
            userInfo.UserName = txtUserName.Text.ToString();
            userInfo.Password = txtPassword.Text.ToString();
            userInfo.Email    = txtEmail.Text.ToString();
            BLL.BLL bLL = new BLL.BLL();
            dataGridView1.DataSource = bLL.Select(userInfo).Tables[0];
        }
예제 #17
0
 private void btnDel_Click(object sender, EventArgs e)
 {
     if (txtID.Text.Trim() != String.Empty)
     {
         UserInfo userInfo = new UserInfo();
         userInfo.ID = Convert.ToInt32(txtID.Text);
         //userInfo.UserName = txtUserName.Text.ToString();
         //userInfo.Password = txtPassword.Text.ToString();
         //userInfo.Email = txtEmail.Text.ToString();
         BLL.BLL bLL = new BLL.BLL();
         bLL.Delete(userInfo);
     }
     else
     {
         MessageBox.Show("必须输入ID!");
     }
 }
        public static List<ReceiptInvoice> ToList(BLL.ReceiptInvoice v)
        {
            List<ReceiptInvoice> list = new List<ReceiptInvoice>();
            while (!v.EOF)
            {
                ReceiptInvoice t = new ReceiptInvoice();
                if (!v.IsColumnNull("ID"))
                    t.ID = v.ID;
                if (!v.IsColumnNull("InvoiceTypeID"))
                    t.InvoiceTypeID = v.InvoiceTypeID;
                if (!v.IsColumnNull("STVOrInvoiceNo"))
                    t.STVOrInvoiceNo = v.STVOrInvoiceNo;
                if (!v.IsColumnNull("WayBillNo"))
                    t.WayBillNo = v.WayBillNo;
                if (!v.IsColumnNull("TransitTransferNo"))
                    t.TransitTransferNo = v.TransitTransferNo;
                if (!v.IsColumnNull("InsurancePolicyNo"))
                    t.InsurancePolicyNo = v.InsurancePolicyNo;
                if (!v.IsColumnNull("DateOfEntry"))
                    t.DateOfEntry = v.DateOfEntry;
                if (!v.IsColumnNull("ReceiptInvoiceType"))
                    t.ReceiptInvoiceType = v.ReceiptInvoiceType;
                if (!v.IsColumnNull("TotalValue"))
                    t.TotalValue = v.TotalValue;
                if (!v.IsColumnNull("Insurance"))
                    t.Insurance = v.Insurance;
                if (!v.IsColumnNull("AirFreight"))
                    t.AirFreight = v.AirFreight;
                if (!v.IsColumnNull("SeaFreight"))
                    t.SeaFreight = v.SeaFreight;
                if (!v.IsColumnNull("InlandFreight"))
                    t.InlandFreight = v.InlandFreight;
                if (!v.IsColumnNull("NBE"))
                    t.NBE = v.NBE;
                if (!v.IsColumnNull("CBE"))
                    t.CBE = v.CBE;
                if (!v.IsColumnNull("CustomDutyTax"))
                    t.CustomDutyTax = v.CustomDutyTax;
                if (!v.IsColumnNull("TransitServiceCharge"))
                    t.TransitServiceCharge = v.TransitServiceCharge;
                if (!v.IsColumnNull("Provision"))
                    t.Provision = v.Provision;
                if (!v.IsColumnNull("OtherExpense"))
                    t.OtherExpense = v.OtherExpense;
                if (!v.IsColumnNull("ExchangeRate"))
                    t.ExchangeRate = v.ExchangeRate;
                if (!v.IsColumnNull("SavedByUserID"))
                    t.SavedByUserID = v.SavedByUserID;
                if (!v.IsColumnNull("POID"))
                    t.POID = v.POID;
                if (!v.IsColumnNull("Currency"))
                    t.Currency = v.Currency;
                if (!v.IsColumnNull("LCID"))
                    t.LCID = v.LCID;

                list.Add(t);
                v.MoveNext();
            }
            return list;
        }
예제 #19
0
        public ActionResult NewUserRegistration(BLL.User_Details user)
        {
            if (Session["logindetails"] != null)
            {
                TempData["LoginId"] = user_Id;
                SuperAdminBLL bll = new SuperAdminBLL();
                if (ModelState.IsValid)
                {

                    int res = bll.createNewUser(user, user.Role);
                    if (res > 0)
                    {
                        ViewBag.Message = "Sucess";
                    }
                }
                return View();
            }
            else
            {
                return RedirectToAction("Error");
            }
        }
예제 #20
0
        private void butLogin_Click(object sender, EventArgs e)
        {
            ThanhVien current_tv = new ThanhVien(txbUserName.Text, txbPassword.Text);

            current_tv = new BLL.BLL().Login(current_tv);

            if (current_tv.VAITRO.Contains("BAN TO CHUC"))
            {
                this.Hide();
                FormBanTochuc f = new FormBanTochuc(current_tv);
                f.ShowDialog();
                this.Show();
            }
            else
            {
                if (current_tv.VAITRO.Contains("TO LAP DANH SACH"))
                {
                    this.Hide();
                    FormToLapDanhSach f = new FormToLapDanhSach(current_tv);
                    f.ShowDialog();
                    this.Show();
                }
                else
                {
                    if (current_tv.VAITRO.Contains("TO THEO DOI KET QUA"))
                    {
                        this.Hide();
                        var f = new FormToTheoDoiKetQua(current_tv);
                        f.ShowDialog();
                        this.Show();
                    }
                    else
                    {
                        if (current_tv.VAITRO.Contains("BO PHAN GIAM SAT"))
                        {
                            this.Hide();
                            var f = new FormBoPhanGiamSat(current_tv);
                            f.ShowDialog();
                            this.Show();
                        }
                        else
                        {
                            if (current_tv.VAITRO.Contains("NGUOI DI BAU"))
                            {
                                this.Hide();
                                FormNguoiDiBau f = new FormNguoiDiBau(current_tv);
                                f.ShowDialog();
                                this.Show();
                            }
                            else
                            {
                                this.Show();
                                MessageBox.Show("Invalid username or password!");
                                this.txbUserName.Text = "";
                                this.txbPassword.Text = "";
                            }
                        }
                    }
                }
            }
        }
        public static int SavePLITSApprovedOrderToDatabase(int Status, int userID, int? plitsOrderID, int facilityID, int paymentType,
                                              int modeID, string remarks, string letterNumber, string contactPerson,
                                              BLL.OrderDetail _PLITSOrderDetail)
        {
            int hcmisorderid;
            MyGeneration.dOOdads.TransactionMgr mgr = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr();
            try
            {
                mgr.BeginTransaction();
                BLL.Order or = new BLL.Order();

                or.AddNew();
                or.RefNo = Order.GetNextOrderReference();
                or.OrderTypeID = OrderType.CONSTANTS.PLITS;
                or.HCTSReferenceID = plitsOrderID.Value;

                or.OrderStatusID = Status;

                or.RequisitionTypeID = RequisitionType.CONSTANTS.DEMAND;
                or.Remark = remarks;

                or.EurDate = or.Date = DateTimeHelper.ServerDateTime; //Both fields are assigned dates.
                var institution = new Institution();
                institution.LoadBySN(facilityID);
                or.RequestedBy = institution.ID;
                or.FilledBy = userID;
                or.LetterNo = letterNumber;
                or.PaymentTypeID = paymentType;
                or.ContactPerson = contactPerson;
                or.FromStore = modeID;
                or.FiscalYearID = FiscalYear.Current.ID;
                or.Save();
                or.LogRequisitionStatus(or.ID,null,Status, CurrentContext.UserId); //Log OrderStatus change

                _PLITSOrderDetail.Rewind();
                while (!_PLITSOrderDetail.EOF)
                {
                    _PLITSOrderDetail.OrderID = or.ID;

                    _PLITSOrderDetail.MoveNext();
                }
                _PLITSOrderDetail.Save();

                hcmisorderid = or.ID;
                //this.LogActivity("Save-Requisition", ord.ID);
                mgr.CommitTransaction();

            }
            catch (Exception exp)
            {
                mgr.RollbackTransaction();
                return 0;
                throw (exp);
            }
            //ResetOrder();
            return hcmisorderid;
        }
        //~ This Method is Obsoleted ~//
        public static bool SaveBackOrderToDatabase(BLL.Order _order)
        {
            var _orderDetail = new OrderDetail();
            _orderDetail.LoadAllByOrderID(_order.ID);

            MyGeneration.dOOdads.TransactionMgr mgr = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr();
            try
            {
                mgr.BeginTransaction();
                var or = new BLL.Order();

                or.AddNew();
                or.RefNo = Order.GetNextOrderReference();
                or.SetColumn("OrderTypeID", _order.GetColumn("OrderTypeID"));
                or.SetColumn("HCTSReferenceID", _order.GetColumn("HCTSReferenceID"));

                or.OrderStatusID = OrderStatus.Constant.DRAFT_WISHLIST;
                or.RequisitionTypeID = RequisitionType.CONSTANTS.DEMAND;
                or.Remark = _order.ID.ToString(); //Store the Original ID here for the backorder.  We need to have a standard way of marking backorders.

                or.EurDate = or.Date = DateTimeHelper.ServerDateTime; //Both fields are assigned dates.
                or.RequestedBy = _order.RequestedBy;
                or.FilledBy = _order.FilledBy;
                or.LetterNo = _order.LetterNo;
                or.PaymentTypeID = _order.PaymentTypeID;
                or.ContactPerson = _order.ContactPerson;
                or.FromStore = _order.FromStore;
                or.FiscalYearID = FiscalYear.Current.ID;
                or.OrderTypeID = _order.OrderTypeID == OrderType.CONSTANTS.PLITS
                                     ? _order.OrderTypeID
                                     : OrderType.CONSTANTS.BACK_ORDER;

                or.Save();
                or.LogRequisitionStatus(or.ID,null,OrderStatus.Constant.DRAFT_WISHLIST,CurrentContext.UserId);
                _orderDetail.Rewind();
                var orderDetail = new OrderDetail();

                while (!_orderDetail.EOF)
                {
                    if (_orderDetail.ApprovedQuantity >= _orderDetail.Quantity)
                    {
                        _orderDetail.MoveNext();
                        continue; //Backorder is only for those with approved quantity less than the requested quantity.
                    }
                    orderDetail.AddNew();
                    orderDetail.ItemID = _orderDetail.ItemID;
                    orderDetail.OrderID = or.ID;
                    orderDetail.Pack = (_orderDetail.Quantity - _orderDetail.ApprovedQuantity) /
                                       _orderDetail.QtyPerPack;
                    orderDetail.QtyPerPack = _orderDetail.QtyPerPack;
                    orderDetail.Quantity = orderDetail.Pack * orderDetail.QtyPerPack;
                    orderDetail.SetColumn("HACTOrderDetailID", _orderDetail.GetColumn("HACTOrderDetailID"));
                    orderDetail.UnitID = _orderDetail.UnitID;

                    _orderDetail.MoveNext();
                }

                orderDetail.Save();
                mgr.CommitTransaction();
                return true;
            }
            catch (Exception exp)
            {
                mgr.RollbackTransaction();
                return false;
            }
        }
 /// <summary>
 /// Formats the cash invoice.
 /// </summary>
 /// <param name="ord">The ord.</param>
 /// <param name="dvPriced">The dv priced.</param>
 /// <param name="rus">The rus.</param>
 /// <param name="pl">The pl.</param>
 /// <param name="deliveryNote">if set to <c>true</c> [delivery note].</param>
 /// <param name="allowCancelByUser">if set to <c>true</c> [allow cancel by user].</param>
 /// <exception cref="System.Exception"></exception>
 private XtraReport FormatCashInvoice_Smaller(Order ord, DataTable dvPriced, BLL.Institution rus, PickList pl, bool deliveryNote, string printerName, HCMIS.Core.Distribution.Services.PrintLogService pLogService)
 {
     string activityName = txtConfirmFromStore.Text;
     bool hasInsurnance = chkIncludeInsurance.Checked;
     return WorkflowReportFactory.CreateCashInvoiceSmaller(ord, dvPriced, rus, pl, deliveryNote, hasInsurnance, activityName);
 }
 private void AddNewReceiveDoc(BLL.ReceiveDoc rec, int receiptID, DataRowView dr, bool isDamaged = false)
 {
     rec.AddNew();
     FillInReceiveDocInformation(rec, receiptID, dr);
     SavePalletization(rec, dr);
     if (isDamaged)
     {
         HandleReceiveDocShortage(dr, rec, rec.ID);
     }
 }
 private XtraReport FormatCashRePrintInvoice_Smaller(Order ord, DataTable dvPriced, BLL.Institution rus, PickList pl, bool deliveryNote, string printerName, HCMIS.Core.Distribution.Services.PrintLogService pLogService, int? stvLogID)
 {
     string activityName = "";
     bool hasInsurnance = includeInsurance;
     return WorkflowReportFactory.CreateCashReprintInvoiceSmaller(ord, dvPriced, rus, pl, deliveryNote, hasInsurnance, activityName, _stvLogIdChosen);
 }
예제 #26
0
 private static void Set_KartaKontrolna_InitValues(SPListItem newItem, BLL.Models.Klient k)
 {
     newItem["enumRozliczeniePD"] = k.RozliczeniePD;
     newItem["enumRozliczenieVAT"] = k.RozliczenieVAT;
     newItem["colFormaOpodatkowaniaPD"] = k.FormaOpodatkowaniaPD;
     newItem["colFormaOpodatkowaniaVAT"] = k.FormaOpodatkowaniaVAT;
     newItem["colFormaOpodakowania_ZUS"] = k.FormaOpodatkowaniaZUS;
     newItem["colVAT_TerminZwrotuPodatku"] = string.Empty;
     newItem["colZatrudniaPracownikow"] = k.ZatrudniaPracownikow;
 }
예제 #27
0
        private static int Create_KartaKontrolna(SPWeb web, int klientId, int okresId, BLL.Models.Klient iok, string KEY)
        {
            Debug.WriteLine("BLL.tabKartyKontrolne.Create_KartaKontrolna");

            SPListItem newItem = web.Lists.TryGetList(targetList).Items.Add();
            newItem["KEY"] = KEY;
            newItem["selKlient"] = klientId;
            newItem["selOkres"] = okresId;

            Set_KartaKontrolna_InitValues(newItem, iok);

            //ustaw CT
            if (iok.TypKlienta == "KSH") newItem["ContentType"] = "Karta kontrolna KSH";
            else newItem["ContentType"] = "Karta kontrolna KPiR";

            newItem.SystemUpdate();
            return newItem.ID;
        }
예제 #28
0
        private bool Generuj_DrukPD_FromZUS(SPWeb web, SPListItem item, int klientId, string okres, double kwota, string konto, string fileName, string odbiorca, string numerDeklaracji, string symbolFormularza, string identyfikatorZobowiazania, BLL.Models.Klient iok)
        {
            bool result = false;

            konto = Clean_NumerRachunku(konto);

            string nadawca = iok.NazwaFirmy + " " + iok.Adres + " " + iok.KodPocztowy + " " + iok.Miejscowosc;
            nadawca = nadawca.ToUpper();
            string nip = iok.NIP;
            string typIdentyfikatora = "N";

            if (konto.Length == 26 && kwota > 0 && !string.IsNullOrEmpty(fileName))
            {
                result = GeneratorDrukow.DrukWplaty.Attach_DrukWplatyPD(web, item,
                fileName,
                odbiorca,
                konto,
                kwota,
                nadawca,
                nip,
                typIdentyfikatora,
                numerDeklaracji, //15M07
                symbolFormularza, //PIT4R
                identyfikatorZobowiazania //POD.DOCH.ZA PRAC.
                );
            }
            return result;
        }
예제 #29
0
        public static void AddNew_FakturaDoZaplaty(SPWeb web, BLL.Models.FakturaDoZaplaty faktura, BLL.Models.BiuroRachunkowe biuroRachunkowe, bool KopiaDoNadawcy, bool KopiaDoBiura, string temat, string tresc, string trescHTML, string attachementUrl, bool drukWplatyWymagany, DateTime planowanaDataNadania, int klientId)
        {
            Debug.WriteLine("AddNew_FakturaDoZaplaty");

            SPList list = web.Lists.TryGetList(targetList);
            SPListItem newItem = list.AddItem();
            newItem["Title"] = temat;

            string nadawca = faktura.EmailNadawcy;
            if (string.IsNullOrEmpty(nadawca)) nadawca = BLL.admSetup.GetValue(web, "EMAIL_BIURA");

            newItem["colNadawca"] = nadawca;
            newItem["colOdbiorca"] = faktura.EmailOdbiorcy;
            //newItem["colKopiaDla"] = string.Empty;
            newItem["colTresc"] = tresc;
            newItem["colTrescHTML"] = trescHTML;
            if (!string.IsNullOrEmpty(planowanaDataNadania.ToString()) && planowanaDataNadania != new DateTime())
            {
                newItem["colPlanowanaDataNadania"] = planowanaDataNadania.ToString();
            }
            newItem["colKopiaDoNadawcy"] = KopiaDoNadawcy;
            newItem["colKopiaDoBiura"] = KopiaDoBiura;

            if (klientId > 0) newItem["selKlient_NazwaSkrocona"] = klientId;


            //dodanie obrazu faktury PDF do wiadomości
            if (!string.IsNullOrEmpty(attachementUrl))
            {
                SPFile file = web.GetFile(attachementUrl);
                if (file.Exists) Copy_Attachement(newItem, file);
            }

            newItem.Update();

            //dodanie druku wpłaty do wiadomości
            if (drukWplatyWymagany)
            {
                Debug.WriteLine("DW wymagany");
                string fileName = String.Format(@"{0}do faktury_{1}.pdf", targetFileNameLeading, faktura.NumerFaktury);


                //string odbiorca = admSetup.GetValue(web, "BR_NAZWA");
                string odbiorca = BLL.admSetup.Get_NazwaBiura(web);
                string numerFaktury = faktura.NumerFaktury;
                string tytulem = String.Format("Zapłata za {0}", numerFaktury);

                if (GeneratorDrukow.DrukWplaty.Attach_DrukWplaty(web,
                                                                newItem,
                                                                fileName,
                                                                odbiorca,
                                                                biuroRachunkowe.Konto,
                                                                faktura.WartoscDoZaplaty,
                                                                faktura.NazwaKlienta,
                                                                tytulem))
                {
                    Debug.WriteLine("DW załączony");
                }
                else
                {
                    Debug.WriteLine("ERR: DW nie załączony");
                    ElasticEmail.EmailGenerator.SendMail("ERR: DW nie dołączony do wiadomości: " + newItem.ID, "");
                }
            }

            faktura.Wyslana = true;
        }
예제 #30
0
 public MainWindow()
 {
     InitializeComponent();
     BLL_ = new BLL.BLL();
 }
        private XtraReport FormatCashRePrintInvoice(Order ord, DataTable dvPriced, BLL.Institution rus, PickList pl, bool deliveryNote, string printerName, HCMIS.Core.Distribution.Services.PrintLogService pLogService, int? stvLogID)
        {
            if (BLL.Settings.UseSmallerCashPrintout)
            {
                return FormatCashRePrintInvoice_Smaller(ord, dvPriced, rus, pl, deliveryNote, printerName, pLogService, _stvLogIdChosen);
            }

            return FormatCashRePrintInvoice_Larger(ord, dvPriced, rus, pl, deliveryNote, printerName, pLogService, _stvLogIdChosen);
        }
예제 #32
0
        private void Manage_RBR(SPWeb web, BLL.Models.FakturaDoZaplaty faktura, BLL.Models.BiuroRachunkowe biuroRachunkowe)
        {
            int klientId = faktura.KlientId;

            if (klientId > 0)
            {
                string nadawca = faktura.EmailNadawcy;
                string odbiorca = faktura.EmailOdbiorcy;

                bool KopiaDoNadawcy = false;
                bool KopiaDoBiura = true;
                string temat = string.Empty;
                string tresc = string.Empty;
                string trescHTML = string.Empty;

                BLL.dicSzablonyKomunikacji.Get_TemplateByKod(web, "RBR_TEMPLATE.Include", out temat, out trescHTML, nadawca);

                temat = temat + " - " + faktura.NumerFaktury;

                string lt = BLL.dicSzablonyKomunikacji.Get_TemplateByKod(web, "RBR_LEADING_TEXT", false);
                string firma = BLL.tabKlienci.Get_NazwaFirmyById(web, klientId);
                lt = lt.Replace("___FIRMA___", firma);
                string okres = faktura.Okres;
                lt = lt.Replace("___OKRES___", okres);
                trescHTML = trescHTML.Replace("___RBR_LEADING_TEXT___", lt);

                //uzupełnia temat kodem klienta, numerem okresu i numerem faktury
                //temat = AddSpecyfikacja(item, temat, string.Empty);

                //uzupełnia dane w formatce BR_TEMPLATE
                StringBuilder sb = new StringBuilder(trescHTML);
                sb.Replace("___colBR_NumerFaktury___", faktura.NumerFaktury);
                sb.Replace("___colBR_DataWystawienia___", BLL.Tools.Format_Date(faktura.DataWystawieniaFaktury));
                sb.Replace("___colBR_WartoscDoZaplaty___", BLL.Tools.Format_Currency(faktura.WartoscDoZaplaty));
                sb.Replace("___colBR_Konto___", BLL.Tools.Format_Konto(biuroRachunkowe.Konto));
                sb.Replace("___colBR_TerminPlatnosci___", BLL.Tools.Format_Date(faktura.TerminPlatnosci));

                string info2 = string.Empty;
                string info = faktura.InformacjaDlaKlienta;

                //dodaj informację o z załącznikach w/g ustawionych flag
                if (faktura.FakturaPDF_Exist())
                {
                    info2 = info2 + string.Format(templateR, "Faktura za usługi biura rachunkowego");
                }
                if (faktura.DrukWplatyWymagany)
                {
                    info2 = info2 + string.Format(templateR, "Druk wpłaty");
                }

                if (!string.IsNullOrEmpty(info2))
                {
                    info2 = string.Format(templateH, info2);
                    info = info + info2;
                }

                sb.Replace("___colInformacjaDlaKlienta___", info);

                trescHTML = sb.ToString();

                planowanaDataNadania = DateTime.Now.AddMinutes(30);

                BLL.tabWiadomosci.AddNew_FakturaDoZaplaty(web, faktura, biuroRachunkowe, KopiaDoNadawcy, KopiaDoBiura, temat, tresc, trescHTML, faktura.FakturaPDF_Url, faktura.DrukWplatyWymagany, planowanaDataNadania, klientId);

                #region Obsługa remindera
                ////obsługa remindera
                //if (hasPrzypomnienieOTerminiePlatnosci(item))
                //{
                //    KopiaDoNadawcy = false;
                //    KopiaDoBiura = false;

                //    DateTime terminPlatnosci = Get_Date(item, "colBR_TerminPlatnosci");


                //    if (GetValue(item, "colBR_WartoscDoZaplaty") > 0)
                //    {
                //        //ustaw reminder
                //        nadawca = BLL.admSetup.GetValue(item.Web, "EMAIL_BIURA");
                //        BLL.dicSzablonyKomunikacji.Get_TemplateByKod(item, "RBR_REMINDER_TEMPLATE.Include", out temat, out trescHTML, nadawca);
                //        temat = Update_Data(temat, terminPlatnosci);
                //        temat = BLL.Tools.AddCompanyName(temat, item);

                //        //leading reminder text
                //        string lrt = BLL.dicSzablonyKomunikacji.Get_TemplateByKod(item, "RBR_LEADING_REMINDER_TEXT", false);
                //        lrt = lrt.Replace("___FIRMA___", firma);
                //        lrt = lrt.Replace("___OKRES___", okres);
                //        trescHTML = trescHTML.Replace("___RBR_LEADING_REMINDER_TEXT___", lrt);

                //        //trailing reminder text
                //        string trt = BLL.dicSzablonyKomunikacji.Get_TemplateByKod(item, "RBR_TRAILING_REMINDER_TEXT", false);
                //        trt = trt.Replace("___DATA___", DateTime.Now.ToShortDateString()); //zakłada że wysyłka oryginalnej wiadomości wyjdzie w dniu zlecenia
                //        trescHTML = trescHTML.Replace("___RBR_TRAILING_REMINDER_TEXT___", trt);

                //        //aktualizacja danych z tabelki
                //        sb = new StringBuilder(trescHTML);
                //        sb.Replace("___colBR_NumerFaktury___", item["colBR_NumerFaktury"] != null ? item["colBR_NumerFaktury"].ToString() : string.Empty);
                //        sb.Replace("___colBR_DataWystawienia___", Format_Date(item, "colBR_DataWystawieniaFaktury"));
                //        sb.Replace("___colBR_WartoscDoZaplaty___", Format_Currency(item, "colBR_WartoscDoZaplaty"));
                //        sb.Replace("___colBR_Konto___", item["colBR_Konto"] != null ? item["colBR_Konto"].ToString() : string.Empty);
                //        sb.Replace("___colBR_TerminPlatnosci___", Format_Date(item, "colBR_TerminPlatnosci"));

                //        trescHTML = sb.ToString();

                //        planowanaDataNadania = Calc_ReminderTime(item, terminPlatnosci);


                //        BLL.tabWiadomosci.AddNew(item.Web, item, nadawca, odbiorca, kopiaDla, KopiaDoNadawcy, KopiaDoBiura, temat, tresc, trescHTML, planowanaDataNadania, item.ID, klientId, Marker.Ignore);
                //    }

                //} 
                #endregion
            }
        }
        /// <summary>
        /// Formats the credit invoice.
        /// </summary>
        /// <param name="ord">The ord.</param>
        /// <param name="dvPriced">The dv priced.</param>
        /// <param name="rus">The rus.</param>
        /// <param name="pl">The pl.</param>
        /// <param name="deliveryNote">if set to <c>true</c> [delivery note].</param>
        /// <param name="allowCancelByUser">if set to <c>true</c> [allow cancel by user].</param>
        /// <exception cref="System.Exception"></exception>
        private XtraReport FormatCreditInvoice(Order ord, DataTable dvPriced, BLL.Institution rus, PickList pl, bool deliveryNote, string printerName, HCMIS.Core.Distribution.Services.PrintLogService pLogService)
        {
            if (BLL.Settings.UseSmallerCreditPrintout)
            {
                return FormatCreditInvoice_Smaller(dvPriced, ord, pl, rus, deliveryNote, printerName, pLogService);
            }

                return FormatCreditInvoice_Larger(dvPriced, ord, pl, rus, deliveryNote, printerName, pLogService);
        }
 public void UpdateInvoiceRelatedHeaders(BLL.ReceiptInvoice rctInvoice)
 {
     this.LoadByReceiptInvoiceID(rctInvoice.ID);
     if (this.RowCount > 0)
     {
         while (!this.EOF)
         {
             this.STVOrInvoiceNo = rctInvoice.STVOrInvoiceNo;
             this.WayBillNo = rctInvoice.WayBillNo;
             this.InsurancePolicyNo = rctInvoice.InsurancePolicyNo;
             this.MoveNext();
         }
         this.Save();
     }
 }