예제 #1
0
        const float DAMAGE_RANGE = 0.2f; // 100 damage -> 90 ~ 110 damage

        #endregion Fields

        #region Constructors

        public Unit(
            Type type,
            int owner,
            Basic.Vec2Int pos,
            int hpMax,
            int hpCurrent,
            int damage,
            int defence,
            int mobility,
            int initiative,
            int shootRange,
            bool isWaited)
        {
            this.Type_ = type;
            this.Owner = owner;
            this.Pos = pos;
            this.HpMax = hpMax;
            this.HpCurrent = hpCurrent;
            this.Damage = damage;
            this.Defence = defence;
            this.Movility = mobility;
            this.Initiative = initiative;
            this.ShootRange = shootRange;
            this.isWaited = isWaited;
        }
예제 #2
0
    public Monster( string name, int level, bool isBoss, GameObject characterObject)
        : base(name, level, level * 12)
    {
        Speed = 0;

        BasicAttack	  = new Basic();
        StrongAttack  = new Strong();
        SpecialAttack = new Special();

        BasicDefend   = new Basic();
        StrongDefend  = new Strong();
        SpecialDefend = new Special();

        CharacterObject = characterObject;

        Monster _thisMonster = this;
        IsBoss = isBoss;

        if (isBoss)
        {
            Health.SetNewMaxValue(Health.MaxValue * 3);
            AIBehavior = new BossAIBehavior(ref _thisMonster);
        }
        else
        {
            AIBehavior = new MinionAIBehavior(ref _thisMonster);
        }
    }
        public static List<Basic.Vec2Int> Neibors(Basic.Vec2Int pos, Basic.Vec2Int size)
        {
            var acc = new List<Basic.Vec2Int>(8);
            var yMin = System.Math.Max(pos.y - 1, 0);
            var yMax = System.Math.Min(pos.y + 1, size.y - 1);
            var xMin = System.Math.Max(pos.x - 1, 0);
            var xMax = System.Math.Min(pos.x + 1, size.x - 1);

            for (int y = yMin; y <= yMax; y++)
            {
                for (int x = xMin; x <= xMax; x++)
                {
                    if (x == pos.x && y == pos.y)
                    {
                        continue;
                    }
                    else
                    {
                        acc.Add(new Basic.Vec2Int(x, y));
                    }
                }
            }

            return acc;
        }
        public static Unit Construct(Unit.Type type, int owner, Basic.Vec2Int pos)
        {
            var unit = StatusTable(type);
            unit.Owner = owner;
            unit.Pos = pos;

            return unit;
        }
예제 #5
0
 public MainForm()
 {
     InitializeComponent();
     Csql = new Sql();
     B = new Basic();
     TasksBs = new BindingSource();
     TasksBs.PositionChanged += new EventHandler(TasksBs_PositionChanged);
     CheckedTask = new SortedList();
 }
예제 #6
0
        public taskLists(Point MainFormCurrentLocation)
        {
            InitializeComponent();
            ListBs = new BindingSource();
            ListBs.PositionChanged += new EventHandler(ListBs_PositionChanged);

            B = new Basic();

            mainFormLocation = MainFormCurrentLocation;
        }
예제 #7
0
        public CustomShellType(Basic basicSetting,
                               MainCode mainCodeSetting)
        {
            _shellTypeName = basicSetting.ShellTypeName;
            _basicSetting = basicSetting;
            _mainCodeSetting = mainCodeSetting;

            //初始化方法树
            _funcTreeRoot = new FuncTreeNode(_shellTypeName);
        }
예제 #8
0
        /// <summary>
        /// Run Statement
        /// </summary>
        /// <param name="BasicIntrepeter">Basic Intrepeter that called the Statement</param>
        public override void ExcecuteStatement(Basic BasicIntrepeter)
        {
            double ComparisonResult = 0F;
            bool openParenthis = false;

            BasicIntrepeter.CodeParser.Expect(typeof(WhileToken));

            // Alow the usage of parenthis like C language
            if (typeof(LeftParenToken).Equals(BasicIntrepeter.CodeParser.CurrentToken.GetType()))
            {
                BasicIntrepeter.CodeParser.Expect(typeof(LeftParenToken));
                openParenthis = true;
            }

            // Get comparison result
            ComparisonResult = BasicIntrepeter.NumericModifier.ExpressionLevel3();

            // If we had an opening parenthis we expect a closing one
            if (openParenthis)
                BasicIntrepeter.CodeParser.Expect(typeof(RightParenToken));

            // Check comparison result
            if (ComparisonResult < 1.0F)
            {
                // False -> Goto WEND and continue processing from there
                SearchForWEND();
            }
            else
            {
                // True -> Add to WHILE Stack

                // Search for earlier WHILE statement
                int NegativeOffset = 0;
                while (true)
                {
                    if (Parser.Program[Parser.ProgramPosition - NegativeOffset].GetType().Equals(typeof(WhileToken)))
                        break;
                    NegativeOffset++;
                }

                // Store WHILE position on stack
                if (BasicIntrepeter.WHILEStackPosition < (BasicIntrepeter.WHILEStack.Length - 1))
                {
                    BasicIntrepeter.WHILEStack[BasicIntrepeter.WHILEStackPosition] = Parser.ProgramPosition - NegativeOffset;
                    BasicIntrepeter.WHILEStackPosition++;
                }
                else
                    throw new MFBasic.Exceptions.BasicLanguageException(MFBasic.Exceptions.BasicLanguageException.WHILE_STACK_EXHAUSTED);

                // Find start of next line
                while (!BasicIntrepeter.CodeParser.CurrentToken.GetType().Equals(typeof(EndOfLineToken)) && !BasicIntrepeter.CodeParser.CurrentToken.GetType().Equals(typeof(EndOfInputToken)))
                    BasicIntrepeter.CodeParser.Next();

            }
        }
예제 #9
0
 /// <summary>
 /// Run Statement
 /// </summary>
 /// <param name="BasicIntrepeter">Basic Intrepeter that called the Statement</param>
 public override void ExcecuteStatement(Basic BasicIntrepeter)
 {
     BasicIntrepeter.CodeParser.Expect(typeof(WendToken));
     if (BasicIntrepeter.WHILEStackPosition > 0)
     {
         BasicIntrepeter.WHILEStackPosition--;
         Parser.ProgramPosition = BasicIntrepeter.WHILEStack[BasicIntrepeter.WHILEStackPosition];
     }
     else
     {
         throw new MFBasic.Exceptions.BasicLanguageException(MFBasic.Exceptions.BasicLanguageException.WEND_WITHOUT_WHILE);
     }
 }
 public TBGActionAttackMelee(int playerOwner, int unitIndex,
     BoardGame.BoardPath path,
     int damage,
     int targetUnitIndex,
     Basic.Vec2Int targetUnitPos,
     bool isTargetDead)
     : base(playerOwner, unitIndex)
 {
     _path = path;
     _damage = damage;
     _targetUnitIndex = targetUnitIndex;
     _targetUnitPos = targetUnitPos;
     _isTargetDead = isTargetDead;
 }
예제 #11
0
        public override string GetStringResult(Basic BasicIntrepeter)
        {
            String Input = "";
            BasicIntrepeter.CodeParser.Expect(typeof(ToUpper__Token));
            BasicIntrepeter.CodeParser.Expect(typeof(LeftParenToken));

            if (BasicIntrepeter.StringModifier.isString())
                Input = BasicIntrepeter.StringModifier.Value();
            else
                BasicIntrepeter.CodeParser.Expect(typeof(StringToken));

            BasicIntrepeter.CodeParser.Expect(typeof(RightParenToken));

            return Input.ToUpper();
        }
 public TBGActionAttackRanged(int playerOwner, int unitIndex,
     Basic.Vec2Int posFrom,
     int damage,
     int targetUnitIndex,
     Basic.Vec2Int targetUnitPos,
     bool isFullDamage,
     bool isTargetDead)
     : base(playerOwner, unitIndex)
 {
     _posFrom = posFrom;
     _damage = damage;
     _targetUnitIndex = targetUnitIndex;
     _targetUnitPos = targetUnitPos;
     _isFullDamage = isFullDamage;
     _isTargetDead = isTargetDead;
 }
예제 #13
0
        public override string GetStringResult(Basic BasicIntrepeter)
        {
            byte Input = 0;

            BasicIntrepeter.CodeParser.Expect(typeof(Chr__Token));

            if (BasicIntrepeter.CodeParser.CurrentToken.GetType().Equals(typeof(LeftParenToken)))
            {
                Input = (byte) System.Math.Floor(BasicIntrepeter.NumericModifier.Value());
            }
            else
            {
                BasicIntrepeter.CodeParser.Expect(typeof(LeftParenToken));
            }

            return new String(new char[] { (char)Input });
        }
예제 #14
0
		public RandomAI(Game game, String name)
			: base(game, name)
		{
			_PlayerType = PlayerType.Computer;

			IEnumerable<Type> aiTypes = Assembly.GetExecutingAssembly().GetTypes().Where(x => 
				(x == typeof(Basic) || x.IsSubclassOf(typeof(Basic))) && 
				game.Settings.RandomAI_AllowedAIs.Contains(x.FullName) &&
				(!game.Settings.RandomAI_Unique || !game.Players.Any(p => 
					p.GetType() == x || (p.GetType() == typeof(RandomAI) && ((RandomAI)p).ActualPlayer.GetType() == x))));

			if (aiTypes.Count() == 0)
				throw new GameCreationException(String.Format("Cannot find a fitting AI to choose for Random!{0}Please check your game settings and verify that there are enough AIs to choose from", System.Environment.NewLine));

			Type aiType = Utilities.Shuffler.Choose(aiTypes.ToList());
			this.ActualPlayer = (Basic)aiType.GetConstructor(new Type[] { typeof(Game), typeof(String), typeof(Player) }).Invoke(new object[] { game, name + " (R)", this });
		}
        public void Init(Basic.Vec2Int pos, Basic.Vec2Int targetPos, System.Func<Basic.Vec2Int, Vector3> fnConvertPos)
        {
            image = GetComponent<Image>();

            // start
            var rotateY = -45f;
            var vec = targetPos - pos;
            var degree = Mathf.Atan2(vec.y, vec.x) * Mathf.Rad2Deg;

            var gridSize = fnConvertPos(new Basic.Vec2Int(1, 1));

            this.transform.eulerAngles -= new Vector3(0f, rotateY + degree, 0f);

            var vec3Fixed = new Vector3(vec.x * 0.1f, 0f, vec.y * 0.1f);
            var pos3 = fnConvertPos(pos);
            pos3.y = HEIGHT;

            start = pos3 - vec3Fixed;
            end = pos3 + vec3Fixed;

            StartCoroutine(CoFadeInAndMove());
        }
        AttackDirectionController AttackDirectionImageCreate(Basic.Vec2Int pos, Basic.Vec2Int posTarget)
        {
            var target = (GameObject)Instantiate(ResourceManager.Instance.LoadUI(Define.Path.UI.AttackDirection));
            var posAdd = ConvertBoardToWorldPos(pos);
            target.transform.position = new Vector3(posAdd.x, 0.3f, posAdd.z);
            target.transform.SetParent(worldCanvas.transform);

            var controller = target.GetComponent<AttackDirectionController>();
            controller.Init(pos, posTarget, ConvertBoardToWorldPos);

            return controller;
        }
 Vector3 ConvertBoardToWorldPos(Basic.Vec2Int pos)
 {
     return ConvertBoardToWorldPos(pos, 0f);
 }
예제 #18
0
 public static Unit Create(Type type, int owner, Basic.Vec2Int pos)
 {
     return new Unit(type, owner, pos, 0, 0, 0, 0, 3, 0, DEFAULT_RANGE, false);
 }
예제 #19
0
 /// <summary>
 /// 細かくパラメータ調整
 /// </summary>
 public static Unit CreateForDebug(
     Type type,
     int owner,
     Basic.Vec2Int pos,
     int hpMax,
     int hpCurrent,
     int damage,
     int defence,
     int mobility,
     int initiative,
     int shootRange,
     bool isWaited)
 {
     return new Unit(
         type,
         owner,
         pos,
         hpMax,
         hpCurrent,
         damage,
         defence,
         mobility,
         initiative,
         shootRange,
         isWaited);
 }
예제 #20
0
        //주석을 풀고 사용하세요
        /*****************************************************************************/

        #region 팝업컨테이너 에티트의 컨트롤 바인딩
        /// <summary>
        /// 팝업컨테이너 에티트의 컨트롤 바인딩
        /// </summary>
        /// <param name="popedit">The popedit.</param>
        /// <param name="gridName">Name of the grid.</param>
        /// <param name="gridViewName">Name of the grid view.</param>
        private void SetAddressSchma(DevExpress.XtraEditors.PopupContainerEdit popedit,
                                     string gridName,
                                     string gridViewName)
        {
            try
            {
                if (lupFacilitySelect.EditValue.ToString() == "")
                {
                    return;
                }
                DevExpress.XtraGrid.GridControl         grid     = new DevExpress.XtraGrid.GridControl();
                DevExpress.XtraGrid.Views.Grid.GridView gridView = new DevExpress.XtraGrid.Views.Grid.GridView();

                grid.Name     = gridName;
                gridView.Name = gridViewName;

                DataTable dtBiz = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                dtBiz.Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                dtBiz.Rows.Add(new object[] { "V_FACILITY_CODE", lupFacilitySelect.EditValue });
                DataSet dsTmp = DataLayer.ExecuteSpDataset("PKG_DAAAI18.PR_01", dtBiz, DataLayer.MessageEncoding.Default);

                Cls.GroupByHelper.DataSetHelper group = new Cls.GroupByHelper.DataSetHelper();


                //조회 영업장을 셋팅한다.
                //LookUp.SetFillCode(this.lupFacilitySelect, group.SelectGroupByInto("MyTable" ,  dsTmp.Tables[0], "FACILITY_CODE , FACILITY_NAME","", "FACILITY_CODE , FACILITY_NAME") , "FACILITY_NAME", "FACILITY_CODE" , LookUp.CaptoinStyle.SelectText);
                //this.lupFacilitySelect.ItemIndex = 1;

                /*
                 *  dsTmp.Tables[0].Columns.Add("FACILITY_CODE"   );
                 *  dsTmp.Tables[0].Columns.Add("FACILITY_NAME"   );
                 *  dsTmp.Tables[0].Columns.Add("ROOM_TYPE"       );
                 *  dsTmp.Tables[0].Columns.Add("ROOM_TYPE_NAME"  );
                 */
                GridStyle gs = new GridStyle(grid, gridView);
                gs.AddColumn("업장코드", "FACILITY_CODE", _ColumnType.Default, 80, _ColumnAlign.Center, true);
                gs.AddColumn("영업장명", "FACILITY_NAME", _ColumnType.Default, 80, _ColumnAlign.Center, true);
                gs.AddColumn("객실유형", "ROOM_TYPE", _ColumnType.Default, 80, _ColumnAlign.Center, true);
                gs.AddColumn("유형명칭", "ROOM_TYPE_NAME", _ColumnType.Default, 80, _ColumnAlign.Center, true);

                Cls.Grid.Options.SelectedRow(gridView);
                Cls.Grid.Options.EmbeddedNavigater(grid);
                Cls.Grid.Options.FilterRow(gridView, true);
                grid.DataSource = dsTmp.Tables[0];

                //Cls.Grid.Options.SetColumnColor(gridView,
                //                                StyleFormatConditionType.Column,
                //                                this.gridView.Columns["FACILITY_CODE"], FormatConditionEnum.GreaterOrEqual,
                //                                Color.Goldenrod,
                //                                null);


                //Cls.Grid.Options.SetColumnColor(gridView,
                //                                StyleFormatConditionType.Column,
                //                                this.gridView.Columns["ROOM_TYPE"],
                //                                FormatConditionEnum.GreaterOrEqual,
                //                                Color.Goldenrod,
                //                                null);


                Cls.Common.uPopupContainer.AddPopupGridControl("product",
                                                               new System.Drawing.Size(500, 350),
                                                               popedit,
                                                               "선택하세요",
                                                               grid,
                                                               gridView, DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor);

                gridView.KeyDown     += new System.Windows.Forms.KeyEventHandler(PopupGridview_KeyDown);
                gridView.DoubleClick += new System.EventHandler(PopupGridview_DoubleClick);
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
        }
예제 #21
0
 public UploadAlbumResult(UploadResultCollection images, Basic<AlbumCreateData> albumCreateResults)
 {
     Images = images;
     Results = albumCreateResults;
 }
예제 #22
0
        /// <summary>
        /// 프린터 버튼 클릭 이벤트
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnPrint_Click(object sender, EventArgs e)
        {
            try
            {
                if (dt.Rows.Count <= 0)
                {
                    Basic.ShowMessage(1, "출력할 데이터가 없습니다.");
                    return;
                }

                if (Basic.ShowMessageQuestion("출력하시겠습니까?") == DialogResult.No)
                {
                    return;
                }
                Basic.SetCursor(this, false);
                XtraReportsBase.DxReport.XtraPreviewForm f = new XtraReportsBase.DxReport.XtraPreviewForm();

                if (f != null && f.IsHandleCreated)
                {
                    f.Activate();
                    return;
                }

                DataTable dtTmp = new DataTable("dtWhere");
                dtTmp.Columns.Add("MEMBER_NO");
                dtTmp.Columns.Add("SALE_INLOTCNT");
                dtTmp.Columns.Add("COMMODITY_CODE");
                dtTmp.Columns.Add("GUEST_TYPE");

                string MemberNo      = this.txtMemberNoSelect.Text.Trim() == "" ? "*전체" : txtMemberNoSelect.Text.Trim();
                string SaleInLotCnt  = this.lupSaleInLotCntSelect.EditValue.ToString() == "" ? "*전체" : lupSaleInLotCntSelect.Text;
                string CommodityCode = this.lupCommodityCodeSelect.EditValue.ToString() == "" ? "*전체" : lupCommodityCodeSelect.Text;
                string GuestType     = this.lupGuesttypeSelect.EditValue.ToString() == "" ? "*전체" : lupGuesttypeSelect.Text;

                dtTmp.Rows.Add(new object[] { MemberNo,
                                              SaleInLotCnt,
                                              CommodityCode,
                                              GuestType });

                //필터링된 데이터를 담는다.
                DataTable dtFilter = Cls.Grid.Options.GetGridData(this.grid);

                DataSet dsTemp = new DataSet("xsd_ALRAS01");
                dsTemp.Tables.AddRange(new DataTable[] { dtFilter, dtTmp });
                //dsTemp.WriteXmlSchema(@"c:\xsd_ALRAS01.xsd");
                //return;

                f = new XtraReportsBase.DxReport.XtraPreviewForm();
                DevExpress.XtraReports.UI.XtraReport rpt = new Erp.SubdivisionSale.ALRA.Report.ALRAP01();
                f.ShowReport(dsTemp, rpt);
                f.Show();
            }

            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }

            finally
            {
                Basic.SetCursor(this, true);
            }
        }
예제 #23
0
 public UploadImageResult(QueuedImage img, Basic<UploadData> result)
 {
     Image = img;
     Result = result;
 }
 /// <summary>
 /// Please put {id: 2, name: 'abc', color: 'Magenta'}
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='complexBody'>
 /// Please put {id: 2, name: 'abc', color: 'Magenta'}
 /// </param>
 public static void PutValid(this IBasicOperations operations, Basic complexBody)
 {
     operations.PutValidAsync(complexBody).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Please put {id: 2, name: 'abc', color: 'Magenta'}
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='complexBody'>
 /// Please put {id: 2, name: 'abc', color: 'Magenta'}
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task PutValidAsync(this IBasicOperations operations, Basic complexBody, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.PutValidWithHttpMessagesAsync(complexBody, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
예제 #26
0
        private void btnAccountDelete_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                if (dtDetail.Rows.Count <= 0)
                {
                    return;
                }
                else if (this.gridViewMaster.FocusedRowHandle < 0)
                {
                    return;
                }

                string code       = this.gridViewMaster.GetRowCellValue(this.gridViewMaster.FocusedRowHandle, "CODE").ToString().Trim();
                string Write_date = this.gridViewMaster.GetRowCellValue(this.gridViewMaster.FocusedRowHandle, "WRITE_DATE").ToString().Trim();

                /*체크한다.*/
                string sql = @"  SELECT COUNT(DOCU_STAT) AS CNT FROM AUTODOCU 
		                                 WHERE 
				                                DATA_GUBUN = '85'           AND
				                                DATA_NO    = {0}            AND  
				                                WRITE_DATE = '{1}'          AND
				                                DEPT_CODE  = '002020102000' AND
				                                NODE_CODE  = '1000'         AND
				                                C_CODE     = '1000'         AND
				                                DOCU_STAT  = 1"                ;



                string sqldel = @"  DELETE FROM AUTODOCU 
		                                 WHERE 
				                                DATA_GUBUN = '85'           AND
				                                DATA_NO    = {0}            AND  
				                                WRITE_DATE = '{1}'          AND
				                                DEPT_CODE  = '002020102000' AND
				                                NODE_CODE  = '1000'         AND
				                                C_CODE     = '1000'         "                ;


                /*카운터가 0 보다 크면 삭제 불가
                 * 0이면 삭제가능
                 */
                sql    = string.Format(sql, code, Write_date);
                sqldel = string.Format(sqldel, code, Write_date);

                string sql2 = "DELETE " + sql;

                System.Data.SqlClient.SqlDataAdapter ad = new System.Data.SqlClient.SqlDataAdapter(sql, SQLConnectString);
                DataTable dtCnt = new DataTable();

                ad.Fill(dtCnt);

                if (int.Parse(dtCnt.Rows[0][0].ToString().Trim()) > 0)
                {
                    Basic.ShowMessage(1, "이미 전표처리되어 삭제할 수 없습니다.");
                    return;
                }


                using (System.Data.SqlClient.SqlConnection cn = new System.Data.SqlClient.SqlConnection(SQLConnectString))
                {
                    try
                    {
                        cn.Open();
                    }
                    catch (System.Data.SqlClient.SqlException sqlex)
                    {
                        Basic.ShowMessage(3, sqlex.Message);
                        cn.Dispose();
                        return;
                    }

                    System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand(sqldel, cn);

                    int row = cmd.ExecuteNonQuery();

                    if (row > 0)
                    {
                        Basic.ShowMessage(1, "삭제 하였습니다.");
                        CHK_MK("D_MK");
                        InvokeOnClick(this.btnSelect, new EventArgs());
                    }
                    else
                    {
                        Basic.ShowMessage(1, "삭제할 전표가 없습니다.");
                    }

                    if (cn.State == ConnectionState.Open)
                    {
                        cn.Close();
                    }

                    cn.Dispose();
                }
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
예제 #27
0
        /// <summary>
        /// 전표생성을 눌렀을경우
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void btnAccount_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                if (dtDetail.Rows.Count <= 0)
                {
                    return;
                }
                else if (this.gridViewMaster.FocusedRowHandle < 0)
                {
                    return;
                }

                string code       = this.gridViewMaster.GetRowCellValue(this.gridViewMaster.FocusedRowHandle, "CODE").ToString().Trim();
                string Write_date = this.gridViewMaster.GetRowCellValue(this.gridViewMaster.FocusedRowHandle, "WRITE_DATE").ToString().Trim();

                if (CHK_MK("CHK") == "Y")
                {
                    return;
                }


                /*기 전표 생성여부체크*/
                /*삭제시 WHERE 조건동일사용*/
                string SQL_CHECK_BILL = @"SELECT COUNT(BAN_DECI_DATE) AS CNT
	                                            FROM AUTODOCU 
		                                             WHERE 
				                                            DATA_GUBUN = '85'          AND
				                                            DATA_NO    =  {0}          AND  
				                                            WRITE_DATE = '{1}'         AND
				                                            DEPT_CODE = '002020102000' AND
				                                            NODE_CODE = '1000'         AND
				                                            C_CODE = '1000'"                ;

                /*{0} = 구분코드 {1} = 일자*/

                /*있으면
                 * 전표삭제후 재생성 해야 합니다.
                 */

                SQL_CHECK_BILL = string.Format(SQL_CHECK_BILL, code, Write_date);

                System.Data.SqlClient.SqlDataAdapter ad = new System.Data.SqlClient.SqlDataAdapter(SQL_CHECK_BILL, SQLConnectString);
                DataTable dtCnt = new DataTable();

                ad.Fill(dtCnt);

                if (int.Parse(dtCnt.Rows[0][0].ToString().Trim()) > 0)
                {
                    Basic.ShowMessage(1, "기 생성된 전표가 존재 합니다.\n\r전표삭제 후 재생성 해야 합니다.");
                    return;
                }


                string Query = @"INSERT INTO AUTODOCU
                                                      ( DATA_GUBUN,
                                                        WRITE_DATE,
                                                        DATA_NO,
                                                        DATA_LINE,
                                                        DATA_SLIP,
                                                        DEPT_CODE,
                                                        NODE_CODE,
                                                        C_CODE,
                                                        DATA_CODE,
                                                        DOCU_STAT,
                                                        DOCU_TYPE,
                                                        DOCU_GUBUN,
                                                        AMT_GUBUN,
                                                        DR_AMT,
                                                        CR_AMT,
                                                        ACCT_CODE,
                                                        CHECK_CODE1,
                                                        CHECK_CODE2,
                                                        CHECK_CODE3,
                                                        CHECK_CODE4,
                                                        CHECKD_CODE1,
                                                        CHECKD_CODE2,
                                                        CHECKD_CODE3,
                                                        CHECKD_CODE4,
                                                        CHECKD_NAME1,
                                                        CHECKD_NAME2,
                                                        CHECKD_NAME3,
                                                        CHECKD_NAME4
                                                      ) 
                                                        VALUES ('{0}' , 
                                                                '{1}' ,
                                                                 {2}  ,
                                                                 {3}  ,
                                                                 {4}  ,
                                                                '{5}' ,
                                                                '{6}' ,
                                                                '{7}' ,
                                                                '{8}' ,
                                                                '{9}' ,
                                                                '{10}' ,
                                                                '{11}' ,
                                                                '{12}' ,
                                                                 {13}  ,
                                                                 {14}  ,
                                                                '{15}' ,
                                                                '{16}' ,
                                                                '{17}' ,
                                                                '{18}' ,
                                                                '{19}' ,
                                                                '{20}' ,
                                                                '{21}' ,
                                                                '{22}' ,
                                                                '{23}' ,
                                                                '{24}' ,
                                                                '{25}' ,
                                                                '{26}' ,
                                                                '{27}' 
                                                                )";


                using (System.Transactions.TransactionScope scope = new System.Transactions.TransactionScope())
                {
                    using (System.Data.SqlClient.SqlConnection cn = new System.Data.SqlClient.SqlConnection(SQLConnectString))
                    {
                        try
                        {
                            cn.Open();
                        }
                        catch (System.Data.SqlClient.SqlException sqlex)
                        {
                            Basic.ShowMessage(3, sqlex.Message);
                            cn.Dispose();
                            return;
                        }

                        this.pgb.Visible            = true;
                        this.pgb.Properties.Maximum = dtDetail.Rows.Count - 1;
                        this.pgb.Properties.Minimum = 0;
                        this.pgb.EditValue          = 0;


                        for (int i = 0; i < dtDetail.Rows.Count; i++)
                        {
                            this.pgb.EditValue = i;
                            Application.DoEvents();

                            object[] obj = new object[28];
                            for (int j = 0; j < obj.Length; j++)
                            {
                                obj[j] = dtDetail.Rows[i][j].ToString().Trim();
                            }

                            string insertQuery = string.Format(Query, obj);

                            using (System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand(insertQuery, cn))
                            {
                                int row = cmd.ExecuteNonQuery();
                                cmd.Dispose();
                            }
                        }

                        string Query_In = @"INSERT INTO ONKET_ID
                                            SELECT '1000' C_CODE, CHECKD_CODE2, CHECKD_NAME2, '20101101' aS JOB_DATE FROM AUTODOCU
                                            WHERE DATA_GUBUN = '85'           
                                              AND DATA_NO    = {0}           
                                              AND WRITE_DATE = '{1}'     
                                              AND DEPT_CODE  = '002020102000' 
                                              AND NODE_CODE  = '1000'         
                                              AND C_CODE     = '1000'         
                                              AND CHECK_CODE2 = 'M57'
                                              AND CHECKD_CODE2 <> '999999'
                                              AND CHECKD_CODE2 NOT IN (SELECT ID_CODE FROM ONKET_ID WHERE C_CODE = '1000')";
                        Query_In = string.Format(Query_In, code, Write_date);

                        using (System.Data.SqlClient.SqlCommand cmd1 = new System.Data.SqlClient.SqlCommand(Query_In, cn))
                        {
                            int row1 = cmd1.ExecuteNonQuery();
                            cmd1.Dispose();
                        }

                        CHK_MK("C_MK");

                        Basic.ShowMessage(1, "생성 하였습니다.");



                        if (cn.State == ConnectionState.Open)
                        {
                            cn.Close();
                        }

                        cn.Dispose();
                    }

                    scope.Complete();
                    scope.Dispose();
                }
                InvokeOnClick(this.btnSelect, new EventArgs());
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
            finally
            {
                this.pgb.Visible = false;
                this.Cursor      = Cursors.Default;
            }
        }
예제 #28
0
        /// <summary>
        /// 조회를 눌렀을 경우
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void btnSelect_Click(object sender, EventArgs e)
        {
            try
            {
                /*원래 조회시 마스터에 해당되는 항목을 가져와 다시 바인딩 해야되지만
                 * 현재 빠져 있어 상수값으로 대체 한다.
                 * 추후 이동인차장이 추가 하기로 하였음
                 */
                this.Cursor = Cursors.WaitCursor;
                dtDetail.Clear();
                dtMaster.Clear();

                string fromDate = Basic.MaskReplace(this.dtpFrom.Text.ToString().Trim());//((System.DateTime)this.dtpFrom.EditValue).ToString("yyyMMdd");

                string sql = @"SELECT  WRITE_DATE, DATA_NO AS CODE, 
                                       CASE DATA_NO WHEN 200 THEN '입금'
                                                    WHEN 300 THEN '전환'
                                                    WHEN 900 THEN '해약'
                                        END AS GUBUN,
                                        CASE SIGN(COUNT(*)) WHEN 0 THEN '전표미발생'
                                         ELSE
                                              '전표발생'
                                        END AS CODE_NAME
                                  FROM AUTODOCU
                                WHERE 
	                                DATA_GUBUN = '85'          AND
	                                WRITE_DATE = '{0}'         AND
	                                DEPT_CODE = '002020102000' AND
	                                NODE_CODE = '1000'         AND
	                                C_CODE = '1000'
	                                GROUP BY WRITE_DATE, DATA_NO "    ;
                sql = string.Format(sql, fromDate);

                System.Data.SqlClient.SqlDataAdapter ad = new System.Data.SqlClient.SqlDataAdapter(sql, SQLConnectString);
                DataTable msCnt = new DataTable();

                ad.Fill(msCnt);

                dtMaster.Load(msCnt.CreateDataReader());


                int i200 = int.Parse(dtMaster.Compute("COUNT(CODE)", "CODE = '200'").ToString().Trim());
                int i300 = int.Parse(dtMaster.Compute("COUNT(CODE)", "CODE = '300'").ToString().Trim());
                int i900 = int.Parse(dtMaster.Compute("COUNT(CODE)", "CODE = '900'").ToString().Trim());

                if (i200 <= 0)
                {
                    dtMaster.Rows.Add(fromDate, "200", "입금", "전표미발생");
                }
                if (i300 <= 0)
                {
                    dtMaster.Rows.Add(fromDate, "300", "전환", "전표미발생");
                }
                if (i900 <= 0)
                {
                    dtMaster.Rows.Add(fromDate, "900", "해약", "전표미발생");
                }
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
예제 #29
0
 public void AssertBlobCopyPropertiesMatch(string containerName, string blobName, Basic.Azure.Storage.Communications.BlobService.BlobOperations.GetBlobPropertiesResponse response)
 {
     AssertBlobCopyPropertiesMatch(containerName, blobName, response.CopyStatus, response.CopyProgress, response.CopyCompletionTime, response.CopyStatusDescription, response.CopyId, response.CopySource);
 }
예제 #30
0
        /// <summary>
        /// Please put {id: 2, name: 'abc', color: 'Magenta'}
        /// </summary>
        /// <param name='complexBody'>
        /// Please put {id: 2, name: 'abc', color: 'Magenta'}
        /// </param>
        /// <param name='customHeaders'>
        /// Headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        /// <exception cref="ValidationException">
        /// Thrown when a required parameter is null
        /// </exception>
        /// <return>
        /// A response object containing the response body and response headers.
        /// </return>
        public async Task <AzureOperationResponse> PutValidWithHttpMessagesAsync(Basic complexBody, Dictionary <string, List <string> > customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (complexBody == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "complexBody");
            }
            string apiVersion = "2016-02-29";
            // Tracing
            bool   _shouldTrace  = ServiceClientTracing.IsEnabled;
            string _invocationId = null;

            if (_shouldTrace)
            {
                _invocationId = ServiceClientTracing.NextInvocationId.ToString();
                Dictionary <string, object> tracingParameters = new Dictionary <string, object>();
                tracingParameters.Add("complexBody", complexBody);
                tracingParameters.Add("apiVersion", apiVersion);
                tracingParameters.Add("cancellationToken", cancellationToken);
                ServiceClientTracing.Enter(_invocationId, this, "PutValid", tracingParameters);
            }
            // Construct URL
            var           _baseUrl         = this.Client.BaseUri.AbsoluteUri;
            var           _url             = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "complex/basic/valid").ToString();
            List <string> _queryParameters = new List <string>();

            if (apiVersion != null)
            {
                _queryParameters.Add(string.Format("api-version={0}", Uri.EscapeDataString(apiVersion)));
            }
            if (_queryParameters.Count > 0)
            {
                _url += "?" + string.Join("&", _queryParameters);
            }
            // Create HTTP transport objects
            HttpRequestMessage  _httpRequest  = new HttpRequestMessage();
            HttpResponseMessage _httpResponse = null;

            _httpRequest.Method     = new HttpMethod("PUT");
            _httpRequest.RequestUri = new Uri(_url);
            // Set Headers
            if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value)
            {
                _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", Guid.NewGuid().ToString());
            }
            if (this.Client.AcceptLanguage != null)
            {
                if (_httpRequest.Headers.Contains("accept-language"))
                {
                    _httpRequest.Headers.Remove("accept-language");
                }
                _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage);
            }
            if (customHeaders != null)
            {
                foreach (var _header in customHeaders)
                {
                    if (_httpRequest.Headers.Contains(_header.Key))
                    {
                        _httpRequest.Headers.Remove(_header.Key);
                    }
                    _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
                }
            }

            // Serialize Request
            string _requestContent = null;

            if (complexBody != null)
            {
                _requestContent      = SafeJsonConvert.SerializeObject(complexBody, this.Client.SerializationSettings);
                _httpRequest.Content = new StringContent(_requestContent, Encoding.UTF8);
                _httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
            }
            // Set Credentials
            if (this.Client.Credentials != null)
            {
                cancellationToken.ThrowIfCancellationRequested();
                await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
            }
            // Send Request
            if (_shouldTrace)
            {
                ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
            }
            cancellationToken.ThrowIfCancellationRequested();
            _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);

            if (_shouldTrace)
            {
                ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
            }
            HttpStatusCode _statusCode = _httpResponse.StatusCode;

            cancellationToken.ThrowIfCancellationRequested();
            string _responseContent = null;

            if ((int)_statusCode != 200)
            {
                var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
                try
                {
                    _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);

                    Error _errorBody = SafeJsonConvert.DeserializeObject <Error>(_responseContent, this.Client.DeserializationSettings);
                    if (_errorBody != null)
                    {
                        ex.Body = _errorBody;
                    }
                }
                catch (JsonException)
                {
                    // Ignore the exception
                }
                ex.Request  = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
                ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
                if (_shouldTrace)
                {
                    ServiceClientTracing.Error(_invocationId, ex);
                }
                _httpRequest.Dispose();
                if (_httpResponse != null)
                {
                    _httpResponse.Dispose();
                }
                throw ex;
            }
            // Create Result
            var _result = new AzureOperationResponse();

            _result.Request  = _httpRequest;
            _result.Response = _httpResponse;
            if (_httpResponse.Headers.Contains("x-ms-request-id"))
            {
                _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
            }
            if (_shouldTrace)
            {
                ServiceClientTracing.Exit(_invocationId, _result);
            }
            return(_result);
        }
예제 #31
0
        /// <summary>
        /// 삭제 함수
        /// </summary>
        private void Deletes()
        {
            try
            {
                ///TDDO:[템플릿]삭제
                ///
                //유효성 검사후 실행합니다.
                if (!ISCheckData(JobStyle.DELETE))
                {
                    return;
                }
                Basic.SetCursor(this, false);
                Basic.LoadParentFunction(this, "삭제 중 입니다..", true);

                string orgfacilitycode = this.gridView.GetRowCellValue(this.gridView.FocusedRowHandle, "FACILITY_CODE").ToString().Trim();
                string orgroomtype     = this.gridView.GetRowCellValue(this.gridView.FocusedRowHandle, "ROOM_TYPE").ToString().Trim();
                string orgroomview     = this.gridView.GetRowCellValue(this.gridView.FocusedRowHandle, "ROOM_VIEW").ToString().Trim();

                //삭제함수를 구현합니다.
                //만약 변수가 필요없다면 아래 코드를 삭제 하세요
                DataTable dtparmDelete = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                dtparmDelete.Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                dtparmDelete.Rows.Add(new object[] { "V_FACILITY_CODE", orgfacilitycode });
                dtparmDelete.Rows.Add(new object[] { "V_ROOM_TYPE", orgroomtype });
                dtparmDelete.Rows.Add(new object[] { "V_ROOM_VIEW", orgroomview });

                //프로시져를 호출하여 결과를 리턴 받는다.
                //만약 output 값이 여러개라면 '|' (파이프) 값으로 구분하여 들어온다.
                //Split 함수로 짤라서 사용한다.
                string Result = DataLayer.ExecuteSpScala("PKG_DAAAI18.PR_05", dtparmDelete, DataLayer.MessageEncoding.Default);

                //프로시져 에러라면 빠져나간다.
                if (Result.Trim() != "OK")
                {
                    Basic.ShowMessage(3, Result);
                    return;
                }

                int row = this.gridView.FocusedRowHandle;

                //삭제한 데이터를 조회 를 합니다...
                Selects(false);


                if (this.gridView.RowCount > 0)
                {
                    if (row <= this.gridView.RowCount - 1)
                    {
                        this.gridView.FocusedRowHandle = row;
                    }
                    else
                    {
                        this.gridView.FocusedRowHandle = gridView.RowCount - 1;
                    }
                }

                Basic.ShowMessage(1, "삭제 하였습니다.");
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
            finally
            {
                Basic.SetCursor(this, true);
                Basic.LoadParentFunction(this, "", false);
            }
        }
예제 #32
0
        private void bill_Print_Card(string outSeq, string _strBillNo)
        {
            try
            {
                string strBizCode = Parm.CurrentUserInformation.BizInfo.BizCode;

                DataSet ds = null;

                DataTable dtParm = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                dtParm.Rows.Add(new object[] { "V_SALE_DATE", PayInfo.RoomInfo.C_Taskdate });
                dtParm.Rows.Add(new object[] { "V_BIZ_CODE", PayInfo.RoomInfo.C_Bizcode });
                dtParm.Rows.Add(new object[] { "V_FACILITY_CODE", PayInfo.RoomInfo.CO_Facilitycode });
                dtParm.Rows.Add(new object[] { "V_POS_NO", "01" });
                dtParm.Rows.Add(new object[] { "V_BILL_NO", _strBillNo });
                dtParm.Rows.Add(new object[] { "V_AGREE_YN", "Y" });
                dtParm.Rows.Add(new object[] { "V_PAY_SEQ", outSeq });

                ds = DataLayer.ExecuteSpDataset("PKG_DAZAZ02.PR_CARD_SELECT", dtParm, DataLayer.MessageEncoding.Default);

                DataTable dtCard = new DataTable("dtCard");
                dtCard.Load(ds.Tables[0].CreateDataReader());

                DataTable dtTitle = new DataTable("dtTitle");

                dtTitle.Columns.Add("ROOM_NO");
                dtTitle.Columns.Add("GUEST_NAME");
                dtTitle.Columns.Add("AMT", typeof(decimal));
                dtTitle.Columns.Add("CHECKOUT_DATE");
                dtTitle.Columns.Add("ROOM_TYPE");
                dtTitle.Columns.Add("MEMBER_NO");
                dtTitle.Columns.Add("MOBILE_TEL");
                dtTitle.Columns.Add("CHECKIN_DATE");

                DataSet dst = null;

                DataTable dtParmT = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                dtParmT.Rows.Add(new object[] { "V_MNG_NO", PayInfo.RoomInfo.C_Mngno });
                dtParmT.Rows.Add(new object[] { "V_MNG_SEQ", PayInfo.RoomInfo.C_Mngseq });
                dtParmT.Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                dtParmT.Rows.Add(new object[] { "V_FACILITY_CODE", Parm.CurrentUserInformation.roomTask.gsDFacility });

                if (strBizCode == "20")
                {
                    dst = DataLayer.ExecuteSpDataset("PKG_DAHAH23.PR_04", dtParmT, DataLayer.MessageEncoding.Default);
                }
                else
                {
                    dst = DataLayer.ExecuteSpDataset("PKG_DAHDH23.PR_04", dtParmT, DataLayer.MessageEncoding.Default);
                }

                dtTitle.Clear();
                dtTitle.Load(dst.Tables[0].CreateDataReader());

                #region 레포트이용
                if (Parm.CurrentUserInformation.roomTask.gsPrintMode == PrintMode.DRIVER)
                {
                    // 신용카드영수증 출력
                    DevExpress.XtraReports.UI.XtraReport rpt = null;

                    if (Parm.CurrentUserInformation.BizInfo.BizCode == "22141")
                    {
                    }
                    else
                    {
                        rpt = new Erp.Room.DAHA.Report.DAHAP23_03();
                    }

                    DataTable dttmp = new DataTable();
                    dttmp.Columns.Add("PRINT_YN");
                    dttmp.Columns.Add("BIZ_CODE");
                    dttmp.Columns.Add("MNG_NO");
                    dttmp.Columns.Add("MNG_SEQ", typeof(decimal));
                    dttmp.Columns.Add("TASK_DATE");
                    dttmp.Columns.Add("KEY_SEQ", typeof(decimal));
                    dttmp.Columns.Add("CARD_NO");
                    dttmp.Columns.Add("RAISE_CODE_NAME");
                    dttmp.Columns.Add("AGREE_NO");
                    dttmp.Columns.Add("CARD_CO_NAME");
                    dttmp.Columns.Add("INSTALLMENT_CNT", typeof(decimal));
                    dttmp.Columns.Add("SALE_AMT", typeof(decimal));
                    dttmp.Columns.Add("CARD_JOIN_NO");
                    dttmp.Columns.Add("VALID_THRU");

                    dttmp.Rows.Add(new Object[] { "Y"
                                                  , dtCard.Rows[0]["BIZ_CODE"]
                                                  , PayInfo.RoomInfo.C_Mngno
                                                  , Int32.Parse(PayInfo.RoomInfo.C_Mngseq)
                                                  , dtCard.Rows[0]["TASK_DATE"]
                                                  , dtCard.Rows[0]["KEY_SEQ"]
                                                  , dtCard.Rows[0]["CARD_NO"]
                                                  , ""
                                                  , dtCard.Rows[0]["AGREE_NO"]
                                                  , dtCard.Rows[0]["CARD_CO_NAME"]
                                                  , dtCard.Rows[0]["INSTALLMENT_CNT"]
                                                  , dtCard.Rows[0]["SALE_AMT"]
                                                  , dtCard.Rows[0]["CARD_JOIN_NO"]
                                                  , dtCard.Rows[0]["VALID_THRU"] });

                    DataTable dtSign     = new DataTable("dtSign");
                    DataTable dtParmsign = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                    dtParmsign.Rows.Add(new object[] { "V_SALE_DATE", dtCard.Rows[0]["TASK_DATE"].ToString().Replace("-", "").Trim() });
                    dtParmsign.Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                    dtParmsign.Rows.Add(new object[] { "V_FACILITY_CODE", Parm.CurrentUserInformation.roomTask.gsDFacility });
                    dtParmsign.Rows.Add(new object[] { "V_PAY_SEQ", dtCard.Rows[0]["KEY_SEQ"] });

                    DataSet dssign = DataLayer.ExecuteSpDataset("PKG_DAHAH23.PR_05", dtParmsign, DataLayer.MessageEncoding.Default);
                    dtSign.Load(dssign.Tables[0].CreateDataReader());

                    //int prtcnt = dtSign.Rows.Count > 0 ? 1 : 2;
                    DataSet dsTemp = new DataSet();
                    dsTemp.Tables.AddRange(new DataTable[] { dttmp.Copy(), dtTitle.Copy(), dtSign.Copy() });

                    frmReport = new XtraReportsBase.DxReport.XtraPreviewForm();

                    //frmReport.ShowReport(dsTemp, rpt);  // FREEVIEW
                    //frmReport.Show();
                    rpt.PrinterName = Parm.CurrentUserInformation.roomTask.TSP800;
                    frmReport.ShowReportPrint(dsTemp, rpt, 1); // 출력
                    if (dtSign.Rows.Count <= 0)
                    {
                        frmReport.ShowReportPrint(dsTemp, rpt, 1); // 출력
                    }
                }
                #endregion

                //////////////////////////////////////////////////////////////////////////////////////////////////

                #region 시리얼프린트사용
                //영수증 프린터
                if (Parm.CurrentUserInformation.roomTask.gsPrintMode == PrintMode.SERIALPORT)
                {
                    using (Bill_Print bill = new Bill_Print(Parm.CurrentUserInformation.roomTask.SerialPrintStyle))
                    {
                        bill.PortNum  = int.Parse(Parm.CurrentUserInformation.roomTask.SerialPrintInfo.ComPort.Trim().ToUpper().Replace("COM", ""));
                        bill.Parity   = Parm.CurrentUserInformation.roomTask.SerialPrintInfo.Parity;
                        bill.StopBit  = Parm.CurrentUserInformation.roomTask.SerialPrintInfo.StopBit;
                        bill.DataBit  = int.Parse(Parm.CurrentUserInformation.roomTask.SerialPrintInfo.DataBit);
                        bill.BaudRate = int.Parse(Parm.CurrentUserInformation.roomTask.SerialPrintInfo.BaundRate);

                        bill.SetCenter();
                        bill.SetHW2();
                        bill.Add("신용카드 영수증");
                        bill.ClearFontSize();
                        bill.NewLine();
                        bill.Add("(보관용)");
                        bill.NewLine();
                        bill.SetLeft();
                        bill.NewLine();

                        bill.Add("사업자 번호 : ");
                        bill.Add(Parm.CurrentUserInformation.BizInfo.BizNo);
                        bill.NewLine();
                        bill.Add("상       호 : ");
                        bill.Add(Parm.CurrentUserInformation.BizInfo.BizName);
                        bill.NewLine();
                        bill.Add("대 표 자 명 : ");
                        bill.Add(Parm.CurrentUserInformation.BizInfo.CeoName);
                        bill.NewLine();
                        bill.Add("전 화 번 호 : ");
                        bill.Add(Parm.CurrentUserInformation.BizInfo.TelNo1);
                        bill.NewLine();
                        string   StrAddr = Parm.CurrentUserInformation.BizInfo.Address;
                        string[] addrs   = bill.Split42byte(StrAddr);
                        for (int j = 0; j < addrs.Length; j++)
                        {
                            bill.Add(addrs[j]);
                            bill.NewLine();
                        }

                        bill.NewLine();
                        bill.AddDoubleLine();
                        bill.NewLine();
                        bill.NewLine();

                        bill.Add("카드종류 : " + dtCard.Rows[0]["CARD_CO_NAME"].ToString().Trim()); bill.NewLine();
                        bill.Add("카드번호 : " + dtCard.Rows[0]["CARD_NO"].ToString().Trim()); bill.NewLine();
                        bill.Add("유효기간 : " + dtCard.Rows[0]["VALID_THRU"].ToString().Trim()); bill.NewLine();
                        bill.Add("승인일자 : " + dtCard.Rows[0]["TASK_DATE"].ToString().Trim()); bill.NewLine();
                        bill.Add("할부기간 : " + dtCard.Rows[0]["INSTALLMENT_CNT"].ToString().Trim()); bill.NewLine();
                        bill.Add("승인번호 : " + dtCard.Rows[0]["AGREE_NO"].ToString().Trim()); bill.NewLine();
                        bill.Add("승인금액 : " + int.Parse(dtCard.Rows[0]["SALE_AMT"].ToString().Trim()).ToString("n0")); bill.NewLine();
                        bill.Add("가맹번호 : " + dtCard.Rows[0]["CARD_JOIN_NO"].ToString().Trim()); bill.NewLine(); bill.NewLine();

                        DataTable dtParmsign = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                        dtParmsign.Rows.Add(new object[] { "V_SALE_DATE", dtCard.Rows[0]["TASK_DATE"].ToString().Replace("-", "").Trim() });
                        dtParmsign.Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                        dtParmsign.Rows.Add(new object[] { "V_FACILITY_CODE", Parm.CurrentUserInformation.roomTask.gsDFacility });
                        dtParmsign.Rows.Add(new object[] { "V_PAY_SEQ", dtCard.Rows[0]["KEY_SEQ"] });

                        DataSet dssign = DataLayer.ExecuteSpDataset("PKG_DAHAH23.PR_05", dtParmsign, DataLayer.MessageEncoding.Default);
                        //dtSign.Load(dssign.Tables[0].CreateDataReader());


                        if (dssign.Tables[0].Rows.Count == 0)
                        //if (DBNull.Value.Equals(dtSign.Rows[0]["SIGN_IMG"]))
                        {
                            bill.AddDoubleLine();
                            bill.NewLine();
                            bill.Add("서명 : ");
                            bill.NewLine();
                            bill.NewLine();
                            bill.NewLine();
                            bill.NewLine();
                            bill.NewLine();
                        }
                        else
                        {
                            //byte[] bSign = (byte[])dssign.Tables[0].Rows[i]["SIGN_IMG"];

                            byte[] bSign = (byte[])dssign.Tables[0].Rows[0]["SIGN_IMG"];

                            if (bSign != null && bSign.Length <= 1086)
                            {
                                bill.AddDoubleLine();
                                bill.NewLine();
                                bill.AddSignData(bSign);
                                bill.NewLine();
                                bill.NewLine();
                                bill.NewLine();
                                bill.NewLine();
                                bill.NewLine();
                            }
                        }

                        bill.Add(bill.GetCut());
                        bill.Send(bill.GetInitPrinter());
                        bill.Send(bill.SendData);

                        //if (dssign.Tables[0].Rows.Count == 0)
                        //{
                        //고객용 영수증 출력 //대천 무조건 2장씩 출력..요즘 편의점도 1장만 출력 하는구만..ㅠㅠ
                        #region Sign 정보가 없을시 고객용 출력
                        //Sign 정보가 없을시 고객용 출력
                        bill.Clear();

                        // 고객용.
                        bill.SetCenter();
                        bill.SetHW2();
                        bill.Add("신용카드 영수증");
                        bill.ClearFontSize();
                        bill.NewLine();
                        bill.Add("(고객용)");
                        bill.NewLine();
                        bill.SetLeft();
                        bill.NewLine();

                        bill.Add("사업자 번호 : ");
                        bill.Add(Parm.CurrentUserInformation.BizInfo.BizNo);
                        bill.NewLine();
                        bill.Add("상       호 : ");
                        bill.Add(Parm.CurrentUserInformation.BizInfo.BizName);
                        bill.NewLine();
                        bill.Add("대 표 자 명 : ");
                        bill.Add(Parm.CurrentUserInformation.BizInfo.CeoName);
                        bill.NewLine();
                        bill.Add("전 화 번 호 : ");
                        bill.Add(Parm.CurrentUserInformation.BizInfo.TelNo1);
                        bill.NewLine();

                        for (int j = 0; j < addrs.Length; j++)
                        {
                            bill.Add(addrs[j]);
                            bill.NewLine();
                        }

                        bill.NewLine();
                        bill.AddDoubleLine();
                        bill.NewLine();
                        bill.NewLine();

                        bill.Add("카드종류 : " + dtCard.Rows[0]["CARD_CO_NAME"].ToString().Trim()); bill.NewLine();
                        bill.Add("카드번호 : " + dtCard.Rows[0]["CARD_NO"].ToString().Trim()); bill.NewLine();
                        bill.Add("유효기간 : " + dtCard.Rows[0]["VALID_THRU"].ToString().Trim()); bill.NewLine();
                        bill.Add("승인일자 : " + dtCard.Rows[0]["TASK_DATE"].ToString().Trim()); bill.NewLine();
                        bill.Add("할부기간 : " + dtCard.Rows[0]["INSTALLMENT_CNT"].ToString().Trim()); bill.NewLine();
                        bill.Add("승인번호 : " + dtCard.Rows[0]["AGREE_NO"].ToString().Trim()); bill.NewLine();
                        bill.Add("승인금액 : " + int.Parse(dtCard.Rows[0]["SALE_AMT"].ToString().Trim()).ToString("n0")); bill.NewLine();
                        bill.Add("가맹번호 : " + dtCard.Rows[0]["CARD_JOIN_NO"].ToString().Trim()); bill.NewLine(); bill.NewLine();

                        if (dssign.Tables[0].Rows.Count == 0)
                        //if (DBNull.Value.Equals(dtSign.Rows[0]["SIGN_IMG"]))
                        {
                            bill.AddDoubleLine();
                            bill.NewLine();
                            bill.Add("서명 : ");
                            bill.NewLine();
                            bill.NewLine();
                            bill.NewLine();
                            bill.NewLine();
                            bill.NewLine();
                        }
                        else
                        {
                            //byte[] bSign = (byte[])dssign.Tables[0].Rows[i]["SIGN_IMG"];

                            byte[] bSign = (byte[])dssign.Tables[0].Rows[0]["SIGN_IMG"];

                            if (bSign != null && bSign.Length <= 1086)
                            {
                                bill.AddDoubleLine();
                                bill.NewLine();
                                bill.AddSignData(bSign);
                                bill.NewLine();
                                bill.NewLine();
                                bill.NewLine();
                                bill.NewLine();
                                bill.NewLine();
                            }
                        }

                        bill.Add(bill.GetCut());
                        bill.Send(bill.GetInitPrinter());
                        bill.Send(bill.SendData);
                        #endregion
                        //}


                        bill.Clear();

                        //메모리소멸 프린트 /  시리얼개체소멸
                        bill.Dispose();
                    }
                }
                #endregion
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
        }
예제 #33
0
파일: CardDesk.cs 프로젝트: Dmiri/BlackJack
 public CardDesk(Basic basicCards)
 {
     desk = GenericSortCard(basicCards);
 }
예제 #34
0
        /// <summary>
        /// 신용카드 승인
        /// </summary>
        private void fnPay120_Reg()
        {
            try
            {
                int amt = int.Parse(Basic.MaskReplace(txtCreditAmt.Text.Trim()));


                /*if(this.txtCreditCardNo.Text.Trim().Length < 13)
                 * {
                 *
                 *  Basic.ShowMessage(1, "카드번호를 정확하게 입력하여 주십시요.");
                 *  txtCreditCardNo.Focus();
                 *  return;
                 * }
                 * else */if (amt <= 0)
                {
                    Basic.ShowMessage(1, "결제금액을 입력하여 주십시요.");
                    txtCreditAmt.Focus();
                    return;
                }
                else if (Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_Facipart)) + Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_RoomNo)).Trim() == "")
                {
                    Basic.ShowMessage(2, "Bill 번호를 생성 할 수 없습니다.\n\r\n\r동코드:" + PayInfomation.RoomInfo.C_Facipart + "\r\n객실번호:" + PayInfomation.RoomInfo.C_RoomNo);
                    return;
                }


                //객실이 마감되었는지 체크한다.
                bool IsClose = BizCommon.Gneral_D.IsRoomClose();
                if (PayInfo.useKind == UseKind.Room && IsClose)
                {
                    Basic.ShowMessage(1, "현재 마감작업중입니다. \n\r마감이 끝난후 작업을 계속하십시요");
                    return;
                }


                string SendCardNo = "";
                _TrackTowInfo = "";

                /* if(txtCreditCardNo.Text.Trim().IndexOf("=") < 0)
                 * {
                 *
                 *   SendCardNo = txtCreditCardNo.Text.Trim();
                 *
                 *   if(  this.txtCreditCardScope.Text.Trim() == "" &&
                 *           this.txtCreditCardNo.Text.Trim().IndexOf("=") < 0  )
                 *       {
                 *           Basic.ShowMessage(1, "키인 입력입니다 - 유효기간을 입력하세요.");
                 *           txtCreditCardScope.Focus();
                 *           return;
                 *       }
                 *
                 * }
                 * else
                 * {
                 *   if (txtCreditCardNo.Text.ToUpper().StartsWith("C"))
                 *       txtCreditCardNo.Text = txtCreditCardNo.Text.Remove(0, 1);
                 *   _TrackTowInfo = txtCreditCardNo.Text.Trim();
                 *   SendCardNo = txtCreditCardNo.Text.Trim();
                 *
                 *   string str1 = this.txtCreditCardNo.Text.Trim().Split('=')[0];
                 *   string str2 = this.txtCreditCardNo.Text.Trim().Split('=')[1];
                 *
                 *   this.txtCreditCardNo.Text = str1;
                 *
                 *   if(str2.Trim().Length < 4)
                 *   {
                 *       Basic.ShowMessage(1, "MSR 입력 - 카드번호가 잘못되었습니다.");
                 *       return;
                 *   }
                 *   string strscope = str2.Trim().Substring(0,4);
                 *   this.txtCreditCardScope.EditValue   = strscope ;
                 *
                 * }
                 */
                //유효기간
                string scope = Basic.MaskReplace(txtCreditCardScope.Text.Trim());

                if (scope.Length < 4)
                {
                    scope = "9999";
                }



                #region 서명모드
                /******************************************************************************/
                // 싸인패드가 체크 되어 있다면 서명모드 시작
                /******************************************************************************/

                byte[] b = null;
                string SignDataString = "";

                /*
                 * Van.RecivedData rvcSign = new RecivedData();
                 * bool  IsSucess = true;
                 * if(this.chkCreditSignPad.Checked)
                 * {
                 *  using(BizVanComunication bizVan = new BizVanComunication())
                 *  {
                 *
                 *      string reqdatas = bizVan.GetVanMakeCardProtocol( "PROJECT_D" ,
                 *                                                        JobKind.RegCard,
                 *                                                        CashKind.None,
                 *                                                        SendCardNo ,
                 *                                                        scope,
                 *                                                        Basic.MaskReplace(txtCreditAmtSplit.Text.Trim()),
                 *                                                        Basic.MaskReplace(txtCreditAmt.Text.Trim()) ,
                 *                                                        "1" ,
                 *                                                        "","","", CashGbn.None );
                 *
                 *
                 *      IsSucess =  bizVan.GetSign( "PROJECT_D",
                 *                                  int.Parse(Basic.MaskReplace(txtCreditAmt.Text.Trim())) ,
                 *                                  ref rvcSign,
                 *                                  reqdatas);
                 *      bizVan.Dispose();
                 *  }
                 *
                 * }
                 * if(!IsSucess) return;
                 */
                /******************************************************************************/
                // 서명모드 종료
                /******************************************************************************/
                #endregion

                /*
                 * SignDataString = rvcSign.SignStringData;
                 * b = rvcSign.SignData;
                 */
                //카드승인처리 시작
                /***********************************************************************************************************************************************/

                Van.RecivedData reqdata = new RecivedData();

                /*
                 * if(rvcSign.IsSignPadAgree)
                 * {
                 *  reqdata = rvcSign;
                 *  if(reqdata.IsAgreeError)
                 *  {
                 *      MessageBox.Show(reqdata.Message);
                 *      return;
                 *  }
                 * }
                 * else
                 *
                 */
                {
                    using (BizVanComunication bizAgree = new BizVanComunication())
                    {
                        reqdata = bizAgree.SendData("PROJECT_D",
                                                    JobKind.RegCard,
                                                    CashKind.None,
                                                    SendCardNo,
                                                    scope,
                                                    Basic.MaskReplace(txtCreditAmtSplit.Text.Trim()),
                                                    Basic.MaskReplace(txtCreditAmt.Text.Trim()),
                                                    "1",
                                                    SignDataString, "", "", CashGbn.None);


                        bizAgree.Dispose();
                    }

                    /***********************************************************************************************************************************************/

                    if (reqdata.IsAgreeError)
                    {
                        MessageBox.Show(reqdata.Message);
                        return;
                    }
                }

                this.Cursor = Cursors.WaitCursor;
                // 승인이 났다.
                //DB처리
                string AgreeDate = reqdata.AgreeDate.Substring(0, 4) + "-" +
                                   reqdata.AgreeDate.Substring(4, 2) + "-" +
                                   reqdata.AgreeDate.Substring(6, 2);

                AgreeDate = DateTime.Parse(AgreeDate).ToString("yyyyMMdd");

                string outSeq = "";

                string v_ret = fn_Card(Basic.MaskReplace(txtCreditAmt.Text.Trim()),
                                       //     txtCreditCardNo.Text.Trim(),
                                       Basic.MaskReplace(reqdata.CashRegNumber),
                                       Basic.MaskReplace(scope),
                                       reqdata.CardCoCode,
                                       reqdata.CardCoName,
                                       reqdata.ISSUCoCode,
                                       reqdata.ISSUCoName,
                                       reqdata.CardJoinNo,
                                       reqdata.AgreeNo,
                                       this.txtCreditAmtSplit.Text.Trim() == "" ? "0" : this.txtCreditAmtSplit.Text.Trim(),
                                       AgreeDate,
                                       reqdata.AgreeDate.Length > 6 ? reqdata.AgreeDate.Substring(6, 4) : DateTime.Now.ToString("hhmm"),
                                       _TrackTowInfo,
                                       "N",
                                       Parm.CurrentUserInformation.roomTask.gsCardTerminalID,
                                       Parm.CurrentUserInformation.id,
                                       ref outSeq);

                //DB 처리에러시 취소승인을
                //딴다.
                if (v_ret != "OK")
                {
                    Van.RecivedData reqdataCancel = new RecivedData();

                    using (BizVanComunication bizAgree = new BizVanComunication())
                    {
                        reqdataCancel = bizAgree.SendData("PROJECT_D",
                                                          JobKind.CancelCard,
                                                          CashKind.None,
                                                          _TrackTowInfo,
                                                          scope,
                                                          Basic.MaskReplace(txtCreditAmtSplit.Text.Trim()),
                                                          Basic.MaskReplace(txtCreditAmt.Text.Trim()),
                                                          "",
                                                          "",
                                                          reqdata.AgreeNo,
                                                          reqdata.AgreeDate.Substring(0, 6),
                                                          CashGbn.None);

                        bizAgree.Dispose();
                    }


                    /***********************************************************************************************************************************************/


                    if (reqdataCancel.IsAgreeError)
                    {
                        Basic.ShowMessage(3, "승인 후 DB 저장시 에러 입니다." + System.Environment.NewLine +
                                          "승인번호는 : " + reqdata.AgreeNo + " 입니다." + System.Environment.NewLine +
                                          "현재 내용을 CTL + C 로 복사하여 메모장에 붙여 넣으세요 - 붙여넣으신 내용으로 전산실에 문의하세요" + System.Environment.NewLine +
                                          "전산실에 문의하여 수기로 승인 취소를 하십시요" + System.Environment.NewLine + System.Environment.NewLine +
                                          "승인취소 에러 내용" + System.Environment.NewLine +
                                          reqdata.Message + System.Environment.NewLine + System.Environment.NewLine +
                                          "DB 처리 에러내용 :" + System.Environment.NewLine +
                                          v_ret);

                        Van.Log.Log.SaveLog("[승인후 DB 저장에러 - 승인취소실패] 에러내용 -  " + reqdataCancel.Message);
                        Van.Log.Log.SaveLog("[승인후 DB 저장에러 - 승인취소실패] 취소전문 - $" + reqdataCancel.FullSendData + "$");
                        return;
                    }

                    Basic.ShowMessage(2, v_ret);
                    return;
                }

                //메인데이터가 들어갔다면 싸인데이터도 넣어준다.
                //싸인데이터가 있다면

                if (b != null)
                {
                    string Query = @"INSERT INTO IAA030DT(
                                                         SALE_DATE     , 
                                                         BIZ_CODE      , 
                                                         FACILITY_CODE , 
                                                         POS_NO        , 
                                                         BILL_NO       , 
                                                         SALE_YN       , 
                                                         PAY_SEQ       , 
                                                         SIGN_IMG      , 
                                                         U_EMP_NO      , 
                                                         U_IP         
                                                    ) VALUES (
                                                                   :V_SALE_DATE     , 
                                                                   :V_BIZ_CODE      , 
                                                                   :V_FACILITY_CODE , 
                                                                   :V_POS_NO        , 
                                                                   :V_BILL_NO       , 
                                                                   :V_SALE_YN       , 
                                                                   :V_PAY_SEQ       , 
                                                                   :V_SIGN_IMG      , 
                                                                   :V_U_EMP_NO      , 
                                                                   :V_U_IP         
                                                               )";

                    DataTable dtParm = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                    dtParm.Rows.Add(":V_SALE_DATE", PayInfomation.SaleDate);
                    dtParm.Rows.Add(":V_BIZ_CODE", PayInfomation.RoomInfo.C_Bizcode);
                    dtParm.Rows.Add(":V_FACILITY_CODE", PayInfomation.RoomInfo.C_Facilitycode);
                    dtParm.Rows.Add(":V_POS_NO", "01");
                    dtParm.Rows.Add(":V_BILL_NO", Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_Facipart)) + Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_RoomNo)));
                    dtParm.Rows.Add(":V_SALE_YN", "Y");
                    dtParm.Rows.Add(":V_PAY_SEQ", outSeq);
                    dtParm.Rows.Add(":V_SIGN_IMG", "#");
                    dtParm.Rows.Add(":V_U_EMP_NO", Parm.CurrentUserInformation.id);
                    dtParm.Rows.Add(":V_U_IP", Parm.CurrentUserInformation.ip);


                    //bill_Print_Card();

                    try
                    {
                        int ret = DataLayer.ExecuteNonQuery(Query, dtParm, b, DataLayer.MessageEncoding.Default);
                    }
                    catch (Exception ex)
                    {
                        Basic.ShowMessage(2, "카드승인은 정상승인 처리되었으며 자료도 정상저장 되었습니다. \n\r싸인 이미지만 DB 에 저장하지 못했습니다.\n\r" + ex.Message);
                    }

                    try
                    {
                        string _strBillNo = Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_Facipart)) + Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_RoomNo));
                        bill_Print_Card(outSeq, _strBillNo);
                    }
                    catch (Exception ex)
                    {
                        Basic.ShowMessage(2, "영수증 출력중 에러!");
                    }
                }
                else     // 사인데이터가 없어도 영수증 출력은 해준다로 변경함. (2015.07.15 정수환)
                {
                    string _strBillNo = Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_Facipart)) + Basic.MaskReplace(Num.GetNumberOnly(PayInfomation.RoomInfo.C_RoomNo));
                    bill_Print_Card(outSeq, _strBillNo);
                }

                Basic.ShowMessage(1, "저장 하였습니다.");


                txtCreditCardNo.Text    = "";
                txtCreditCardScope.Text = "";
                txtCreditAmtSplit.Text  = "0";
                txtCreditAmt.Text       = "0";
                _TrackTowInfo           = "";
                RaiseDataReflashEvent(true);
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
예제 #35
0
        /// <summary>
        /// 일괄수정버튼 클릭시
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void btnUpdateAll_Click(object sender, EventArgs e)
        {
            try
            {
                DataTable dtChang = dt.GetChanges();

                if (dtChang == null || dtChang.Rows.Count <= 0 || dt.Rows.Count <= 0)
                {
                    Basic.ShowMessage(1, "수정된 데이터가 없습니다.");
                    return;
                }


                Basic.SetCursor(this, false);
                Basic.LoadParentFunction(this, "일괄 수정 중..", false);

                DataTable[] dtParm = new DataTable[dtChang.Rows.Count];

                for (int i = 0; i < dtChang.Rows.Count; i++)
                {
                    string orgfacilitycode = dtChang.Rows[i]["FACILITY_CODE"].ToString().Trim();
                    string orgroomtype     = dtChang.Rows[i]["ROOM_TYPE"].ToString().Trim();
                    string orgroomview     = dtChang.Rows[i]["ROOM_VIEW"].ToString().Trim();

                    string roomuseyn = dtChang.Rows[i]["ROOM_USE_YN"].ToString().Trim();
                    string rsvuseyn  = dtChang.Rows[i]["RSV_USE_YN"].ToString().Trim();
                    string rsvcnt    = dtChang.Rows[i]["RSV_CNT"].ToString().Trim();
                    rsvcnt = rsvcnt == "" ? "0" : rsvcnt;

                    dtParm[i]           = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                    dtParm[i].TableName = "PKG_DAAAI18.PR_04";
                    dtParm[i].Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                    dtParm[i].Rows.Add(new object[] { "V_FACILITY_CODE", orgfacilitycode });
                    dtParm[i].Rows.Add(new object[] { "V_ROOM_TYPE", orgroomtype });
                    dtParm[i].Rows.Add(new object[] { "V_ROOM_VIEW", orgroomview });
                    dtParm[i].Rows.Add(new object[] { "V_ORG_FACILITY_CODE", orgfacilitycode });
                    dtParm[i].Rows.Add(new object[] { "V_ORG_ROOM_TYPE", orgroomtype });
                    dtParm[i].Rows.Add(new object[] { "V_ORG_ROOM_VIEW", orgroomview });
                    dtParm[i].Rows.Add(new object[] { "V_ROOM_USE_YN", roomuseyn });
                    dtParm[i].Rows.Add(new object[] { "V_RSV_USE_YN", rsvuseyn });
                    dtParm[i].Rows.Add(new object[] { "V_RSV_CNT", rsvcnt });
                    dtParm[i].Rows.Add(new object[] { "V_U_EMP_NO", BizCommon.Parm.CurrentUserInformation.id });
                    dtParm[i].Rows.Add(new object[] { "V_U_IP", BizCommon.Parm.CurrentUserInformation.ip });
                }

                DataSet dsParm = DataLayer.AddProdedcure(dtParm);

                string v_ret = DataLayer.ExecuteSpScalaTransaction(dsParm, "OK", DataLayer.MessageEncoding.Default);


                Basic.SetCursor(this, true);
                Basic.LoadParentFunction(this, "", false);

                if (v_ret != "OK")
                {
                    Basic.ShowMessage(1, v_ret);
                    return;
                }

                Selects(false);
                Basic.ShowMessage(1, "일괄 수정 하였습니다.");
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
            finally
            {
                Basic.SetCursor(this, true);
                Basic.LoadParentFunction(this, "", false);
            }
        }
예제 #36
0
        /// <summary>
        /// 저장
        /// </summary>
        private void Execute()
        {
            Ctl.Control.frmLoading f = new Ctl.Control.frmLoading("입력 중 입니다..");
            try
            {
                string season = this.lupSeason.EditValue.ToString().Trim();
                string week   = this.lupWeek.EditValue.ToString().Trim();

                if (season == "" && week == "")
                {
                    Basic.ShowMessage(1, "최소 하나의 코드를 선택해야 합니다.");
                    return;
                }


                //인서트한다.

                DataTable[] dtProcedure = new DataTable[dt.Rows.Count];

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string date = dt.Rows[i]["CALN_DATE"].ToString().Trim().Replace("-", "");

                    dtProcedure[i]           = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                    dtProcedure[i].TableName = "PKG_JAAAI15.PR_02";

                    dtProcedure[i].Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                    dtProcedure[i].Rows.Add(new object[] { "V_CALN_DATE", date });
                    dtProcedure[i].Rows.Add(new object[] { "V_SEASON_CODE", season });
                    dtProcedure[i].Rows.Add(new object[] { "V_WEEK_CODE", week });
                    dtProcedure[i].Rows.Add(new object[] { "V_U_EMP_NO", BizCommon.Parm.CurrentUserInformation.id });
                    dtProcedure[i].Rows.Add(new object[] { "V_U_IP", BizCommon.Parm.CurrentUserInformation.ip });
                }


                this.Cursor = Cursors.WaitCursor;
                f.Show();
                Application.DoEvents();

                DataSet ds = DataLayer.AddProdedcure(dtProcedure);
                string  g  = DataLayer.ExecuteSpScalaTransaction(ds, "OK", DataLayer.MessageEncoding.Default);

                if (f.IsHandleCreated)
                {
                    f.Close();
                }
                Application.DoEvents();
                if (g != "OK")
                {
                    Basic.ShowMessage(3, g);
                    return;
                }

                DialogResult = DialogResult.OK;

                Basic.ShowMessage(1, "변경 하였습니다.");
                this.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                this.Cursor = Cursors.Default;
                if (f.IsHandleCreated)
                {
                    f.Close();
                }
                f.Dispose();
                f = null;
            }
        }
예제 #37
0
 public MoveToForm()
 {
     ListIdName = new SortedList();
     InitializeComponent();
     B = new Basic();
 }
예제 #38
0
        /// <summary>
        /// 데이터를 서머리한다.
        /// </summary>
        private void SetSummery()
        {
            try
            {
                dtSumery.Clear();

                if (dt.Rows.Count <= 0)
                {
                    return;
                }

                //카드 별로 집계를 하여 데이터를 넣는다.

                DataRow r1 = dtSumery.NewRow();
                DataRow r2 = dtSumery.NewRow();

                DataRow r3 = dtSumery.NewRow();
                DataRow r4 = dtSumery.NewRow();


                r1["목록"] = "신규 -승인금액합계 ";
                r2["목록"] = "신규 -취소금액합계 ";

                r3["목록"] = "재청구-승인금액합계 ";
                r4["목록"] = "재청구-취소금액합계 ";

                for (int i = 0; i < rr.Length; i++)
                {
                    string strName = rr[i]["DETAIL_NAME"].ToString().Replace("(", "_").Replace(")", "");;
                    string strCode = rr[i]["DETAIL"].ToString();

                    string filter1 = "KIND = '승인요청' AND AGREE_YN = 'Y' AND SALE_AMT >= 0 AND CARD_CO_CODE = '" + strCode + "'";
                    string filter2 = "KIND = '승인요청' AND AGREE_YN = 'N' AND SALE_AMT <= 0 AND CARD_CO_CODE = '" + strCode + "'";

                    string filter3 = "KIND <> '승인요청' AND AGREE_YN = 'Y' AND SALE_AMT >= 0 AND CARD_CO_CODE = '" + strCode + "'";
                    string filter4 = "KIND <> '승인요청' AND AGREE_YN = 'N' AND SALE_AMT <= 0 AND CARD_CO_CODE = '" + strCode + "'";

                    int amt1 = dt.Compute("SUM(SALE_AMT)", filter1).ToString().Trim() == "" ? 0 :
                               int.Parse(dt.Compute("SUM(SALE_AMT)", filter1).ToString().Trim());

                    int amt2 = dt.Compute("SUM(SALE_AMT)", filter2).ToString().Trim() == "" ? 0 :
                               int.Parse(dt.Compute("SUM(SALE_AMT)", filter2).ToString().Trim());

                    int amt3 = dt.Compute("SUM(SALE_AMT)", filter3).ToString().Trim() == "" ? 0 :
                               int.Parse(dt.Compute("SUM(SALE_AMT)", filter3).ToString().Trim());

                    int amt4 = dt.Compute("SUM(SALE_AMT)", filter4).ToString().Trim() == "" ? 0 :
                               int.Parse(dt.Compute("SUM(SALE_AMT)", filter4).ToString().Trim());

                    r1[strName] = amt1;
                    r2[strName] = amt2;

                    r3[strName] = amt3;
                    r4[strName] = amt4;
                }

                dtSumery.Rows.Add(r1);
                dtSumery.Rows.Add(r2);

                dtSumery.Rows.Add(r3);
                dtSumery.Rows.Add(r4);
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
                dt.Clear();
                dtSumery.Clear();
                _strFrom = "";
                _strTo   = "";
                Basic.ShowMessage(1, "집계도중 에러가 발생하여 테이터를 초기화 합니다.");
            }
        }
예제 #39
0
        /// <summary>
        /// 입력함수
        /// </summary>
        private void Inserts()
        {
            try
            {
                ///TDDO:[영업장별우대할인]입력
                //유효성검사 후 사용
                if (!ISCheckData(JobStyle.INSERT))
                {
                    return;
                }

                string DCCouponNo = this.txtDCCouponNo.Text.Trim();
                //조회함수를 구현합니다.

                DataTable dtparmSelect = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                dtparmSelect.Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                dtparmSelect.Rows.Add(new object[] { "V_DCCOUPON_NO", DCCouponNo });

                DataSet ds = DataLayer.ExecuteSpDataset("PKG_JDAAI05.PR_03", dtparmSelect, DataLayer.MessageEncoding.Default);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    int len2 = Convert.ToInt32(ds.Tables[0].Rows[0]["ITEM2"].ToString());
                    int len1 = Convert.ToInt32(Basic.MaskReplace(txtUseQty.Text).Length);

                    if (len2 < len1)
                    {
                        Basic.ShowMessage(3, "수량을 초과 하였습니다");
                        this.txtUseQty.Focus();
                        return;
                    }
                }


                //에니메이션 과 커서의 모양을 바궈준다.
                Basic.SetCursor(this, false);
                Basic.LoadParentFunction(this, "입력 중 입니다..", true);


                int iRowm = this.gridView1.GetDataSourceRowIndex(this.gridView1.FocusedRowHandle);
                labeldocuno.Text = dt.Rows[iRowm]["DCCOUPON_NO"].ToString().Trim();

                string sDCCOUPON_NO = dt.Rows[iRowm]["DCCOUPON_NO"].ToString().Trim();
                //입력함수를 구현합니다.
                //만약 변수가 필요없다면 아래 코드를 삭제 하세요
                DataTable dtparmInsert = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                dtparmInsert.Rows.Add(new object[] { "V_DCCOUPON_NO", labeldocuno.Text.Trim() });
                dtparmInsert.Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                dtparmInsert.Rows.Add(new object[] { "V_DC_NO_TO", this.txtUseQty.EditValue });
                dtparmInsert.Rows.Add(new object[] { "V_ISSUE_DATE", System.DateTime.Now.ToString("yyyyMMdd") });
                dtparmInsert.Rows.Add(new object[] { "V_ISSUE_EMP_NO", this.txtIssueEmpName.Text.Trim() });
                dtparmInsert.Rows.Add(new object[] { "V_ISSUE_QTY", this.txtUseQty.Text.Trim() });
                dtparmInsert.Rows.Add(new object[] { "V_ISSUE_RMRK", txtRmrk.Text.Trim() });
                dtparmInsert.Rows.Add(new object[] { "V_U_EMP_NO", BizCommon.Parm.CurrentUserInformation.id });
                dtparmInsert.Rows.Add(new object[] { "V_U_IP", BizCommon.Parm.CurrentUserInformation.ip });


                //프로시져를 호출하여 결과를 리턴 받는다.
                //만약 output 값이 여러개라면 '|' (파이프) 값으로 구분하여 들어온다.
                //Split 함수로 짤라서 사용한다.
                string Result = DataLayer.ExecuteSpScala("PKG_JDAAI05.PR_10", dtparmInsert, DataLayer.MessageEncoding.Default);



                //프로시져 에러라면 빠져나간다.
                if (Result.Trim() != "OK")
                {
                    Basic.ShowMessage(3, Result);
                    return;
                }

                //입력한 데이터를 조회 를 합니다...
                Selects(false);
                // 조회 가 끝난 후 입력한 데이터를 선택합니다.
                // cols 는 현재 구성되어 있는 그리드의 컬럼 이름입니다.

                DevExpress.XtraGrid.Columns.GridColumn[] cols1 = new GridColumn[] { gridView1.Columns["DCCOUPON_NO"] };


                Cls.Grid.Options.SelectGridRow(this.gridView1, cols1, new object[] { sDCCOUPON_NO });


                DevExpress.XtraGrid.Columns.GridColumn[] cols2 = new GridColumn[] { gridView2.Columns["DCCOUPON_NO"] };

                Cls.Grid.Options.SelectGridRow(this.gridView2, cols2, new object[] { sDCCOUPON_NO });

                Basic.ShowMessage(1, "입력 하였습니다.");
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                Basic.SetCursor(this, true);
                Basic.LoadParentFunction(this, "", false);
            }
        }
예제 #40
0
        /// <summary>
        /// 청구파일제외
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void btnRegWithOut_Click(object sender, EventArgs e)
        {
            Ctl.Control.frmLoading f = new Ctl.Control.frmLoading("청구내역에서 제외합니다.");

            try
            {
                if (this.gridViewData.RowCount <= 0)
                {
                    return;
                }

                Basic.SetCursor(this, false);

                DataRow[] r = dt.Select("CHK = 'Y'");

                if (r == null || r.Length <= 0)
                {
                    Basic.ShowMessage(1, "선택된 데이터가 없습니다.");
                    return;
                }

                if (Basic.ShowMessageQuestion("선택한 데이터는 청구되지 않습니다. \n\r계속진행 하시겠습니까?") == DialogResult.No)
                {
                    return;
                }

                dt.AcceptChanges();

                DataTable[] dtParm = new DataTable[r.Length];


                f.TopMost = true;
                f.Show();
                Application.DoEvents();

                for (int i = 0; i < r.Length; i++)
                {
                    string sale_date = Basic.MaskReplace(r[i]["SALE_DATE"].ToString().Trim());
                    string facility  = r[i]["FACILITY_CODE"].ToString().Trim();
                    string posno     = r[i]["POS_NO"].ToString().Trim();
                    string billno    = r[i]["BILL_NO"].ToString().Trim();
                    string saleyn    = r[i]["SALE_YN"].ToString().Trim();
                    string payseq    = r[i]["PAY_SEQ"].ToString().Trim();



                    dtParm[i] = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);

                    dtParm[i].TableName = "PKG_JIAAI02.PR_04";

                    dtParm[i].Rows.Add(new object[] { "V_TID", "청구제외" });
                    dtParm[i].Rows.Add(new object[] { "V_SALE_DATE", sale_date });
                    dtParm[i].Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                    dtParm[i].Rows.Add(new object[] { "V_FACILITY_CODE", facility });
                    dtParm[i].Rows.Add(new object[] { "V_POS_NO", posno });
                    dtParm[i].Rows.Add(new object[] { "V_BILL_NO", billno });
                    dtParm[i].Rows.Add(new object[] { "V_SALE_YN", saleyn });
                    dtParm[i].Rows.Add(new object[] { "V_PAY_SEQ", payseq });
                    dtParm[i].Rows.Add(new object[] { "V_EMP_NO", Parm.CurrentUserInformation.id });
                    dtParm[i].Rows.Add(new object[] { "V_IP", Parm.CurrentUserInformation.ip });
                }


                DataSet ds = DataLayer.AddProdedcure(dtParm);

                string vRet = DataLayer.ExecuteSpScalaTransaction(ds, "OK", DataLayer.MessageEncoding.Default);

                Basic.SetCursor(this, true);
                if (f.IsHandleCreated)
                {
                    f.Dispose();
                    f.Close();
                }

                if (vRet != "OK")
                {
                    dt.RejectChanges();
                    Basic.ShowMessage(3, vRet);
                    return;
                }
                Basic.ShowMessage(1, "목록을 갱신합니다.");
                fnSelect();
            }
            catch (Exception ex)
            {
                dt.RejectChanges();
                Basic.ShowMessage(3, ex.Message);
            }
            finally
            {
                Basic.SetCursor(this, true);
                if (f.IsHandleCreated)
                {
                    f.Dispose();
                    f.Close();
                }
            }
        }
예제 #41
0
        /// <summary>
        /// 데이터의 유효성을 검사합니다.
        /// </summary>
        /// <param name="style">작업스타일.</param>
        /// <returns>유효성검사결과</returns>
        private bool ISCheckData(JobStyle style)
        {
            bool bReturn = false;

            //update// delete 시 데이터가 선택되었는지를 확인한다.
            if (style != JobStyle.INSERT)
            {
                if (this.gridView1.FocusedRowHandle < 0 || this.gridView1.RowCount <= 0)
                {
                    Basic.ShowMessage(3, "선택된 데이터가 없습니다.");
                    return(false);
                }
                else //선택된 데이터가 있다면
                {
                    //그리고.. 삭제라면.. // 삭제일경우 데이터만 선택되어 있으면 삭제할 수 있다.
                    if (style == JobStyle.DELETE)
                    {
                        return(true);
                    }
                }
            }

            DataTable dtTemp = GetHelperDataMember(this.txtIssueEmpName.Text.Trim());

            if (dtTemp.Rows.Count == 0)
            {
                Basic.ShowMessage(2, "등록된 사원이 아닙니다.");
                this.txtIssueEmpName.Focus();
                return(false);
            }

            if (this.lblIssueEmpNo.Text.Trim() != dtTemp.Rows[0]["EMP_NAME"].ToString() ||
                this.txtIssueEmpName.Text != dtTemp.Rows[0]["EMP_NO"].ToString())
            {
                Basic.ShowMessage(2, "사원번호가 바르지 않습니다.");
                this.txtIssueEmpName.Focus();
                return(false);
            }

            if (this.txtUseQty.Text.Trim() == "")
            {
                Basic.ShowMessage(3, "사용인원을 입력하세요.");
                this.txtUseQty.Focus();
                return(false);
            }
            if (this.txtRmrk.Text.Trim() == "")
            {
                Basic.ShowMessage(3, "비고를 입력하세요.");
                this.txtRmrk.Focus();
                return(false);
            }

            if (this.txtIssueEmpName.Text.Trim() == "")
            {
                Basic.ShowMessage(3, "사원을 입력하세요.");
                this.txtIssueEmpName.Focus();
                return(false);
            }


            bReturn = true;

            return(bReturn);
        }
예제 #42
0
        /// <summary>
        /// 수정함수
        /// </summary>
        private void Updates()
        {
            try
            {
                ///TDDO:[일일마감]수정

                //유효성 검사후 실행합니다.
                if (!ISCheckData(JobStyle.UPDATE))
                {
                    return;
                }
                Basic.SetCursor(this, false);
                Basic.LoadParentFunction(this, "수정 중 입니다..", true);

                //수정함수를 구현합니다.
                //만약 변수가 필요없다면 아래 코드를 삭제 하세요
                DataTable dtparmUpdate = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                dtparmUpdate.Rows.Add(new object[] { "변수명", "값" });


                //프로시져를 호출하여 결과를 리턴 받는다.
                //만약 output 값이 여러개라면 '|' (파이프) 값으로 구분하여 들어온다.
                //Split 함수로 짤라서 사용한다.
                string Result = DataLayer.ExecuteSpScala("프로시져명", dtparmUpdate, DataLayer.MessageEncoding.Default);

                //프로시져 에러라면 빠져나간다.
                if (Result.Trim() != "OK")
                {
                    Basic.ShowMessage(3, Result);
                    return;
                }

                //수정한 데이터를 조회 를 합니다...
                Selects(false);

                // 조회 가 끝난 후 입력한 데이터를 선택합니다.
                // 주석을 풀고 사용하십시요
                // 사용방법은 아래 와같습니다.
                // cols 는 현재 구성되어 있는 그리드의 컬럼 이름입니다.
                // 만약 ID 가 hany    Password 가 111 데이터를 선택하려면

                //DevExpress.XtraGrid.Columns.GridColumn[] cols;
                //object[] obj;
                //cols = new GridColumn[] { this.gridView.Columns["ID"], this.gridView.Columns["PASSWORD"] };
                //obj = new object[] { "hany" , "1111" };

                //주석을 풀고 사용하십시요
                //데이터를 선택합니다.
                //Cls.Grid.Options.SelectGridRow(this.gridView, cols, obj);

                Basic.ShowMessage(1, "수정 하였습니다.");
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
            finally
            {
                Basic.SetCursor(this, true);
                Basic.LoadParentFunction(this, "", false);
            }
        }
 Vector3 ConvertBoardToWorldPos(Basic.Vec2Int pos, float addY)
 {
     var cameraPos = cameraTarget.transform.position;
     return new Vector3(
             (pos.x - BOARD_WIDTH / 2f + 0.5f) * WORLD_UNIT_DISTANCE + cameraPos.x,
             addY,
             (pos.y - BOARD_HEIGHT / 2f + 0.5f) * WORLD_UNIT_DISTANCE + cameraPos.z);
 }
예제 #44
0
 public void AssertIdentifierInSharedAccessPolicies(SharedAccessBlobPolicies sharedAccessPolicies, Basic.Azure.Storage.Communications.Common.BlobSignedIdentifier expectedIdentifier, SharedAccessBlobPermissions permissions)
 {
     var policy = sharedAccessPolicies.Where(i => i.Key.Equals(expectedIdentifier.Id, StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
     Assert.IsNotNull(policy);
     Assert.AreEqual(expectedIdentifier.AccessPolicy.StartTime, policy.Value.SharedAccessStartTime.Value.UtcDateTime);
     Assert.AreEqual(expectedIdentifier.AccessPolicy.Expiry, policy.Value.SharedAccessExpiryTime.Value.UtcDateTime);
     Assert.IsTrue(policy.Value.Permissions.HasFlag(permissions));
 }
예제 #45
0
        public List<ListBlockItem> AssertBlockListsAreEqual(string containerName, string blobName, Basic.Azure.Storage.Communications.BlobService.BlobOperations.GetBlockListResponse response)
        {
            var client = _storageAccount.CreateCloudBlobClient();
            var container = client.GetContainerReference(containerName);
            if (!container.Exists())
                Assert.Fail("AssertBlockExists: The container '{0}' does not exist", containerName);

            var blob = container.GetBlockBlobReference(blobName);
            var committedBlockList = blob.DownloadBlockList(BlockListingFilter.Committed);
            var uncommittedBlockList = blob.DownloadBlockList(BlockListingFilter.Uncommitted);
            var blockList = committedBlockList.Concat(uncommittedBlockList).ToList();

            var gottenBlocks = response.CommittedBlocks.Concat(response.UncommittedBlocks).ToList();
            var gottenBlocksCount = gottenBlocks.Count;
            Assert.AreEqual(blockList.Count, gottenBlocksCount);
            for (var i = 0; i < gottenBlocksCount; i++)
            {
                var expectedBlock = blockList[i];
                var gottenBlock = gottenBlocks[i];
                Assert.AreEqual(expectedBlock.Name, gottenBlock.Name);
                Assert.AreEqual(expectedBlock.Length, gottenBlock.Size);
            }

            return blockList;
        }
예제 #46
0
 public Basic.Azure.Storage.Communications.BlobService.BlockListBlockIdList CreateBlockIdList(int idCount, Basic.Azure.Storage.Communications.BlobService.PutBlockListListType listType)
 {
     var idList = new Basic.Azure.Storage.Communications.BlobService.BlockListBlockIdList();
     for (var i = 0; i < idCount; i++)
     {
         idList.Add(new Basic.Azure.Storage.Communications.BlobService.BlockListBlockId
         {
             Id = Basic.Azure.Storage.Communications.Utility.Base64Converter.ConvertToBase64(Guid.NewGuid().ToString()),
             ListType = listType
         });
     }
     return idList;
 }
예제 #47
0
        public void AssertBlobCopyPropertiesMatch(string containerName, string blobName, Communications.Common.CopyStatus? copyStatus, Basic.Azure.Storage.Communications.BlobService.BlobCopyProgress copyProgress, DateTime? copyCompletionTime, string copyStatusDescription, string copyId, string copySource)
        {
            var client = _storageAccount.CreateCloudBlobClient();
            var container = client.GetContainerReference(containerName);
            if (!container.Exists())
                Assert.Fail("AssertBlobCopyPropertiesMatch: The container '{0}' does not exist", containerName);

            var blob = container.GetBlobReferenceFromServer(blobName);
            if (!blob.Exists())
                Assert.Fail("AssertBlobCopyPropertiesMatch: The blob '{0}' does not exist", blobName);

            var copyState = blob.CopyState;

            if (null == copyState)
            {
                Assert.IsNull(copyStatus);
                Assert.IsNull(copyProgress);
                Assert.IsNull(copyCompletionTime);
                Assert.IsNull(copyStatusDescription);
                Assert.IsNull(copyId);
                Assert.IsNull(copySource);
            }
            else
            {
                Assert.AreEqual(copyState.Status.ToString(), copyStatus.ToString());
                Assert.AreEqual(copyState.BytesCopied, copyProgress.BytesCopied);
                Assert.AreEqual(copyState.TotalBytes, copyProgress.BytesTotal);
                Assert.AreEqual(copyState.CompletionTime.Value.LocalDateTime, copyCompletionTime.Value);
                Assert.AreEqual(copyState.StatusDescription, copyStatusDescription);
                Assert.AreEqual(copyState.CopyId, copyId);
                Assert.AreEqual(copyState.Source, copySource);
            }
        }
예제 #48
0
        /// <summary>
        /// 수정함수
        /// </summary>
        private void Updates()
        {
            try
            {
                ///TDDO:[템플릿]수정

                //유효성 검사후 실행합니다.
                if (!ISCheckData(JobStyle.UPDATE))
                {
                    return;
                }
                Basic.SetCursor(this, false);
                Basic.LoadParentFunction(this, "수정 중 입니다..", true);

                string roomview  = lupRoomview.EditValue.ToString().Trim();
                string roomuseyn = chkRoomuseyn.Checked ? "Y" : "N";
                string rsvuseyn  = chkRsvuseyn.Checked ? "Y" : "N";
                string rsvcnt    = txtRsvcnt.Text.Trim().Replace(",", "");
                rsvcnt = rsvcnt == "" ? "0": rsvcnt;

                string[] arry  = this.popFacilitycode.Text.Trim().Split(' ');
                string[] arry1 = arry[0].Split('-');

                string orgfacilitycode = this.gridView.GetRowCellValue(this.gridView.FocusedRowHandle, "FACILITY_CODE").ToString().Trim();
                string orgroomtype     = this.gridView.GetRowCellValue(this.gridView.FocusedRowHandle, "ROOM_TYPE").ToString().Trim();
                string orgroomview     = this.gridView.GetRowCellValue(this.gridView.FocusedRowHandle, "ROOM_VIEW").ToString().Trim();

                //수정함수를 구현합니다.
                //만약 변수가 필요없다면 아래 코드를 삭제 하세요
                DataTable dtparmUpdate = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                dtparmUpdate.Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                dtparmUpdate.Rows.Add(new object[] { "V_FACILITY_CODE", arry1[0] });
                dtparmUpdate.Rows.Add(new object[] { "V_ROOM_TYPE", arry1[1] });
                dtparmUpdate.Rows.Add(new object[] { "V_ROOM_VIEW", roomview });
                dtparmUpdate.Rows.Add(new object[] { "V_ORG_FACILITY_CODE", orgfacilitycode });
                dtparmUpdate.Rows.Add(new object[] { "V_ORG_ROOM_TYPE", orgroomtype });
                dtparmUpdate.Rows.Add(new object[] { "V_ORG_ROOM_VIEW", orgroomview });
                dtparmUpdate.Rows.Add(new object[] { "V_ROOM_USE_YN", roomuseyn });
                dtparmUpdate.Rows.Add(new object[] { "V_RSV_USE_YN", rsvuseyn });
                dtparmUpdate.Rows.Add(new object[] { "V_RSV_CNT", rsvcnt });
                dtparmUpdate.Rows.Add(new object[] { "V_U_EMP_NO", BizCommon.Parm.CurrentUserInformation.id });
                dtparmUpdate.Rows.Add(new object[] { "V_U_IP", BizCommon.Parm.CurrentUserInformation.ip });


                //프로시져를 호출하여 결과를 리턴 받는다.
                //만약 output 값이 여러개라면 '|' (파이프) 값으로 구분하여 들어온다.
                //Split 함수로 짤라서 사용한다.
                string Result = DataLayer.ExecuteSpScala("PKG_DAAAI18.PR_04", dtparmUpdate, DataLayer.MessageEncoding.Default);

                //프로시져 에러라면 빠져나간다.
                if (Result.Trim() != "OK")
                {
                    Basic.ShowMessage(3, Result);
                    return;
                }

                //수정한 데이터를 조회 를 합니다...
                Selects(false);

                DevExpress.XtraGrid.Columns.GridColumn[] cols;
                object[] obj;
                cols = new GridColumn[] { this.gridView.Columns["FACILITY_CODE"],
                                          this.gridView.Columns["ROOM_TYPE"],
                                          this.gridView.Columns["ROOM_VIEW"], };
                obj = new object[] { arry1[0], arry1[1], roomview };

                //주석을 풀고 사용하십시요
                //데이터를 선택합니다.
                Cls.Grid.Options.SelectGridRow(this.gridView, cols, obj);

                Basic.ShowMessage(1, "수정 하였습니다.");
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
            finally
            {
                Basic.SetCursor(this, true);
                Basic.LoadParentFunction(this, "", false);
            }
        }
예제 #49
0
 public void AssertIsBlockListResponse(Basic.Azure.Storage.Extensions.Contracts.IBlobOrBlockListResponseWrapper response)
 {
     Assert.IsInstanceOf(typeof(Basic.Azure.Storage.Communications.BlobService.BlobOperations.PutBlockListResponse), response);
 }
예제 #50
0
        /// <summary>
        /// 컨트롤을 셋팅합니다.
        /// </summary>
        private void SetCtlInitialize()
        {
            try
            {
                dtReference.Columns.Add("BIZ_CODE");
                dtReference.Columns.Add("VALUE_LIST");
                dtReference.Columns.Add("VALUE_NAME");

                DataTable dttmp = new DataTable();
                dttmp.Columns.Add("DISPLAY_MEMBER");
                dttmp.Columns.Add("VALUE_MEMBER");


                dtPort.Columns.Add("PORT");
                dtPort.Columns.Add("PORT_NAME");


                //사용가능한 시리얼포트를 가져온다.
                string[] strPort = System.IO.Ports.SerialPort.GetPortNames();

                if (strPort != null)
                {
                    for (int i = 0; i < strPort.Length; i++)
                    {
                        dtPort.Rows.Add(new object[] { strPort[i], strPort[i] });
                    }
                }

                //콤보박스에 셋팅한다.
                Cls.Common.CboBox.FillComboBoxDataTable(cboLockerPort, dtPort, "PORT_NAME", "PORT", "선택하세요");
                cboLockerPort.SelectedIndex = 0;
                cboLockerType.SelectedIndex = 0;



                string type = "";
                for (int i = 0; i < BizCommon.Parm.mDataTable.dtZaa140ms.Rows.Count; i++)
                {
                    if (BizCommon.Parm.mDataTable.dtZaa140ms.Rows[i]["USE_YN"].ToString().Trim() == "N")
                    {
                        continue;
                    }

                    string pType = BizCommon.Parm.mDataTable.dtZaa140ms.Rows[i]["FACILITY_TYPE"].ToString().Trim();
                    string pName = BizCommon.Parm.mDataTable.dtZaa140ms.Rows[i]["FACILITY_TYPE_NAME"].ToString().Trim();
                    if (type != pType)
                    {
                        type = pType;
                        dttmp.Rows.Add(new object[] { pName, pType });
                    }
                }

                DataTable dttmpSort = Basic.GetdtSelect(dttmp, "", "VALUE_MEMBER");

                LookUp.SetFillCode(this.lupFacility, dttmpSort, "DISPLAY_MEMBER", "VALUE_MEMBER", LookUp.CaptoinStyle.SelectText);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #51
0
 public List<string> GetIdsFromBlockIdList(Basic.Azure.Storage.Communications.BlobService.BlockListBlockIdList list)
 {
     return list.Select(bid => bid.Id).ToList();
 }
예제 #52
0
        /// <summary>
        /// 입력함수
        /// </summary>
        private void Updates()
        {
            try
            {
                ///TDDO:[사용일수변경]입력
                //유효성검사 후 사용
                if (!ISCheckData(JobStyle.UPDATE))
                {
                    return;
                }
                //에니메이션 과 커서의 모양을 바궈준다.
                Basic.SetCursor(this, false);
                Basic.LoadParentFunction(this, "저장 중 입니다..", true);

                string annual = lupYear.EditValue.ToString().Trim();

                int    iRowM     = this.gridViewM.GetDataSourceRowIndex(this.gridViewM.FocusedRowHandle);
                string memberno  = dtM.Rows[iRowM]["MEMBER_NO"].ToString().Trim();
                string memberseq = dtM.Rows[iRowM]["MEMBER_SEQ"].ToString().Trim();

                int    iRowL   = this.gridViewL.GetDataSourceRowIndex(this.gridViewL.FocusedRowHandle);
                string usecode = dtL.Rows[iRowL]["USE_CODE"].ToString().Trim();

                string limitcnt = txtLimitCnt.EditValue.ToString().Trim();

                //입력함수를 구현합니다.
                //만약 변수가 필요없다면 아래 코드를 삭제 하세요
                DataTable dtparm = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                dtparm.Rows.Add(new object[] { "V_ANNUAL", annual });
                dtparm.Rows.Add(new object[] { "V_MEMBER_SEQ", memberseq });
                dtparm.Rows.Add(new object[] { "V_USE_CODE", usecode });
                dtparm.Rows.Add(new object[] { "V_LIMIT_CNT", limitcnt });
                dtparm.Rows.Add(new object[] { "V_EMP_NO", Parm.CurrentUserInformation.No });
                dtparm.Rows.Add(new object[] { "V_IP", Parm.CurrentUserInformation.ip });

                string Result = DataLayer.ExecuteSpScala("PKG_CEAAI03.PR_10", dtparm, DataLayer.MessageEncoding.Default);

                //프로시져 에러라면 빠져나간다.
                if (Result != "OK")
                {
                    Basic.ShowMessage(3, Result);
                    return;
                }

                //입력한 데이터를 조회 를 합니다...
                Selects(false);

                DevExpress.XtraGrid.Columns.GridColumn[] cols1 = new GridColumn[] { gridViewM.Columns["MEMBER_NO"] };
                int i1 = Cls.Grid.Options.LocateRowByMultipleValues(gridViewM,
                                                                    cols1,
                                                                    new object[] { memberno },
                                                                    0);

                if (i1 >= 0)
                {
                    gridViewM.FocusedRowHandle = i1;
                }

                DevExpress.XtraGrid.Columns.GridColumn[] cols2 = new GridColumn[] { gridViewL.Columns["USE_CODE"] };
                int i2 = Cls.Grid.Options.LocateRowByMultipleValues(gridViewL,
                                                                    cols2,
                                                                    new object[] { usecode },
                                                                    0);

                if (i2 >= 0)
                {
                    gridViewL.FocusedRowHandle = i2;
                }

                Basic.ShowMessage(1, "저장 하였습니다.");
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                Basic.SetCursor(this, true);
                Basic.LoadParentFunction(this, "", false);
            }
        }
예제 #53
0
        /// <summary>
        /// 입력버튼클릭
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void picInsert_Click(object sender, EventArgs e)
        {
            try
            {
                Basic.SetCursor(this, false);
                Basic.LoadParentFunction(this, "입력 중 입니다...", true);


                this.picInsert.Focus();

                DataRow[] r_Project = dtProject.Select("CHK = 'Y'");
                DataRow[] r_Type    = dtType.Select("CHK = 'Y'");


                if (r_Project.Length <= 0)
                {
                    Basic.ShowMessage(1, "영영장이 선택되지 않았습니다.");
                    this.gridProject.Focus();
                    return;
                }

                if (r_Type.Length <= 0)
                {
                    Basic.ShowMessage(1, "영영장 타입이 선택되지 않았습니다.");
                    this.gridtype.Focus();
                    return;
                }

                if (dtEmp.Rows.Count <= 0 || this.gridViewEmp.RowCount <= 0 || this.gridViewEmp.FocusedRowHandle < 0)
                {
                    Basic.ShowMessage(1, "사원이 선택되지 않았습니다.");
                    return;
                }

                string empno = this.gridViewEmp.GetRowCellValue(this.gridViewEmp.FocusedRowHandle, "EMP_NO").ToString().Trim();

                DataTable[] dtProcedure = new  DataTable[r_Project.Length * r_Type.Length];

                int index = 0;
                for (int i = 0; i < r_Project.Length; i++)
                {
                    string project = r_Project[i]["PROJECT_ID"].ToString().Trim();
                    for (int j = 0; j < r_Type.Length; j++)
                    {
                        string type = r_Type[j]["DETAIL"].ToString().Trim();

                        //중복데이터 축출
                        string filter = "EMP_NO = '" + empno + "' AND PROJECT_ID = '" + project + "' AND FACILITY_TYPE = '" + type + "'";
                        int    cnt    = int.Parse(dtRes.Compute("COUNT(EMP_NO)", filter).ToString().Trim());

                        string msg = "[" + r_Project[i]["PROJECT_NAME"].ToString().Trim() + " - " + r_Type[j]["DETAIL_NAME"].ToString().Trim() + "]은(는) 이미 등록되어 있습니다.";

                        if (cnt > 0)
                        {
                            Basic.ShowMessage(2, msg);
                            return;
                        }

                        dtProcedure[index]           = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                        dtProcedure[index].TableName = "PKG_JAAAI04.PR_03";
                        dtProcedure[index].Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                        dtProcedure[index].Rows.Add(new object[] { "V_EMP_NO", empno });
                        dtProcedure[index].Rows.Add(new object[] { "V_PROJECT_ID", project });
                        dtProcedure[index].Rows.Add(new object[] { "V_FACILITY_TYPE", type });
                        dtProcedure[index].Rows.Add(new object[] { "V_U_EMP_NO", BizCommon.Parm.CurrentUserInformation.id });
                        dtProcedure[index].Rows.Add(new object[] { "V_U_IP", BizCommon.Parm.CurrentUserInformation.ip });
                        index++;
                    }
                }

                DataSet ds = DataLayer.AddProdedcure(dtProcedure);
                string  g  = DataLayer.ExecuteSpScalaTransaction(ds, "OK", DataLayer.MessageEncoding.Default);

                if (g != "OK")
                {
                    Basic.ShowMessage(3, g);
                    return;
                }

                fnSelect(empno);
                dtType.RejectChanges();
                dtProject.RejectChanges();
                dtType.AcceptChanges();
                dtProject.AcceptChanges();
                Basic.ShowMessage(1, "입력하였습니다.");
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
            finally
            {
                Basic.SetCursor(this, true);
                Basic.LoadParentFunction(this, "", false);
            }
        }
예제 #54
0
        /// <summary>
        /// 조회버튼 클릭
        /// </summary>
        private void fnSelect()
        {
            try
            {
                Basic.SetCursor(this, false);
                Basic.LoadParentFunction(this, "조회 중 입니다..", true);

                string strBizCode          = Parm.CurrentUserInformation.BizInfo.BizCode;                           // 사업장코드
                string strReceNo           = this.txtReceNo.Text.ToString().Trim();                                 // 미수번호
                string strReceSaleDateFrom = ((DateTime)this.datReceSaleDateFrom.EditValue).ToString("yyyyMMdd");   // 미수일자
                string strReceSaleDateTo   = ((DateTime)this.datReceSaleDateTo.EditValue).ToString("yyyyMMdd");     // 미수일자
                string strReceCode         = lupReceCode.EditValue.ToString().Trim();                               // 발생구분
                string strMemberNoName     = txtMemberNoName.Text.ToString().Trim();                                // 회원번호/명
                string strAnnual           = txtAnnual.Text.ToString().Trim();                                      // 기수
                string strCapMemberNoName  = txtCapMemberNoName.Text.ToString().Trim();                             // 대표회원번호/명
                string strExat_CalcYN      = lupExatCalcYN.EditValue.ToString().Trim();                             // 정산유무

                DataTable dtparmSelect = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                dtparmSelect.Rows.Add(new object[] { "V_BIZ_CODE", strBizCode });
                dtparmSelect.Rows.Add(new object[] { "V_RECE_NO", strReceNo });
                dtparmSelect.Rows.Add(new object[] { "V_RECE_SALE_DATE_FROM", strReceSaleDateFrom });
                dtparmSelect.Rows.Add(new object[] { "V_RECE_SALE_DATE_TO", strReceSaleDateTo });
                dtparmSelect.Rows.Add(new object[] { "V_RECE_CODE", strReceCode });
                dtparmSelect.Rows.Add(new object[] { "V_MEMBER_NO_NAME", strMemberNoName });
                dtparmSelect.Rows.Add(new object[] { "V_ANNUAL", strAnnual });
                dtparmSelect.Rows.Add(new object[] { "V_CAP_MEMBER_NO_NAME", strCapMemberNoName });
                dtparmSelect.Rows.Add(new object[] { "V_EXAT_CALC_YN", strExat_CalcYN });

                dt.Clear();
                DataSet ds = DataLayer.ExecuteSpDataset("PKG_JFRAS01.PR_01", dtparmSelect, DataLayer.MessageEncoding.Default);

                if (ds.Tables[0].Rows.Count <= 0)
                {
                    Basic.ShowMessage(1, "데이터가 존재 하지 않습니다.");
                    return;
                }

                DataTable tmpDt = ds.Tables[0];

                int intRowCnt = tmpDt.Rows.Count;
                for (int i = 0; i < intRowCnt; i++)
                {
                    if (tmpDt.Rows[i]["GROUP_SEQ"].ToString().Trim() == "0")
                    {
                        tmpDt.Rows[i]["ANNUAL"]         = "";
                        tmpDt.Rows[i]["CAP_MEMBER_SEQ"] = "";
                        tmpDt.Rows[i]["GROUP_SEQ"]      = DBNull.Value;
                    }
                }

                dt.Load(tmpDt.CreateDataReader());
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                Basic.SetCursor(this, true);
                Basic.LoadParentFunction(this, "", false);
            }
        }
예제 #55
0
        public virtual bool MessageRequestHandler(byte[] receivedMessage)
        {
            //Console.WriteLine("\n   _z_ [" + this.NodeId + "]  " + (this.DeviceHandler != null ? this.DeviceHandler.ToString() : "!" + this.GenericClass.ToString()));
            //Console.WriteLine("   >>> " + zp.ByteArrayToString(receivedMessage) + "\n");

            ZWaveEvent messageEvent  = null;
            int        messageLength = receivedMessage.Length;

            if (messageLength > 8)
            {
                //byte commandLength = receivedMessage[6];
                byte commandClass = receivedMessage[7];
                switch (commandClass)
                {
                case (byte)CommandClass.Basic:
                    messageEvent = Basic.GetEvent(this, receivedMessage);
                    break;

                case (byte)CommandClass.Alarm:
                    messageEvent = Alarm.GetEvent(this, receivedMessage);
                    break;

                case (byte)CommandClass.SensorAlarm:
                    messageEvent = SensorAlarm.GetEvent(this, receivedMessage);
                    break;

                case (byte)CommandClass.SceneActivation:
                    messageEvent = SceneActivation.GetEvent(this, receivedMessage);
                    break;

                case (byte)CommandClass.SwitchBinary:
                    messageEvent = SwitchBinary.GetEvent(this, receivedMessage);
                    break;

                case (byte)CommandClass.SwitchMultilevel:
                    messageEvent = SwitchMultilevel.GetEvent(this, receivedMessage);
                    break;

                case (byte)CommandClass.SensorBinary:
                    messageEvent = SensorBinary.GetEvent(this, receivedMessage);
                    break;

                case (byte)CommandClass.SensorMultilevel:
                    messageEvent = SensorMultilevel.GetEvent(this, receivedMessage);
                    break;

                case (byte)CommandClass.Meter:
                    messageEvent = Meter.GetEvent(this, receivedMessage);
                    break;

                case (byte)CommandClass.ThermostatMode:
                case (byte)CommandClass.ThermostatFanMode:
                case (byte)CommandClass.ThermostatFanState:
                case (byte)CommandClass.ThermostatHeating:
                case (byte)CommandClass.ThermostatOperatingState:
                case (byte)CommandClass.ThermostatSetBack:
                case (byte)CommandClass.ThermostatSetPoint:
                    messageEvent = Thermostat.GetEvent(this, receivedMessage);
                    break;

                case (byte)CommandClass.UserCode:
                    messageEvent = UserCode.GetEvent(this, receivedMessage);
                    break;

                case (byte)CommandClass.Association:
                    messageEvent = Association.GetEvent(this, receivedMessage);
                    break;

                case (byte)CommandClass.Configuration:
                    messageEvent = Configuration.GetEvent(this, receivedMessage);
                    break;

                case (byte)CommandClass.WakeUp:
                    messageEvent = WakeUp.GetEvent(this, receivedMessage);
                    break;

                case (byte)CommandClass.Battery:
                    messageEvent = Battery.GetEvent(this, receivedMessage);
                    break;

                case (byte)CommandClass.Hail:
                    Basic.Get(this);
                    break;

                case (byte)CommandClass.MultiInstance:
                    messageEvent = MultiInstance.GetEvent(this, receivedMessage);
                    break;

                case (byte)CommandClass.ManufacturerSpecific:
                    messageEvent = ManufacturerSpecific.GetEvent(this, receivedMessage);
                    if (messageEvent != null)
                    {
                        var specs = (ManufacturerSpecificInfo)messageEvent.Value;
                        this.ManufacturerId = specs.ManufacturerId;
                        this.TypeId         = specs.TypeId;
                        this.ProductId      = specs.ProductId;
                        if (ManufacturerSpecificResponse != null)
                        {
                            try
                            {
                                ManufacturerSpecificResponse(this, new ManufacturerSpecificResponseEventArg()
                                {
                                    NodeId = this.NodeId,
                                    ManufacturerSpecific = specs
                                });
                            }
                            catch (Exception ex)
                            {
                                Console.WriteLine("ZWaveLib: Error during ManufacturerSpecificResponse callback, " + ex.Message + "\n" + ex.StackTrace);
                            }
                        }
                    }

                    break;
                }
            }

            if (messageEvent != null)
            {
                this.RaiseUpdateParameterEvent(messageEvent.Instance, messageEvent.Event, messageEvent.Value);
            }
            else if (messageLength > 3)
            {
                if (receivedMessage[3] != 0x13)
                {
                    bool log = true;
                    if (messageLength > 7 && /* cmd_class */ receivedMessage[7] == (byte)CommandClass.ManufacturerSpecific)
                    {
                        log = false;
                    }
                    if (log)
                    {
                        Console.WriteLine("ZWaveLib UNHANDLED message: " + Utility.ByteArrayToString(receivedMessage));
                    }
                }
            }

            return(false);
        }
예제 #56
0
        /// <summary>
        /// 삭제 함수
        /// </summary>
        private void Deletes()
        {
            try
            {
                ///TDDO:[영업장별우대할인]삭제
                ///
                //유효성 검사후 실행합니다.
                if (!ISCheckData(JobStyle.DELETE))
                {
                    return;
                }
                Basic.SetCursor(this, false);
                Basic.LoadParentFunction(this, "삭제 중 입니다..", true);

                int iRowm = this.gridView2.GetDataSourceRowIndex(this.gridView2.FocusedRowHandle);
                int iRow  = this.gridView1.GetDataSourceRowIndex(this.gridView1.FocusedRowHandle);

                string DCCouponNo = dt.Rows[iRow]["DCCOUPON_NO"].ToString().Trim();
                string Keyseq     = dtDetail.Rows[iRowm]["KEY_SEQ"].ToString().Trim();
                string dcnofrom   = dtDetail.Rows[iRowm]["DC_NO_FROM"].ToString().Trim();
                string dcnoto     = dtDetail.Rows[iRowm]["DC_NO_TO"].ToString().Trim();

                //삭제함수를 구현합니다.
                //만약 변수가 필요없다면 아래 코드를 삭제 하세요
                DataTable dtparmDelete = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);
                dtparmDelete.Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                dtparmDelete.Rows.Add(new object[] { "V_DCCOUPON_NO", DCCouponNo });
                dtparmDelete.Rows.Add(new object[] { "V_KEY_SEQ", Keyseq });
                dtparmDelete.Rows.Add(new object[] { "V_DC_NO_FROM", dcnofrom });
                dtparmDelete.Rows.Add(new object[] { "V_DC_NO_TO", dcnoto });


                //프로시져를 호출하여 결과를 리턴 받는다.
                //만약 output 값이 여러개라면 '|' (파이프) 값으로 구분하여 들어온다.
                //Split 함수로 짤라서 사용한다.
                string Result = DataLayer.ExecuteSpScala("PKG_JDAAI05.PR_20", dtparmDelete, DataLayer.MessageEncoding.Default);

                //프로시져 에러라면 빠져나간다.
                if (Result.Trim() != "OK")
                {
                    Basic.ShowMessage(3, Result);
                    return;
                }

                int row = this.gridView1.FocusedRowHandle;

                //삭제한 데이터를 조회 를 합니다...
                Selects(false);


                if (this.gridView1.RowCount > 0)
                {
                    if (row <= this.gridView1.RowCount - 1)
                    {
                        this.gridView1.FocusedRowHandle = row;
                    }
                    else
                    {
                        this.gridView1.FocusedRowHandle = gridView1.RowCount - 1;
                    }
                }

                Basic.ShowMessage(1, "삭제 하였습니다.");
            }
            catch (Exception ex)
            {
                Basic.ShowMessage(3, ex.Message);
            }
            finally
            {
                Basic.SetCursor(this, true);
                Basic.LoadParentFunction(this, "", false);
            }
        }
예제 #57
0
        /// <summary>
        /// 입력함수
        /// </summary>
        private void Inserts()
        {
            try
            {
                ///TDDO:[일일마감]입력
                //유효성검사 후 사용
                if (!ISCheckData(JobStyle.INSERT))
                {
                    return;
                }
                //에니메이션 과 커서의 모양을 바궈준다.
                Basic.SetCursor(this, false);
                Basic.LoadParentFunction(this, "마감입력 중 입니다..", true);

                int       iRow  = gridView.GetDataSourceRowIndex(gridView.FocusedRowHandle);
                DataTable dtTmp = grid.DataSource as DataTable;

                string saledate = dtTmp.Rows[iRow]["SALE_DATE"].ToString().Trim();

                //입력함수를 구현합니다.
                //만약 변수가 필요없다면 아래 코드를 삭제 하세요
                DataTable dtparmInsert = DataLayer.GetDataTableParameter(DataLayer.DatatableStyle.Parameter);

                dtparmInsert.Rows.Add(new object[] { "V_SALE_DATE", saledate });
                dtparmInsert.Rows.Add(new object[] { "V_BIZ_CODE", Parm.CurrentUserInformation.BizInfo.BizCode });
                dtparmInsert.Rows.Add(new object[] { "V_EMP_NO", Parm.CurrentUserInformation.id });
                dtparmInsert.Rows.Add(new object[] { "V_IP", Parm.CurrentUserInformation.ip });


                //프로시져를 호출하여 결과를 리턴 받는다.
                //만약 output 값이 여러개라면 '|' (파이프) 값으로 구분하여 들어온다.
                //Split 함수로 짤라서 사용한다.
                string Result = DataLayer.ExecuteSpScala("PKG_AZACI03.PR_10", dtparmInsert, DataLayer.MessageEncoding.Default);

                //프로시져 에러라면 빠져나간다.
                if (Result.Trim() != "OK")
                {
                    Basic.ShowMessage(3, Result);
                    return;
                }

                //입력한 데이터를 조회 를 합니다...
                Selects(false);

                // 조회 가 끝난 후 입력한 데이터를 선택합니다.
                DevExpress.XtraGrid.Columns.GridColumn[] cols;
                object[] obj;
                cols = new GridColumn[] { this.gridView.Columns["SALE_DATE"] };
                obj  = new object[] { saledate };

                //데이터를 선택합니다.
                Cls.Grid.Options.SelectGridRow(this.gridView, cols, obj);

                Basic.ShowMessage(1, "마감입력 하였습니다.");
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                Basic.SetCursor(this, true);
                Basic.LoadParentFunction(this, "", false);
            }
        }
예제 #58
0
        /// <summary>
        /// Please put {id: 2, name: 'abc', color: 'Magenta'}
        /// </summary>
        /// <param name='complexBody'>
        /// Please put {id: 2, name: 'abc', color: 'Magenta'}
        /// </param>
        /// <param name='customHeaders'>
        /// Headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        public async Task <HttpOperationResponse> PutValidWithHttpMessagesAsync(Basic complexBody, Dictionary <string, List <string> > customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (complexBody == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "complexBody");
            }
            // Tracing
            bool   shouldTrace  = ServiceClientTracing.IsEnabled;
            string invocationId = null;

            if (shouldTrace)
            {
                invocationId = ServiceClientTracing.NextInvocationId.ToString();
                Dictionary <string, object> tracingParameters = new Dictionary <string, object>();
                tracingParameters.Add("complexBody", complexBody);
                tracingParameters.Add("cancellationToken", cancellationToken);
                ServiceClientTracing.Enter(invocationId, this, "PutValid", tracingParameters);
            }
            // Construct URL
            var url = new Uri(this.Client.BaseUri, "/complex/basic/valid").ToString();
            // Create HTTP transport objects
            HttpRequestMessage httpRequest = new HttpRequestMessage();

            httpRequest.Method     = new HttpMethod("PUT");
            httpRequest.RequestUri = new Uri(url);
            // Set Headers
            if (customHeaders != null)
            {
                foreach (var header in customHeaders)
                {
                    if (httpRequest.Headers.Contains(header.Key))
                    {
                        httpRequest.Headers.Remove(header.Key);
                    }
                    httpRequest.Headers.TryAddWithoutValidation(header.Key, header.Value);
                }
            }

            // Serialize Request
            string requestContent = JsonConvert.SerializeObject(complexBody, this.Client.SerializationSettings);

            httpRequest.Content = new StringContent(requestContent, Encoding.UTF8);
            httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
            // Send Request
            if (shouldTrace)
            {
                ServiceClientTracing.SendRequest(invocationId, httpRequest);
            }
            cancellationToken.ThrowIfCancellationRequested();
            HttpResponseMessage httpResponse = await this.Client.HttpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false);

            if (shouldTrace)
            {
                ServiceClientTracing.ReceiveResponse(invocationId, httpResponse);
            }
            HttpStatusCode statusCode = httpResponse.StatusCode;

            cancellationToken.ThrowIfCancellationRequested();
            if (!(statusCode == (HttpStatusCode)Enum.Parse(typeof(HttpStatusCode), "OK")))
            {
                var    ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", statusCode));
                string responseContent = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);

                Error errorBody = JsonConvert.DeserializeObject <Error>(responseContent, this.Client.DeserializationSettings);
                if (errorBody != null)
                {
                    ex.Body = errorBody;
                }
                ex.Request  = httpRequest;
                ex.Response = httpResponse;
                if (shouldTrace)
                {
                    ServiceClientTracing.Error(invocationId, ex);
                }
                throw ex;
            }
            // Create Result
            var result = new HttpOperationResponse();

            result.Request  = httpRequest;
            result.Response = httpResponse;
            if (shouldTrace)
            {
                ServiceClientTracing.Exit(invocationId, result);
            }
            return(result);
        }