예제 #1
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            PersianDateFormatter pdf        = new PersianDateFormatter();
            int             date            = pdf.convert(toolStripTextBox1.Text);
            OtherRepository otherRepository = new OtherRepository();

            radGridView1.DataSource = otherRepository.getCustomerJoinContract(date);
        }
        private void CustomerPaymentsForm_Load(object sender, EventArgs e)
        {
            OtherRepository repo = new OtherRepository();

            radGridView1.DataSource = repo.getCustomersPayment();
            radGridView1.GridViewElement.PagingPanelElement.RightToLeft       = true;
            ((GridTableElement)radGridView1.TableElement).AlternatingRowColor = Color.FromArgb(215, 234, 124);
            radGridView1.TableElement.RowHeight = 35;
            saveFileDialog1.FileName            = "export";
            saveFileDialog1.Filter = "xlsx files (*.xlsx)|*.xlsx|All files (*.*)|*.*";
        }
예제 #3
0
        private void toolStripbNext_Click(object sender, EventArgs e)
        {
            PersianDateFormatter pdf = new PersianDateFormatter();
            DateTime             dt  = DateTime.Now;

            dayCounter++;
            dt = dt.AddDays(dayCounter);
            toolStripTextBox1.Text = pdf.getDateString(dt);
            OtherRepository otherRepository = new OtherRepository();

            radGridView1.DataSource = otherRepository.getCustomerJoinContract(dt);
        }
예제 #4
0
        private void EasyAccounting_Load(object sender, EventArgs e)
        {
            PersianDateFormatter pdf = new PersianDateFormatter();

            toolStripTextBox1.Text = pdf.getDateString(DateTime.Now);
            ((GridTableElement)radGridView1.TableElement).AlternatingRowColor = Color.FromArgb(215, 234, 124);
            radGridView1.TableElement.RowHeight = 50;
            OtherRepository otherRepository = new OtherRepository();

            radGridView1.DataSource = otherRepository.getCustomerJoinContract(DateTime.Now);
            timer1.Start();



            //GsmCommMain comm = new GsmCommMain("COM8", 9600, 150);
            //comm.Open();
            //byte dcs = (byte)DataCodingScheme.GeneralCoding.Alpha16Bit;
            //SmsSubmitPdu pdu = new SmsSubmitPdu("امین", "09398987855", dcs);
            //comm.SendMessage(pdu);
        }
 public ComponentsController(
     CPUWatercoolerRepository cpuWatercoolerRepository,
     FanRepository fanRepository,
     GraphicsCardRepository graphicsCardRepository,
     HardDriveRepository hardDriveRepository,
     MotherboardRepository motherboardRepository,
     OtherRepository otherRepository,
     PCCaseRepository pcCaseRepository,
     PowerSupplyRepository powerSupplyRepository,
     ProcessorRepository processorRepository,
     RAMRepository ramRepository)
 {
     this._cpuWatercoolerRepository = cpuWatercoolerRepository;
     this._fanRepository            = fanRepository;
     this._graphicsCardRepository   = graphicsCardRepository;
     this._hardDriveRepository      = hardDriveRepository;
     this._motherboardRepository    = motherboardRepository;
     this._otherRepository          = otherRepository;
     this._pcCaseRepository         = pcCaseRepository;
     this._powerSupplyRepository    = powerSupplyRepository;
     this._processorRepository      = processorRepository;
     this._ramRepository            = ramRepository;
 }
예제 #6
0
 public ActionResult getBranch(string hub_code)
 {
     return(Json(OtherRepository.GetAllBranches(hub_code).OrderBy(a => a.branch_name), JsonRequestBehavior.AllowGet));
 }
예제 #7
0
 // GET: UserAccounts
 public ActionResult Index()
 {
     ViewBag.hub_code = new SelectList(OtherRepository.GetAllHub().OrderBy(a => a.hub_name), "hub_code", "hub_name");
     return(View());
 }
예제 #8
0
    public string LoadLogo()
    {
        OtherRepository otherRepo = new OtherRepository();

        return(otherRepo.GetOtherByCode("Logo").Other_Content);
    }
예제 #9
0
 public PublicDataRepository(OtherRepository repository)
 {
     Repository = repository;
 }
예제 #10
0
 private void toolStripButton1_Click(object sender, EventArgs e)
 {
     PersianDateFormatter pdf = new PersianDateFormatter();
     int date = pdf.convert(toolStripTextBox1.Text);
     OtherRepository otherRepository = new OtherRepository();
     radGridView1.DataSource = otherRepository.getCustomerJoinContract(date);
 }
예제 #11
0
 private void toolStripbNext_Click(object sender, EventArgs e)
 {
     PersianDateFormatter pdf = new PersianDateFormatter();
     DateTime dt = DateTime.Now;
     dayCounter++;
     dt = dt.AddDays(dayCounter);
     toolStripTextBox1.Text = pdf.getDateString(dt);
     OtherRepository otherRepository = new OtherRepository();
     radGridView1.DataSource = otherRepository.getCustomerJoinContract(dt);
 }
 private void CustomerPaymentsForm_Load(object sender, EventArgs e)
 {
     OtherRepository repo = new OtherRepository();
     radGridView1.DataSource = repo.getCustomersPayment();
     radGridView1.GridViewElement.PagingPanelElement.RightToLeft = true;
     ((GridTableElement)radGridView1.TableElement).AlternatingRowColor = Color.FromArgb(215, 234, 124);
     radGridView1.TableElement.RowHeight = 35;
     saveFileDialog1.FileName = "export";
     saveFileDialog1.Filter = "xlsx files (*.xlsx)|*.xlsx|All files (*.*)|*.*";
 }
예제 #13
0
        private void EasyAccounting_Load(object sender, EventArgs e)
        {
            PersianDateFormatter pdf = new PersianDateFormatter();
            toolStripTextBox1.Text = pdf.getDateString(DateTime.Now);
            ((GridTableElement)radGridView1.TableElement).AlternatingRowColor = Color.FromArgb(215, 234, 124);
            radGridView1.TableElement.RowHeight = 50;
            OtherRepository otherRepository = new OtherRepository();
            radGridView1.DataSource = otherRepository.getCustomerJoinContract(DateTime.Now);
            timer1.Start();

            //GsmCommMain comm = new GsmCommMain("COM8", 9600, 150);
            //comm.Open();
            //byte dcs = (byte)DataCodingScheme.GeneralCoding.Alpha16Bit;
            //SmsSubmitPdu pdu = new SmsSubmitPdu("امین", "09398987855", dcs);
            //comm.SendMessage(pdu);
        }
예제 #14
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            PersianDateFormatter pdf        = new PersianDateFormatter();
            int             date            = pdf.convert(toolStripTextBox1.Text);
            OtherRepository otherRepository = new OtherRepository();

            radGridView1.DataSource = otherRepository.getCustomerJoinContract(date);


            /////////////////////////////////////////////////
            DefaultSettingsRepository dRepo    = new DefaultSettingsRepository();
            DefaultSetting            gsmPort  = dRepo.GetSetting("gsm_port");
            DefaultSetting            lastSend = dRepo.GetSetting("last_send");

            if (lastSend == null)
            {
                DefaultSetting ls = new DefaultSetting();
                ls.Value = "13000101";
                ls.Name  = "last_send";
                dRepo.AddSettings(ls);
            }
            else
            {
                int lastSendInt = Convert.ToInt32(lastSend.Value);
                int todayInt    = pdf.getDateInteger(DateTime.Now);
                int x           = 0;
                if (todayInt <= lastSendInt)
                {
                    return;
                }
            }



            if (gsmPort != null)
            {
                if (gsmPort.Value != "NULL")
                {
                    try
                    {
                        GsmCommMain comm = new GsmCommMain(gsmPort.Value, 9600, 150);
                        comm.Open();
                        byte dcs = (byte)DataCodingScheme.GeneralCoding.Alpha16Bit;

                        DefaultSetting sendTime    = dRepo.GetSetting("send_message_time");
                        DefaultSetting days        = dRepo.GetSetting("days_before_send");
                        DefaultSetting text        = dRepo.GetSetting("message_text");
                        int            daysInteger = Convert.ToInt32(days.Value);

                        TimeSpan ts      = TimeSpan.Parse(sendTime.Value);
                        TimeSpan nts     = DateTime.Now.TimeOfDay;
                        TimeSpan fivemin = TimeSpan.FromMinutes(5);

                        if (nts.CompareTo(ts) >= 0)
                        {
                            if (nts.Subtract(ts).CompareTo(fivemin) > 0)
                            {
                                return;
                            }
                        }
                        else
                        {
                            if (ts.Subtract(nts).CompareTo(fivemin) > 0)
                            {
                                return;
                            }
                        }

                        DateTime dt = DateTime.Now;
                        dt = dt.AddDays(daysInteger);
                        string dateString = pdf.getDateString(dt);

                        object customers = otherRepository.getCustomerJoinContract(dt);

                        IEnumerable <object> collection = (IEnumerable <object>)customers;
                        foreach (object item in collection)
                        {
                            var nameOfProperty = "PhoneNumber";
                            var propertyInfo   = item.GetType().GetProperty(nameOfProperty);
                            var phoneNumber    = propertyInfo.GetValue(item, null);


                            var nameOfProperty2 = "Time";
                            var propertyInfo2   = item.GetType().GetProperty(nameOfProperty2);
                            var time            = propertyInfo2.GetValue(item, null);

                            string timeString = time.ToString();
                            timeString = timeString.Remove(timeString.Length - 3);

                            string smsText = text.Value + Environment.NewLine + dateString + Environment.NewLine + timeString;

                            SmsSubmitPdu pdu = new SmsSubmitPdu(smsText, phoneNumber.ToString(), dcs);
                            comm.SendMessage(pdu);
                        }

                        DefaultSettingsRepository dRepo2 = new DefaultSettingsRepository();
                        DefaultSetting            lsls   = dRepo2.GetSetting("last_send");
                        lsls.Value = pdf.getDateInteger(DateTime.Now).ToString();
                        dRepo2.UpdateSetting(lsls);
                    }
                    catch (Exception ex)
                    {
                    }
                }
            }
        }
예제 #15
0
 public OthersController(OtherRepository repository)
 {
     this._repository = repository;
 }
예제 #16
0
 private void bShowChart_Click(object sender, EventArgs e)
 {
     if (cDropDownMonth.Enabled == true)
     {
         radChartView1.Series.Clear();
         radChartView1.Axes.Clear();
         int              monthInteger   = Convert.ToInt32(cDropDownMonth.SelectedValue.ToString());
         int              year           = Convert.ToInt32(numericUpDown1.Value);
         OtherRepository  repo           = new OtherRepository();
         List <DayReport> list           = repo.getGroupByDay(year, monthInteger);
         CartesianSeries  series         = new LineSeries();
         CategoricalAxis  horizontalAxis = new CategoricalAxis();
         horizontalAxis.PlotMode = AxisPlotMode.OnTicksPadded;
         LinearAxis verticalAxis = new LinearAxis();
         verticalAxis.AxisType = AxisType.Second;
         series.PointSize      = new SizeF(5, 5);
         series.HorizontalAxis = horizontalAxis;
         series.VerticalAxis   = verticalAxis;
         series.BorderWidth    = 3;
         series.BorderColor    = Color.SkyBlue;
         series.CategoryMember = "Day";
         series.ValueMember    = "Income";
         series.DataSource     = list;
         series.ShowLabels     = true;
         this.radChartView1.Series.Add(series);
     }
     else if (comboBox1.SelectedIndex == 1)
     {
         radChartView1.Series.Clear();
         radChartView1.Axes.Clear();
         int                monthInteger   = Convert.ToInt32(cDropDownMonth.SelectedValue.ToString());
         int                year           = Convert.ToInt32(numericUpDown1.Value);
         OtherRepository    repo           = new OtherRepository();
         List <MonthReport> list           = repo.getGroupByMonth(year);
         CartesianSeries    series         = new LineSeries();
         CategoricalAxis    horizontalAxis = new CategoricalAxis();
         horizontalAxis.PlotMode = AxisPlotMode.OnTicksPadded;
         LinearAxis verticalAxis = new LinearAxis();
         verticalAxis.AxisType = AxisType.Second;
         series.PointSize      = new SizeF(5, 5);
         series.HorizontalAxis = horizontalAxis;
         series.VerticalAxis   = verticalAxis;
         series.BorderWidth    = 3;
         series.BorderColor    = Color.SkyBlue;
         series.CategoryMember = "Month";
         series.ValueMember    = "Income";
         series.DataSource     = list;
         series.ShowLabels     = true;
         this.radChartView1.Series.Add(series);
     }
     else
     {
         radChartView1.Series.Clear();
         radChartView1.Axes.Clear();
         int               monthInteger   = Convert.ToInt32(cDropDownMonth.SelectedValue.ToString());
         int               year           = Convert.ToInt32(numericUpDown1.Value);
         OtherRepository   repo           = new OtherRepository();
         List <YearReport> list           = repo.getGroupByYear();
         CartesianSeries   series         = new LineSeries();
         CategoricalAxis   horizontalAxis = new CategoricalAxis();
         horizontalAxis.PlotMode = AxisPlotMode.OnTicksPadded;
         LinearAxis verticalAxis = new LinearAxis();
         verticalAxis.AxisType = AxisType.Second;
         series.PointSize      = new SizeF(5, 5);
         series.HorizontalAxis = horizontalAxis;
         series.VerticalAxis   = verticalAxis;
         series.BorderWidth    = 3;
         series.BorderColor    = Color.SkyBlue;
         series.CategoryMember = "Year";
         series.ValueMember    = "Income";
         series.DataSource     = list;
         series.ShowLabels     = true;
         this.radChartView1.Series.Add(series);
     }
 }
예제 #17
0
    public string LoadSDT()
    {
        OtherRepository otherRepo = new OtherRepository();

        return(otherRepo.GetOtherByCode("Hotline").Other_Content);
    }
예제 #18
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            PersianDateFormatter pdf = new PersianDateFormatter();
            int date = pdf.convert(toolStripTextBox1.Text);
            OtherRepository otherRepository = new OtherRepository();
            radGridView1.DataSource = otherRepository.getCustomerJoinContract(date);

            /////////////////////////////////////////////////
            DefaultSettingsRepository dRepo = new DefaultSettingsRepository();
            DefaultSetting gsmPort = dRepo.GetSetting("gsm_port");
            DefaultSetting lastSend = dRepo.GetSetting("last_send");

            if (lastSend == null)
            {
                DefaultSetting ls = new DefaultSetting();
                ls.Value = "13000101";
                ls.Name = "last_send";
                dRepo.AddSettings(ls);
            }
            else
            {
                int lastSendInt = Convert.ToInt32(lastSend.Value);
                int todayInt = pdf.getDateInteger(DateTime.Now);
                int x = 0;
                if (todayInt <= lastSendInt)
                {
                    return;
                }
            }

            if (gsmPort != null)
            {

                if (gsmPort.Value != "NULL")
                {
                    try
                    {
                        GsmCommMain comm = new GsmCommMain(gsmPort.Value, 9600, 150);
                        comm.Open();
                        byte dcs = (byte)DataCodingScheme.GeneralCoding.Alpha16Bit;

                        DefaultSetting sendTime = dRepo.GetSetting("send_message_time");
                        DefaultSetting days = dRepo.GetSetting("days_before_send");
                        DefaultSetting text = dRepo.GetSetting("message_text");
                        int daysInteger = Convert.ToInt32(days.Value);

                        TimeSpan ts = TimeSpan.Parse(sendTime.Value);
                        TimeSpan nts = DateTime.Now.TimeOfDay;
                        TimeSpan fivemin = TimeSpan.FromMinutes(5);

                        if (nts.CompareTo(ts) >= 0)
                        {
                            if (nts.Subtract(ts).CompareTo(fivemin) > 0)
                            {
                                return;
                            }
                        }
                        else
                        {
                            if (ts.Subtract(nts).CompareTo(fivemin) > 0)
                            {
                                return;
                            }
                        }

                        DateTime dt = DateTime.Now;
                        dt = dt.AddDays(daysInteger);
                        string dateString = pdf.getDateString(dt);

                        object customers = otherRepository.getCustomerJoinContract(dt);

                        IEnumerable<object> collection = (IEnumerable<object>)customers;
                        foreach (object item in collection)
                        {
                            var nameOfProperty = "PhoneNumber";
                            var propertyInfo = item.GetType().GetProperty(nameOfProperty);
                            var phoneNumber = propertyInfo.GetValue(item, null);

                            var nameOfProperty2 = "Time";
                            var propertyInfo2 = item.GetType().GetProperty(nameOfProperty2);
                            var time = propertyInfo2.GetValue(item, null);

                            string timeString = time.ToString();
                            timeString = timeString.Remove(timeString.Length-3);

                            string smsText = text.Value + Environment.NewLine + dateString + Environment.NewLine + timeString;

                            SmsSubmitPdu pdu = new SmsSubmitPdu(smsText, phoneNumber.ToString(), dcs);
                            comm.SendMessage(pdu);
                        }

                        DefaultSettingsRepository dRepo2 = new DefaultSettingsRepository();
                        DefaultSetting lsls =  dRepo2.GetSetting("last_send");
                        lsls.Value = pdf.getDateInteger(DateTime.Now).ToString();
                        dRepo2.UpdateSetting(lsls);

                    }
                    catch (Exception ex)
                    {

                    }
                }
            }
        }