示例#1
0
        static void Main(string[] args)
        {
            CommonManager jinli = new CommonManager("金立");
            Majordomo zongjian = new Majordomo("中坚");
            GeneralManager zhongjingli = new GeneralManager("仲景离");
            jinli.SetSuperior(zongjian);
            zongjian.SetSuperior(zhongjingli);

            Request request1 = new Request
            {
                RequestType = "请假",
                RequestContent = "小菜请假",
                Number = 1
            };
            jinli.RequestApplications(request1);

            Request request2 = new Request
            {
                RequestType = "请假",
                RequestContent = "小菜请假",
                Number = 4
            };
            jinli.RequestApplications(request2);

            Request request3 = new Request
            {
                RequestType = "加薪",
                RequestContent = "小菜请求加薪",
                Number = 500
            };
            jinli.RequestApplications(request3);

            Request request4 = new Request
            {
                RequestType = "加薪",
                RequestContent = "小菜请求加薪",
                Number = 1000
            };
            jinli.RequestApplications(request4);
        }
        void ResetElementMembersList()
        {
            ElementViewTools evtools = new ElementViewTools(SelectedJsonElement.jo);

            JArray ja_member = SelectedJsonElement.jo ["Member"] as JArray;

            ElementMembersList = new ReorderableList(ja_member, typeof(JToken));
            ElementMembersList.drawHeaderCallback += (Rect rect) => {
                GUI.Label(rect, "Members in Element");
            };
            float[] split   = new float[] { 0f, .2f, .6f, 1f, 1.2f };
            float[] split_c = new float[] { 0f, .3f, .6f, .9f, .95f, 1f };

            ElementMembersList.drawElementCallback += (Rect rect, int index, bool isActive, bool isFocused) => {
                JObject jo_member = ja_member [index] as JObject;

                Rect r = new Rect(rect);
                r.y      += 2;
                r.height -= 4;
                int split_idx = 0;
                r.x     = (rect.width - 25f) * split [split_idx] + 25f;
                r.width = (rect.width - 25f) * (split [split_idx + 1] - split [split_idx]) - 2f;

                if (!ShowDesc && jo_member ["Desc"].Value <string> ().Contains("#"))
                {
                    GUI.Label(r, jo_member ["Desc"].Value <string> ().Split(new char[] { '#' }) [0] + "(" + jo_member ["RxType"].Value <string> ().Substring(0, 3).ToUpper() + ")", GUIStyleTemplate.GreenDescStyle());
                }
                else
                {
                    GUI.Label(r, jo_member ["RxType"].Value <string> ());
                }

                split_idx++;
                r.x     = (rect.width - 25f) * split [split_idx] + 25f;
                r.width = (rect.width - 25f) * (split [split_idx + 1] - split [split_idx]) - 2f;

                string new_member_name = GUI.TextField(r, jo_member ["Name"].Value <string> ());
                if (new_member_name != jo_member ["Name"].Value <string> ())
                {
                    evtools.ChangeName(jo_member ["Name"].Value <string> (), new_member_name);
                    jo_member ["Name"] = new_member_name;
                }

                if (jo_member ["RxType"].Value <string> () != "Command")
                {
                    split_idx++;
                    r.x                = (rect.width - 25f) * split [split_idx] + 25f;
                    r.width            = (rect.width - 25f) * (split [split_idx + 1] - split [split_idx]) - 2f;
                    jo_member ["Type"] = GUI.TextField(r, jo_member ["Type"].Value <string> ());

                    string jo_member_type = jo_member ["Type"].Value <string> ();

                    if (jo_member ["RxType"].Value <string> () == "Dictionary")
                    {
                        string[] dic_type_split = jo_member_type.Split(new char[] { ',' });
                        if (dic_type_split.Length == 2)
                        {
                            jo_member_type = dic_type_split [1];
                        }
                    }

                    TypeType?tt = PGFrameTools.GetTypeTypeByType(jo_member_type);
                    if (tt.HasValue && pgf_typetype_short_icons != null && pgf_typetype_short_icons.ContainsKey(tt.Value))
                    {
                        split_idx++;
                        r.x     = (rect.width - 25f) * split [split_idx] + 25f;
                        r.width = (rect.width - 25f) * (split [split_idx + 1] - split [split_idx]) - 2f;
                        GUI.Label(r, this.pgf_typetype_short_icons [tt.Value]);
                    }
                    else
                    {
                        string[] ts          = jo_member ["Type"].Value <string> ().Split(new char[] { '.' });
                        string   workspace   = "";
                        string   single_name = "";
                        if (ts.Length == 1)
                        {
                            workspace   = PGFrameWindow.Current.SelectedWorkspace.Name;
                            single_name = ts [0];
                        }
                        else if (ts.Length == 2)
                        {
                            workspace   = ts [0];
                            single_name = ts [1];
                        }

                        DocType?dt = CommonManager.GetTheDocTypeByName(workspace, single_name);
                        if (dt.HasValue && pgf_doctype_short_icons != null && pgf_doctype_short_icons.ContainsKey(dt.Value))
                        {
                            split_idx++;
                            r.x     = (rect.width - 25f) * split [split_idx] + 25f;
                            r.width = (rect.width - 25f) * (split [split_idx + 1] - split [split_idx]) - 2f;
                            GUI.Label(r, this.pgf_doctype_short_icons [dt.Value]);
                        }
                    }

                    if (ShowDesc)
                    {
                        r.y                = rect.y + singleRowHeight - 6f;
                        r.x                = (rect.width - 25f) * split [1] + 25f;
                        r.width            = (rect.width - 25f) * (split [3] - split [1]) - 2f;
                        jo_member ["Desc"] = GUI.TextField(r, jo_member ["Desc"].Value <string> (), GUIStyleTemplate.GreenDescStyle());
                    }
                }
                else
                {
                    split_idx++;
                    r.x     = (rect.width - 25f) * split [split_idx] + 25f;
                    r.width = (rect.width - 25f) * (split [split_idx + 1] - split [split_idx]) - 2f;

                    JArray ja_command_params = jo_member ["Params"] as JArray;

                    if (GUI.Button(r, "+", GUIStyleTemplate.BlackCommandLink()))
                    {
                        if (ja_command_params == null)
                        {
                            jo_member.Add("Params", new JArray());
                            ja_command_params = jo_member ["Params"] as JArray;
                        }
                        JObject jo_command_param = new JObject();
                        jo_command_param.Add("Name", string.Format("Param{0}", ja_command_params.Count));
                        jo_command_param.Add("Type", "object");
                        jo_command_param.Add("Desc", "");
                        ja_command_params.Add(jo_command_param);
                    }

                    if (ShowDesc)
                    {
                        r.y                = rect.y + singleRowHeight - 6f;
                        r.x                = (rect.width - 25f) * split [1] + 25f;
                        r.width            = (rect.width - 25f) * (split [3] - split [1]) - 2f;
                        jo_member ["Desc"] = GUI.TextField(r, jo_member ["Desc"].Value <string> (), GUIStyleTemplate.GreenDescStyle());
                    }

                    float show_desc_height_amplify = 1f;
                    if (ShowDesc)
                    {
                        show_desc_height_amplify = 2f;
                    }

                    if (ja_command_params != null)
                    {
                        for (int i = 0; i < ja_command_params.Count; i++)
                        {
                            int split_c_idx = 0;
                            r.y = rect.y + (singleRowHeight_c * (float)(i + 1)) * show_desc_height_amplify;
                            JObject jo_command_param = ja_command_params [i] as JObject;

                            split_c_idx = 0;
                            r.x         = (rect.width - 25f) * split_c [split_c_idx] + 25f;
                            r.width     = (rect.width - 25f) * (split_c [split_c_idx + 1] - split_c [split_c_idx]) - 2f;

                            if (!ShowDesc && jo_command_param ["Desc"].Value <string> ().Contains("#"))
                            {
                                GUI.Label(r, "  - " + jo_command_param ["Desc"].Value <string> ().Split(new char[] { '#' }) [0] + "(P" + i + ")", GUIStyleTemplate.GreenDescStyle());
                            }
                            else
                            {
                                GUI.Label(r, "  - Command Params");
                            }

                            split_c_idx = 1;
                            r.x         = (rect.width - 25f) * split_c [split_c_idx] + 25f;
                            r.width     = (rect.width - 25f) * (split_c [split_c_idx + 1] - split_c [split_c_idx]) - 2f;
                            string new_name = GUI.TextField(r, jo_command_param ["Name"].Value <string> ());
                            if (new_name != jo_command_param ["Name"].Value <string> ())
                            {
                                jo_command_param ["Name"] = new_name;
                            }

                            split_c_idx = 2;
                            r.x         = (rect.width - 25f) * split_c [split_c_idx] + 25f;
                            r.width     = (rect.width - 25f) * (split_c [split_c_idx + 1] - split_c [split_c_idx]) - 2f;
                            jo_command_param ["Type"] = GUI.TextField(r, jo_command_param ["Type"].Value <string> ());

                            split_c_idx = 3;
                            r.x         = (rect.width - 25f) * split_c [split_c_idx] + 25f;
                            r.width     = (rect.width - 25f) * (split_c [split_c_idx + 1] - split_c [split_c_idx]) - 2f;
                            if (GUI.Button(r, "-", GUIStyleTemplate.BlackCommandLink()))
                            {
                                ja_command_params.RemoveAt(i);
                                return;
                            }

                            if (i != 0)
                            {
                                split_c_idx = 4;
                                r.x         = (rect.width - 25f) * split_c [split_c_idx] + 25f;
                                r.width     = (rect.width - 25f) * (split_c [split_c_idx + 1] - split_c [split_c_idx]) - 2f;
                                if (GUI.Button(r, "^", GUIStyleTemplate.BlackCommandLink()))
                                {
                                    JObject jo0 = ja_command_params [i] as JObject;
                                    JObject jo1 = ja_command_params [i - 1] as JObject;
                                    ja_command_params [i]     = jo1;
                                    ja_command_params [i - 1] = jo0;
                                }
                            }

                            if (ShowDesc)
                            {
                                r.y     = rect.y + (singleRowHeight_c * (float)(i + 1)) * show_desc_height_amplify + singleRowHeight_c - 2f;
                                r.x     = (rect.width - 25f) * split_c [1] + 25f;
                                r.width = (rect.width - 25f) * (split_c [3] - split_c [1]) - 2f;
                                jo_command_param ["Desc"] = GUI.TextField(r, jo_command_param ["Desc"].Value <string> (), GUIStyleTemplate.GreenDescStyle());
                            }
                        }
                    }
                }
            };
            ElementMembersList.elementHeightCallback += (int index) => {
                return(CalcHeight(index));
            };
            ElementMembersList.showDefaultBackground = false;

            ElementMembersList.drawElementBackgroundCallback += (Rect rect, int index, bool isActive, bool isFocused) => {
                if (Event.current.type == EventType.Repaint)
                {
                    Color color = GUI.backgroundColor;
                    if (ShowDesc)
                    {
                        if (isActive)
                        {
                            GUI.backgroundColor = Color.yellow;
                        }
                        if (isFocused)
                        {
                            GUI.backgroundColor = Color.cyan;
                        }
                        GUI.skin.box.Draw(new Rect(rect.x + 2f, rect.y, rect.width - 4f, CalcHeight(index) - 4f), false, isActive, isFocused, false);
                        GUI.backgroundColor = color;
                    }
                    else
                    {
                        if (isFocused)
                        {
                            GUI.backgroundColor = Color.cyan;
                            GUI.skin.box.Draw(new Rect(rect.x + 2f, rect.y, rect.width - 4f, CalcHeight(index) - 4f), false, isActive, isFocused, false);
                            GUI.backgroundColor = color;
                        }
                    }
                }
            };

            ElementMembersList.onAddCallback += (ReorderableList list) => {
                GenericMenu menu = new GenericMenu();
                foreach (RxType rt in Enum.GetValues(typeof(RxType)))
                {
                    menu.AddItem(new GUIContent(rt.ToString()), false, GenericElementMenuOnAddCallback, rt);
                }
                menu.ShowAsContext();
            };
            ElementMembersList.onRemoveCallback += (ReorderableList list) => {
                JObject jo_member = ja_member [list.index] as JObject;
//				string element_rxtype = jo_member ["RxType"].Value<string> ();
                string element_name = jo_member ["Name"].Value <string> ();
                ja_member.RemoveAt(list.index);
                evtools.DeleteMember(element_name);
            };
        }
示例#3
0
    protected void btnDelivaryChalan_Click(object sender, EventArgs e)
    {
        makeAllTheLinkInvisible();
        hlnkLinkForDelivaryChalan.Visible = true;

        string sql = "Select Pos_TransactionMasterID from Pos_TransactionMaster where TransactionID=" + txtID.Text + " and Pos_TransactionTypeID=" + rbtnTransactionType.SelectedValue;

        hlnkLinkForDelivaryChalan.NavigateUrl = "DelivaryChalanPrint.aspx?Pos_TransactionMasterID=" + CommonManager.SQLExec(sql).Tables[0].Rows[0][0].ToString();
    }
示例#4
0
        /// <summary>
        /// Copies or moves the email to folder.
        /// </summary>
        /// <param name="format">The format.</param>
        private void CopyOrMoveEmailToFolder(SaveFormatOverride format) // JOEL JEFFERY 20110708 added SaveFormatOverride format
        {
            if (DragDropTargetNode == null)
            {
                return;
            }

            EUFolder dragedFolder = DragDropTargetNode.Tag as EUFolder;

            if (dragedFolder == null)
            {
                return;
            }

            SharePointListViewControl sharePointListViewControl = GetCurrentSharePointExplorerPane().sharePointListViewControl;

            if (sharePointListViewControl.SelectedFolder == null || sharePointListViewControl.SelectedFolder.UniqueIdentifier != dragedFolder.UniqueIdentifier || sharePointListViewControl.SelectedFolder.Title != dragedFolder.Title)
            {
                sharePointListViewControl = null;
            }

            emailItems = new List <MailItem>();

            if (DragDropArgs.Data.GetDataPresent("RenPrivateSourceFolder") == false) // if it's not a folder???
            {
                // JON SILVER SAYS... I've never been able to get this bit to fire... therefore under exactly what circumstances would e.Data.GetDataPresent("RenPrivateSourceFolder") == false ??
                emailItems.Add(Application.ActiveExplorer().Selection[1] as Outlook.MailItem);
            }
            else
            {
                // JON SILVER SAYS... we always seem to end up here regardless of what's dropped
                for (int i = 0; i < Application.ActiveExplorer().Selection.Count; i++)
                {
                    Outlook.MailItem item = Application.ActiveExplorer().Selection[i + 1] as Outlook.MailItem;
                    emailItems.Add(item);
                }
            }

            bool isListItemAndAttachmentMode      = false;
            EUFieldInformations fieldInformations = null;
            EUFieldCollection   fields            = null;

            if (dragedFolder as EUFolder != null && ((EUFolder)dragedFolder).IsDocumentLibrary == false)
            {
                if (((EUFolder)dragedFolder).EnableAttachments == false)
                {
                    MessageBox.Show("In order to upload email, you need to enable attachment feature in this list.");
                    return;
                }
                isListItemAndAttachmentMode = true;
            }

            List <EUEmailUploadFile> emailUploadFiles = CommonManager.GetEmailUploadFiles(emailItems, DragDropArgs, isListItemAndAttachmentMode, format);

            // JON SILVER JUNE 2011
            if (!addedEventHandler)
            {
                EUEmailManager.UploadFailed    += new EventHandler(SharePointOutlookConnector_UploadFailed);
                EUEmailManager.UploadSucceeded += new EventHandler(SharePointOutlookConnector_UploadSucceeded);
                addedEventHandler = true;
            }

            // JOEL JEFFERY 20110712
            try
            {
                // JON SILVER JUNE 2011
                EUEmailManager.UploadEmail(sharePointListViewControl, dragedFolder, DragDropArgs, emailUploadFiles, isListItemAndAttachmentMode);
            }
            catch (System.Exception ex)
            {
                if (UploadFailed != null)
                {
                    UploadFailed(this, new EventArgs());
                }
                throw ex;
            }
        }
示例#5
0
        protected override void CreateDrawTextListMain(List <List <Tuple <Brush, GlyphRun> > > textDrawLists)
        {
            var        ItemFontNormal  = ItemFontCache.ItemFont(Settings.Instance.TunerFontName, false);
            var        ItemFontTitle   = ItemFontCache.ItemFont(Settings.Instance.TunerFontNameService, Settings.Instance.TunerFontBoldService);
            EpgSetting set             = Settings.Instance.EpgSettingList.FirstOrDefault(s => s.ApplyReplacePatternTuner);
            var        DictionaryTitle = set != null?CommonManager.GetReplaceDictionaryTitle(set) : null;

            bool recSettingInfo = PopUpMode == true ? Settings.Instance.TunerPopupRecinfo : false;
            bool noWrap         = PopUpMode == true ? false : Settings.Instance.TunerServiceNoWrap;

            double sizeTitle   = Settings.Instance.TunerFontSizeService;
            double sizeMin     = Math.Max(sizeTitle - 1, Math.Min(sizeTitle, Settings.Instance.TunerFontSize));
            double sizeNormal  = Settings.Instance.TunerFontSize;
            double indentTitle = recSettingInfo ? 0 : sizeMin *CulcRenderWidth("0", ItemFontNormal) * (2 + sizeTitle / sizeMin);

            double indentHours = sizeMin * CulcRenderWidth("00:", ItemFontNormal);//番組表とは異なるインデントの入れ方にする
            double indentService;
            double indentNormal = Settings.Instance.TunerTitleIndent ? indentTitle : 0;
            Brush  colorNormal  = Settings.BrushCache.CustTunerTextColor;

            //録画中のものを後で描画する
            Items = Items.Cast <TunerReserveViewItem>().OrderBy(info => info.Data.IsOnRec()).ToList();

            foreach (TunerReserveViewItem info in Items)
            {
                var textDrawList = new List <Tuple <Brush, GlyphRun> >();
                textDrawLists.Add(textDrawList);
                Rect   drawRect  = TextRenderRect(info);
                double useHeight = 0;
                indentService = indentTitle;

                //追加情報の表示
                if (recSettingInfo == true)
                {
                    var    resItem = new ReserveItem(info.Data);
                    string text    = info.Status;
                    if (text != "")
                    {
                        useHeight = sizeNormal / 5 + RenderText(textDrawList, text, ItemFontNormal, sizeNormal, drawRect, 0, 0, resItem.StatusColor);
                    }

                    text       = resItem.StartTimeShort;
                    text      += "\r\n" + "優先度 : " + resItem.Priority;
                    text      += "\r\n" + "録画モード : " + resItem.RecMode;
                    useHeight += sizeNormal / 2 + RenderText(textDrawList, text, ItemFontNormal, sizeNormal, drawRect, 0, useHeight, info.ServiceColor);
                }
                else
                {
                    //分のみ
                    RenderText(textDrawList, (info.DrawHours ? new DateTime28(info.Data.StartTime).HourMod.ToString("00:") : "") + info.Data.StartTime.ToString("mm"), ItemFontNormal, sizeMin, drawRect, 0, 0, info.ServiceColor);
                    indentService += info.DrawHours ? indentHours : 0;
                }

                //サービス名
                string serviceName = info.Data.StationName + "(" + CommonManager.ConvertNetworkNameText(info.Data.OriginalNetworkID) + ")";
                serviceName = CommonManager.ReplaceText(serviceName, DictionaryTitle);
                useHeight  += sizeTitle / 3 + RenderText(textDrawList, serviceName, ItemFontTitle, sizeTitle, drawRect, indentService, useHeight, info.ServiceColor, noWrap);

                //番組名
                if (useHeight < drawRect.Height)
                {
                    string title = CommonManager.ReplaceText(info.Data.Title.TrimEnd(), DictionaryTitle);
                    if (title != "")
                    {
                        useHeight += sizeNormal / 3 + RenderText(textDrawList, title, ItemFontNormal, sizeNormal, drawRect, indentNormal, useHeight, colorNormal);
                    }
                }

                SaveMaxRenderHeight(useHeight);
            }
        }
示例#6
0
        public void SaveSetting()
        {
            //0 全般
            IniFileHandler.WritePrivateProfileString("SET", "ResidentMode",
                                                     checkBox_srvResident.IsChecked == false ? 0 : checkBox_srvShowTray.IsChecked == false ? 1 : 2, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "BlinkPreRec", checkBox_blinkPreRec.IsChecked, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "NoBalloonTip", checkBox_srvNoBalloonTip.IsChecked, SettingPath.TimerSrvIniPath);

            IniFileHandler.WritePrivateProfileString("SET", "SaveNotifyLog", checkBox_srvSaveNotifyLog.IsChecked, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "SaveDebugLog", checkBox_srvSaveDebugLog.IsChecked, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "TSExt", SettingPath.CheckTSExtension(textBox_tsExt.Text), SettingPath.TimerSrvIniPath);

            //1 録画動作
            IniFileHandler.WritePrivateProfileString("SET", "RecEndMode", recEndModeRadioBtns.Value, -1, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "Reboot", checkBox_reboot.IsChecked, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "WakeTime", textBox_pcWakeTime.Text, SettingPath.TimerSrvIniPath);

            List <String> ngProcessList = listBox_process.Items.OfType <string>().ToList();

            IniFileHandler.WritePrivateProfileString("NO_SUSPEND", "Count", ngProcessList.Count, SettingPath.TimerSrvIniPath);
            IniFileHandler.DeletePrivateProfileNumberKeys("NO_SUSPEND", SettingPath.TimerSrvIniPath);
            for (int i = 0; i < ngProcessList.Count; i++)
            {
                IniFileHandler.WritePrivateProfileString("NO_SUSPEND", i.ToString(), ngProcessList[i], SettingPath.TimerSrvIniPath);
            }

            IniFileHandler.WritePrivateProfileString("NO_SUSPEND", "NoStandbyTime", textBox_ng_min.Text, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("NO_SUSPEND", "NoUsePC", checkBox_ng_usePC.IsChecked, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("NO_SUSPEND", "NoUsePCTime", textBox_ng_usePC_min.Text, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("NO_SUSPEND", "NoFileStreaming", checkBox_ng_fileStreaming.IsChecked, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("NO_SUSPEND", "NoShareFile", checkBox_ng_shareFile.IsChecked, SettingPath.TimerSrvIniPath);

            IniFileHandler.WritePrivateProfileString("SET", "StartMargin", settings.DefStartMargin, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "EndMargin", settings.DefEndMargin, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "RecMinWake", checkBox_appMin.IsChecked, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "RecView", checkBox_appView.IsChecked, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "DropLog", checkBox_appDrop.IsChecked, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "PgInfoLog", checkBox_addPgInfo.IsChecked, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "PgInfoLogAsUtf8", checkBox_PgInfoLogAsUtf8.IsChecked, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "RecNW", checkBox_appNW.IsChecked, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "KeepDisk", checkBox_appKeepDisk.IsChecked, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "RecOverWrite", checkBox_appOverWrite.IsChecked, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "ProcessPriority", comboBox_process.SelectedIndex, SettingPath.TimerSrvIniPath);

            //これらはiniファイルのパラメータと同じ扱い
            Settings.Instance.RecAppWakeTime = MenuUtil.MyToNumerical(textBox_appWakeTime, Convert.ToInt32, Int32.MaxValue, 0, Settings.Instance.RecAppWakeTime);
            Settings.Instance.WakeUpHdd      = checkBox_wakeUpHdd.IsChecked == true;
            if (Settings.Instance.WakeUpHdd == false)
            {
                CommonManager.WakeUpHDDLogClear();
            }
            Settings.Instance.NoWakeUpHddMin      = MenuUtil.MyToNumerical(textBox_noWakeUpHddMin, Convert.ToInt32, Int32.MaxValue, 0, Settings.Instance.NoWakeUpHddMin);
            Settings.Instance.WakeUpHddOverlapNum = checkBox_onlyWakeUpHddOverlap.IsChecked == true ? 1 : 0;

            //2 予約管理情報
            IniFileHandler.WritePrivateProfileString("SET", "BackPriority", checkBox_back_priority.IsChecked, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "FixedTunerPriority", checkBox_fixedTunerPriority.IsChecked, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "RecInfoFolderOnly", checkBox_recInfoFolderOnly.IsChecked, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "RecInfo2RegExp", text_RecInfo2RegExp.Text, "", SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "AutoDelRecInfo", checkBox_autoDelRecInfo.IsChecked, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "AutoDelRecInfoNum", textBox_autoDelRecInfo.Text, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "RecInfoDelFile", checkBox_recInfoDelFile.IsChecked, false, SettingPath.CommonIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "ApplyExtToRecInfoDel", checkBox_applyExtTo.IsChecked, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "AutoDel", checkBox_autoDel.IsChecked, SettingPath.TimerSrvIniPath);

            List <String> extList          = listBox_ext.Items.OfType <string>().ToList();
            List <String> delChkFolderList = ViewUtil.GetFolderList(listBox_chk_folder);

            IniFileHandler.WritePrivateProfileString("DEL_EXT", "Count", extList.Count, SettingPath.TimerSrvIniPath);
            IniFileHandler.DeletePrivateProfileNumberKeys("DEL_EXT", SettingPath.TimerSrvIniPath);
            for (int i = 0; i < extList.Count; i++)
            {
                IniFileHandler.WritePrivateProfileString("DEL_EXT", i.ToString(), extList[i], SettingPath.TimerSrvIniPath);
            }
            IniFileHandler.WritePrivateProfileString("DEL_CHK", "Count", delChkFolderList.Count, SettingPath.TimerSrvIniPath);
            IniFileHandler.DeletePrivateProfileNumberKeys("DEL_CHK", SettingPath.TimerSrvIniPath);
            for (int i = 0; i < delChkFolderList.Count; i++)
            {
                IniFileHandler.WritePrivateProfileString("DEL_CHK", i.ToString(), delChkFolderList[i], SettingPath.TimerSrvIniPath);
            }

            IniFileHandler.WritePrivateProfileString("SET", "RecNamePlugIn", checkBox_recname.IsChecked, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "RecNamePlugInFile", comboBox_recname.SelectedItem as string ?? "", SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "NoChkYen", checkBox_noChkYen.IsChecked, SettingPath.TimerSrvIniPath);
            IniFileHandler.WritePrivateProfileString("SET", "DelReserveMode", delReserveModeRadioBtns.Value, -1, SettingPath.TimerSrvIniPath);

            //3 ボタン表示
            settings.ViewButtonList = listBox_viewBtn.Items.OfType <StringItem>().ValueList();
            settings.TaskMenuList   = listBox_viewTask.Items.OfType <StringItem>().ValueList();
        }
示例#7
0
    private void loadBarCode()
    {
        string barCodewithQty = Request.QueryString["barcodes"];

        if (!barCodewithQty.Trim().Contains(","))
        {
            barCodewithQty = barCodewithQty + ",";
        }

        string txtIDs_Text = "";

        foreach (string item in barCodewithQty.Split(','))
        {
            if (item.Contains('-'))
            {
                for (int i = 0; i < int.Parse(item.Split('-')[1]); i++)
                {
                    txtIDs_Text += (txtIDs_Text == "" ? "" : ",") + item.Split('-')[0];
                }
            }
        }
        string barcodes  = "<table border='0' cellpadding='0' cellspacing='0'><tr>";
        int    remaining = 5;

        if (!txtIDs_Text.Trim().Contains(","))
        {
            txtIDs_Text = txtIDs_Text + ",";
        }

        string sql = @"Select Pos_Product.ProductName,Pos_Product.StyleCode,
        (Pos_Product.SalePrice +(Pos_Product.SalePrice * Pos_Product.VatPercentage / 100)) as SalePrice,        
        Pos_Size.SizeName,Pos_Product.BarCode,Pos_Product.IsVatExclusive,'' as VatText,Pos_Product.DiscountPercentage from Pos_Product
        inner join Pos_Size on Pos_Size.Pos_SizeID =Pos_Product.Pos_SizeID
        where Pos_Product.BarCode in ('" + txtIDs_Text.Replace(",", "','") + "')";

        DataSet ds       = CommonManager.SQLExec(sql);
        bool    is1stRow = true;
        int     rowNo    = 1;
        string  tr_StyleWithOutDiscount = "withOutDiscount";
        string  tr_StyleWithDiscount    = "withDiscount";

        for (int i = 0; i < txtIDs_Text.Trim().Split(',').Length; i++)
        {
            try
            {
                string test = txtIDs_Text.Trim().Split(',')[i];
                if (test != "")
                {
                    //tr_StyleWithOutDiscount = "withOutDiscount";
                    //tr_StyleWithDiscount = "withDiscount";
                    //if (is1stRow)
                    //{
                    //    tr_StyleWithOutDiscount = "withOutDiscount1stRow";
                    //    tr_StyleWithDiscount = "withDiscount1stRow";

                    //}

                    if (i % 5 == 0)
                    {
                        if (i != 0)
                        {
                            rowNo    += 1;
                            is1stRow  = false;
                            barcodes += "</tr><tr>";
                        }

                        if (rowNo == 12)
                        {
                            rowNo    = 1;
                            is1stRow = true;
                            tr_StyleWithOutDiscount = "withOutDiscount";
                            tr_StyleWithDiscount    = "withDiscount";
                            if (is1stRow)
                            {
                                tr_StyleWithOutDiscount = "withOutDiscount1stRow";
                                tr_StyleWithDiscount    = "withDiscount1stRow";
                            }
                        }
                        else
                        {
                            tr_StyleWithOutDiscount = "withOutDiscount";
                            tr_StyleWithDiscount    = "withDiscount";
                            if (is1stRow)
                            {
                                tr_StyleWithOutDiscount = "withOutDiscount1stRow";
                                tr_StyleWithDiscount    = "withDiscount1stRow";
                            }
                        }
                        remaining = 4;
                    }
                    else
                    {
                        remaining--;
                    }


                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        if (dr["BarCode"].ToString().Trim() == txtIDs_Text.Trim().Split(',')[i])
                        {
                            if (decimal.Parse(dr["DiscountPercentage"].ToString()) == 0)
                            {
                                barcodes += "<td class='" + tr_StyleWithOutDiscount + "'>" + dr["ProductName"].ToString() + "<br/>Size: " + dr["SizeName"].ToString() + "&nbsp;&nbsp;<span style='font-family:Arial;font-weight:bold;'>Hostel Management Software</span><div style='overflow: hidden; margin-left: -12px; width: 157px; height: 39px; margin-top: 0px;'><img style='margin-top: -19px;' src='http://www.bcgen.com/demo/linear-dbgs.aspx?D=";
                                barcodes += txtIDs_Text.Trim().Split(',')[i] + "'/></div>" + "&nbsp;&nbsp;" + dr["StyleCode"].ToString() + "<br/>TK. " + decimal.Parse(dr["SalePrice"].ToString()).ToString("0,0.00") + " (Inclusive)</td>";
                            }
                            else
                            {
                                barcodes += "<td class='" + tr_StyleWithDiscount + "'>" + dr["ProductName"].ToString() + "&nbsp;&nbsp;(Size: " + dr["SizeName"].ToString() + ")<br/>" + dr["StyleCode"].ToString() + "&nbsp;&nbsp;<span style='font-family:Arial;font-weight:bold;'>Hostel Management Software</span><div style='overflow: hidden; margin-left: -12px; width: 157px; height: 39px; margin-top: 0px;'><img style='margin-top: -19px;' src='http://www.bcgen.com/demo/linear-dbgs.aspx?D=";
                                barcodes += txtIDs_Text.Trim().Split(',')[i] + "'/></div><span style='font-size:10px;'>" + decimal.Parse(dr["DiscountPercentage"].ToString()).ToString("0.00") + " % Discount on TK. " + decimal.Parse(dr["SalePrice"].ToString()).ToString("0,0.00") + "</span><br/><span style='text-align:center; width:100%;font-weight:bold;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TK." + (decimal.Parse(dr["SalePrice"].ToString()) * (100 - decimal.Parse(dr["DiscountPercentage"].ToString())) / 100).ToString("0,0.00") + "  (Inclusive)</span></td>";
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            { }
        }

        for (int i = 0; i < remaining; i++)
        {
            barcodes += "<td></td>";
        }
        barcodes += "</tr></table>";

        lblbarcode.Text = barcodes;
    }
示例#8
0
        protected void CreateDrawTextList()
        {
            LastItemRenderTextHeight = 0;
            textDrawLists            = null;
            Matrix m = PresentationSource.FromVisual(Application.Current.MainWindow).CompositionTarget.TransformToDevice;

            if (Items == null)
            {
                return;
            }
            textDrawLists = new List <List <Tuple <Brush, GlyphRun> > >(Items.Count);

            if (ItemFontNormal == null || ItemFontNormal.GlyphType == null ||
                ItemFontTitle == null || ItemFontTitle.GlyphType == null)
            {
                return;
            }
            ItemFontNormal.PrepareCache();
            ItemFontTitle.PrepareCache();

            {
                double          selfLeft     = Canvas.GetLeft(this);
                double          sizeTitle    = Math.Max(Settings.Instance.FontSizeTitle, 1);
                double          sizeNormal   = Math.Max(Settings.Instance.FontSize, 1);
                double          indentTitle  = sizeTitle * 1.7;
                double          indentNormal = IsTitleIndent ? indentTitle : 2;
                SolidColorBrush colorTitle   = CommonManager.Instance.CustTitle1Color;
                SolidColorBrush colorNormal  = CommonManager.Instance.CustTitle2Color;

                foreach (ProgramViewItem info in Items)
                {
                    var textDrawList = new List <Tuple <Brush, GlyphRun> >();
                    textDrawLists.Add(textDrawList);

                    double innerLeft = info.LeftPos + BorderLeftSize / 2;
                    //0.26は細枠線での微調整
                    double innerTop    = info.TopPos + BorderTopSize / 2 - 0.26;
                    double innerWidth  = info.Width - BorderLeftSize;
                    double innerHeight = info.Height - BorderTopSize;
                    double useHeight;

                    //分
                    string min = (info.EventInfo.StartTimeFlag == 0 ? "?" : info.EventInfo.start_time.Minute.ToString("d02"));
                    if (RenderText(min, textDrawList, ItemFontTitle, sizeTitle * 0.95,
                                   innerWidth - 1, innerHeight,
                                   innerLeft + 1, innerTop, out useHeight, colorTitle, m, selfLeft) == false)
                    {
                        info.TitleDrawErr        = true;
                        LastItemRenderTextHeight = info.Height;
                        continue;
                    }

                    //タイトル
                    string title = info.EventInfo.ShortInfo == null ? "" : info.EventInfo.ShortInfo.event_name;
                    if (ReplaceDictionaryTitle != null)
                    {
                        title = CommonManager.ReplaceText(title, ReplaceDictionaryTitle);
                    }
                    if (RenderText(title.Length > 0 ? title : " ", textDrawList, ItemFontTitle, sizeTitle,
                                   innerWidth - sizeTitle * 0.5 - indentTitle, innerHeight,
                                   innerLeft + indentTitle, innerTop, out useHeight, colorTitle, m, selfLeft) == false)
                    {
                        info.TitleDrawErr        = true;
                        LastItemRenderTextHeight = info.Height;
                        continue;
                    }
                    if (info.Height < sizeTitle)
                    {
                        //高さ足りない
                        info.TitleDrawErr = true;
                    }
                    LastItemRenderTextHeight = useHeight + sizeNormal * 0.5;

                    if (info.EventInfo.ShortInfo != null)
                    {
                        //説明
                        string detail = info.EventInfo.ShortInfo.text_char;
                        //詳細
                        detail += ExtInfoMode == false || info.EventInfo.ExtInfo == null ? "" : "\r\n\r\n" + info.EventInfo.ExtInfo.text_char;
                        if (ReplaceDictionaryNormal != null)
                        {
                            detail = CommonManager.ReplaceText(detail, ReplaceDictionaryNormal);
                        }
                        RenderText(detail, textDrawList, ItemFontNormal, sizeNormal,
                                   innerWidth - sizeTitle * 0.5 - indentNormal, innerHeight - LastItemRenderTextHeight,
                                   innerLeft + indentNormal, innerTop + LastItemRenderTextHeight, out useHeight, colorNormal, m, selfLeft);
                        LastItemRenderTextHeight += useHeight + sizeNormal * 0.25;
                    }
                    LastItemRenderTextHeight = Math.Floor(LastItemRenderTextHeight + BorderTopSize + sizeNormal * 0.5);
                    LastItemRenderTextHeight = Math.Min(LastItemRenderTextHeight, info.Height);
                }
            }
        }
示例#9
0
        /// <summary>
        /// 批量导入
        /// </summary>
        /// <param name="dt"></param>
        public int Import(DataTable dt, ref string errorMsg)
        {
            int site = SessionHelper.Get(HttpContext.Current, TypeManager.User) != null ?
                       ((TB_User)SessionHelper.Get(HttpContext.Current, TypeManager.User)).SiteID :
                       ((TB_SystemAdmin)SessionHelper.Get(HttpContext.Current, TypeManager.Admin)).SiteID;
            string user = SessionHelper.Get(HttpContext.Current, TypeManager.User) != null ?
                          ((TB_User)SessionHelper.Get(HttpContext.Current, TypeManager.User)).ADAccount :
                          ((TB_SystemAdmin)SessionHelper.Get(HttpContext.Current, TypeManager.Admin)).Account;
            CommonManager mCommonManager = new CommonManager();

            try
            {
                #region 宿舍区

                DataTable dtTB_DormArea       = _mTB_DormAreaDAL.GetTableBySite(site);
                DataTable dtTB_DormAreaInsert = dtTB_DormArea.Clone();
                DataRow[] drTB_DormAreaArr    = null;

                var queryDormArea = from v in dt.AsEnumerable()
                                    select new
                {
                    DormAreaName = v.Field <string>("宿舍区")
                };
                foreach (var item in queryDormArea.ToList().Distinct())
                {
                    drTB_DormAreaArr = dtTB_DormArea.Select("name='" + item.DormAreaName + "'");
                    if (drTB_DormAreaArr.Length <= 0)
                    {
                        DataRow drDormAreaInsert = dtTB_DormAreaInsert.NewRow();
                        drDormAreaInsert["Name"]    = item.DormAreaName;
                        drDormAreaInsert["SiteID"]  = site;
                        drDormAreaInsert["Creator"] = user;
                        dtTB_DormAreaInsert.Rows.Add(drDormAreaInsert);
                    }
                }
                dtTB_DormAreaInsert.Columns.Remove("ID");
                if (dtTB_DormAreaInsert.Rows.Count > 0)
                {
                    mCommonManager.DTToDB(dtTB_DormAreaInsert, "TB_DormArea", new string[] { "SiteID", "Name", "Creator" }, DBO.GetInstance().CreateConnection().ConnectionString);
                }

                #endregion
                #region 楼栋
                dtTB_DormArea = _mTB_DormAreaDAL.GetTableBySite(site);
                DataTable dtTB_Building       = _mTB_BuildingDAL.GetTableBySiteID(site);
                DataTable dtTB_BuildingInsert = dtTB_Building.Clone();
                DataRow[] drTB_BuildingArr    = null;
                var       queryBuilding       = from v in dt.AsEnumerable()
                                                select new
                {
                    DormAreaName = v.Field <string>("宿舍区"),
                    BuildingName = v.Field <string>("楼栋"),
                };
                foreach (var item in queryBuilding.ToList().Distinct())
                {
                    drTB_BuildingArr = dtTB_Building.Select("Name='" + item.BuildingName + "' and DormAreaName='" + item.DormAreaName + "'");
                    if (drTB_BuildingArr.Length <= 0)
                    {
                        drTB_DormAreaArr = dtTB_DormArea.Select("Name='" + item.DormAreaName + "'");
                        DataRow drTB_BuildingInsert = dtTB_BuildingInsert.NewRow();
                        drTB_BuildingInsert["DormAreaID"] = drTB_DormAreaArr[0]["ID"];
                        drTB_BuildingInsert["Name"]       = item.BuildingName;
                        drTB_BuildingInsert["SiteID"]     = site;
                        drTB_BuildingInsert["Creator"]    = user;
                        dtTB_BuildingInsert.Rows.Add(drTB_BuildingInsert);
                    }
                }
                dtTB_BuildingInsert.Columns.Remove("ID");
                dtTB_BuildingInsert.Columns.Remove("DormAreaName");
                if (dtTB_BuildingInsert.Rows.Count > 0)
                {
                    mCommonManager.DTToDB(dtTB_BuildingInsert, "TB_Building", new string[] { "DormAreaID", "Name", "Creator", "SiteID" }, DBO.GetInstance().CreateConnection().ConnectionString);
                }
                #endregion
                #region 房间
                dtTB_DormArea = _mTB_DormAreaDAL.GetTableBySite(site);
                dtTB_Building = _mTB_BuildingDAL.GetTableBySiteID(site);
                DataTable dtTB_RoomType   = _mTB_RoomTypeDAL.GetTable(site);
                DataTable dtTB_Room       = _mTB_RoomDAL.GetTableBySiteID(site);
                DataTable dtTB_RoomInsert = dtTB_Room.Clone();
                DataRow[] drTB_RoomArr    = null;
                DataTable dtRoomType      = new TB_RoomTypeDAL().GetTable(site);
                var       queryRoom       = from v in dt.AsEnumerable()
                                            select new
                {
                    DormAreaName = v.Field <string>("宿舍区"),
                    BuildingName = v.Field <string>("楼栋"),
                    RoomName     = v.Field <string>("房间号"),
                    RoomType     = v.Field <string>("房间类型"),
                    RoomSexType  = v.Field <string>("性别"),
                };
                foreach (var item in queryRoom.ToList().Distinct())
                {
                    DataRow[] dr = dtTB_RoomType.Select("Name='" + item.RoomType + "'");
                    if (dr.Length == 0)
                    {
                        errorMsg = "房间类型:" + item.RoomType + " 不存在,请检查后再导入";
                        return(0);
                    }
                    drTB_RoomArr = dtTB_Room.Select("BuildingName='" + item.BuildingName + "' and DormAreaName='" + item.DormAreaName + "' and Name='" + item.RoomName + "'");
                    if (drTB_RoomArr.Length <= 0)
                    {
                        drTB_DormAreaArr = dtTB_DormArea.Select("Name='" + item.DormAreaName + "'");
                        drTB_BuildingArr = dtTB_Building.Select("Name='" + item.BuildingName + "' and DormAreaName='" + item.DormAreaName + "'");
                        DataRow drTB_RoomInsert = dtTB_RoomInsert.NewRow();
                        drTB_RoomInsert["DormAreaID"]  = drTB_DormAreaArr[0]["ID"];
                        drTB_RoomInsert["BuildingID"]  = drTB_BuildingArr[0]["ID"];
                        drTB_RoomInsert["Name"]        = item.RoomName;
                        drTB_RoomInsert["SiteID"]      = site;
                        drTB_RoomInsert["Creator"]     = user;
                        drTB_RoomInsert["RoomSexType"] = item.RoomSexType;
                        drTB_RoomInsert["RoomType2"]   = 0;
                        drTB_RoomInsert["KeyCount"]    = "";
                        DataRow[] drRoomTypeArr = dtRoomType.Select("Name='" + item.RoomType + "'");
                        if (drRoomTypeArr.Length > 0)
                        {
                            drTB_RoomInsert["RoomType"] = drRoomTypeArr[0]["ID"];
                        }
                        dtTB_RoomInsert.Rows.Add(drTB_RoomInsert);
                    }
                }
                dtTB_RoomInsert.Columns.Remove("ID");
                dtTB_RoomInsert.Columns.Remove("DormAreaName");
                dtTB_RoomInsert.Columns.Remove("BuildingName");
                if (dtTB_RoomInsert.Rows.Count > 0)
                {
                    mCommonManager.DTToDB(dtTB_RoomInsert, "TB_Room", new string[] { "Name", "RoomSexType", "RoomType"
                                                                                     , "RoomType2", "Creator", "SiteID", "DormAreaID", "BuildingID", "KeyCount" }, DBO.GetInstance().CreateConnection().ConnectionString);
                }
                #endregion
                #region 床位号
                dtTB_DormArea = _mTB_DormAreaDAL.GetTableBySite(site);
                dtTB_Building = _mTB_BuildingDAL.GetTableBySiteID(site);
                dtTB_Room     = _mTB_RoomDAL.GetTableBySiteID(site);
                DataTable dtTB_Bed       = _mTB_BedDAL.GetTableBySite(site);
                DataTable dtTB_BedInsert = dtTB_Bed.Clone();
                DataRow[] drTB_BedArr    = null;
                var       queryBed       = from v in dt.AsEnumerable()
                                           select new
                {
                    DormAreaName = v.Field <string>("宿舍区"),
                    BuildingName = v.Field <string>("楼栋"),
                    RoomName     = v.Field <string>("房间号"),
                    BedName      = v.Field <string>("床位号"),
                    BedStatus    = v.Field <string>("床位状态"),
                    KeyCount     = v.Field <string>("钥匙数量"),
                };
                int iInsertCount = 0;
                foreach (var item in queryBed.ToList().Distinct())
                {
                    if (string.IsNullOrEmpty(item.BedName))
                    {
                        errorMsg = item.DormAreaName + item.BuildingName + item.RoomName + " 存在空床位,请检查后再导入";
                        return(0);
                    }
                    drTB_BedArr = dtTB_Bed.Select("BuildingName='" + item.BuildingName + "' and DormAreaName='" + item.DormAreaName + "' and RoomName='" + item.RoomName + "' and  Name='" + item.BedName + "'");
                    if (drTB_BedArr.Length <= 0)
                    {
                        drTB_DormAreaArr = dtTB_DormArea.Select("Name='" + item.DormAreaName + "'");
                        drTB_BuildingArr = dtTB_Building.Select("Name='" + item.BuildingName + "' and DormAreaName='" + item.DormAreaName + "'");
                        drTB_RoomArr     = dtTB_Room.Select("Name='" + item.RoomName + "' and BuildingName='" + item.BuildingName + "' and DormAreaName='" + item.DormAreaName + "'");
                        DataRow drTB_BedInsert = dtTB_BedInsert.NewRow();
                        drTB_BedInsert["DormAreaID"] = drTB_DormAreaArr[0]["ID"];
                        drTB_BedInsert["BuildingID"] = drTB_BuildingArr[0]["ID"];
                        drTB_BedInsert["RoomID"]     = drTB_RoomArr[0]["ID"];
                        drTB_BedInsert["Name"]       = item.BedName;
                        drTB_BedInsert["SiteID"]     = site;
                        drTB_BedInsert["Creator"]    = user;
                        drTB_BedInsert["KeyCount"]   = item.KeyCount;
                        if (item.BedStatus == RemarkAttribute.GetEnumRemark(TypeManager.BedStatus.Busy))
                        {
                            drTB_BedInsert["Status"] = (int)TypeManager.BedStatus.Busy;
                        }
                        else if (item.BedStatus == RemarkAttribute.GetEnumRemark(TypeManager.BedStatus.Free))
                        {
                            drTB_BedInsert["Status"] = (int)TypeManager.BedStatus.Free;
                        }
                        else if (item.BedStatus == RemarkAttribute.GetEnumRemark(TypeManager.BedStatus.Occupy))
                        {
                            drTB_BedInsert["Status"] = (int)TypeManager.BedStatus.Occupy;
                        }
                        dtTB_BedInsert.Rows.Add(drTB_BedInsert);

                        iInsertCount++;
                    }
                }
                dtTB_BedInsert.Columns.Remove("ID");
                dtTB_BedInsert.Columns.Remove("DormAreaName");
                dtTB_BedInsert.Columns.Remove("BuildingName");
                dtTB_BedInsert.Columns.Remove("RoomName");
                if (dtTB_BedInsert.Rows.Count > 0)
                {
                    mCommonManager.DTToDB(dtTB_BedInsert, "TB_Bed", new string[] { "Name", "Creator", "SiteID", "DormAreaID"
                                                                                   , "BuildingID", "RoomID", "Status", "KeyCount" }, DBO.GetInstance().CreateConnection().ConnectionString);
                }

                return(iInsertCount);

                #endregion
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#10
0
 public string Index()
 {
     return(CommonManager.GetIP(HttpContext.Current));
 }
示例#11
0
    private void loadData()
    {
        int suppliyerID = 0;

        try
        {
            suppliyerID = Int32.Parse(Request.QueryString["SuppliyerID"]);
        }
        catch (Exception ex)
        {
            suppliyerID = 0;
        }

        int WorkStationID = 0;

        try
        {
            WorkStationID = Int32.Parse(Request.QueryString["WorkStationID"]);
        }
        catch (Exception ex)
        {
            WorkStationID = 0;
        }


        int VAT = 0;

        try
        {
            VAT = Int32.Parse(Request.QueryString["VAT"]);
        }
        catch (Exception ex)
        {
            VAT = 0;
        }

        int TransactionTypeID = 0;

        try
        {
            TransactionTypeID = Int32.Parse(Request.QueryString["TransactionTypeID"]);
        }
        catch (Exception ex)
        {
            TransactionTypeID = 0;
        }

        string fromDate = (Request.QueryString["FromDate"] != null ? Request.QueryString["FromDate"].ToString() : "");
        string toDate   = (Request.QueryString["ToDate"] != null ? Request.QueryString["ToDate"].ToString() : "");

        lblStockDate.Text = DateTime.Parse(fromDate).ToString("dd/MM/yyyy") + " to " + DateTime.Parse(toDate).ToString("dd/MM/yyyy");

        //purchase info
        string sql = @"select SUM(Pos_Transaction.Quantity) as Quantity
,Inv_QuantityUnit.QuantityUnitName
,ACC_ChartOfAccountLabel4.ChartOfAccountLabel4Text
,ACC_ChartOfAccountLabel4.ExtraField1
,SUM(Pos_Transaction.Quantity * Pos_Product.SalePrice) as TotalAmount 
,SUM((Pos_Transaction.Quantity * Pos_Product.SalePrice)+(Pos_Transaction.Quantity * Pos_Product.SalePrice * [Pos_Product].[VatPercentage] /100)) as TotalAmountWithVAT
,(SUM(Pos_Transaction.Quantity * Pos_Product.SalePrice)/SUM(Pos_Transaction.Quantity)) as UnitPrice 
,Pos_Product.BarCode,Pos_Product.ProductID,[Pos_Product].[VatPercentage]
from
Pos_Product 
inner join ACC_ChartOfAccountLabel4 on ACC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID= Pos_Product.ProductID
inner join Inv_QuantityUnit on Inv_QuantityUnit.Inv_QuantityUnitID=Pos_Product.Inv_QuantityUnitID
inner join Pos_Transaction on Pos_Transaction.Pos_ProductID =Pos_Product.Pos_ProductID
inner join Pos_TransactionMaster on Pos_TransactionMaster.Pos_TransactionMasterID = Pos_Transaction.Pos_ProductTransactionMasterID
where   Pos_TransactionMaster.Pos_TransactionTypeID =" + TransactionTypeID.ToString() + @" and  (Pos_TransactionMaster.TransactionDate between '" + fromDate + "' and '" + toDate + "')";

        if (suppliyerID != 0)
        {
            sql += " and Pos_TransactionMaster.ToOrFromID =" + suppliyerID;
        }
        if (VAT != 0)
        {
            if (VAT == 1)
            {
                sql += " and Pos_Product.VatPercentage =0";//inculding
            }
            else if (VAT == 2)
            {
                sql += " and Pos_Product.VatPercentage <> 0";//inculding
            }
        }


        if (WorkStationID != 0)
        {
            if (
                TransactionTypeID == 9
                //||
                //TransactionTypeID == 12
                )
            {
                sql += " and Pos_TransactionMaster.ToOrFromID =" + WorkStationID;
            }
            else
            {
                sql += " and Pos_TransactionMaster.WorkSatationID =" + WorkStationID;
            }
        }

        sql += @"
group by Inv_QuantityUnit.QuantityUnitName
,ACC_ChartOfAccountLabel4.ChartOfAccountLabel4Text
,ACC_ChartOfAccountLabel4.ExtraField1
,Pos_Product.BarCode,Pos_Product.ProductID
,[Pos_Product].[VatPercentage]
order by Pos_Product.ProductID,Pos_Product.BarCode;";

        if (suppliyerID != 0)
        {
            sql += "select ChartOfAccountLabel4Text,ACC_ChartOfAccountLabel4ID,ExtraField2 from ACC_ChartOfAccountLabel4 where ACC_ChartOfAccountLabel4ID =" + suppliyerID;
        }
        else
        if (WorkStationID != 0)
        {
            sql += "select ChartOfAccountLabel4Text,ACC_ChartOfAccountLabel4ID,ExtraField2 from ACC_ChartOfAccountLabel4 where ACC_ChartOfAccountLabel4ID =" + WorkStationID;
        }

        lblVoucherType.Text = Pos_TransactionTypeManager.GetPos_TransactionTypeByID(TransactionTypeID).TransactionTypeName;


        DataSet ds = CommonManager.SQLExec(sql);


        string  ProductID      = "0";
        decimal Total          = 0;
        decimal Subtotal       = 0;
        decimal TotalAmount    = 0;
        decimal SubtotalAmount = 0;
        int     serialNo       = 1;

        string htmlTable = @" <table id='itemList_tbl' style='border:1px solid black;width:100%;' cellpadding='0' cellspacing='0'>
                        ";



        if (suppliyerID != 0)
        {
            htmlTable += @"<tr>
                            <td colspan='5' style='padding-left:50px;border-top:1px solid black;'>
                                <b>Supplier name:</b> " + ds.Tables[1].Rows[0]["ChartOfAccountLabel4Text"].ToString() + @"
                            </td>
                            <td colspan='2' style=' border-top:1px solid black;'>
                                <b>Supplier ID:</b> " + ds.Tables[1].Rows[0]["ACC_ChartOfAccountLabel4ID"].ToString() + @"
                            </td>
                        </tr>
                        <tr>
                            <td colspan='8' style='padding-left:50px;'>
                                <b>Supplier Address:</b> " + ds.Tables[1].Rows[0]["ExtraField2"].ToString() + @"
                            </td>
                        </tr>
                        <tr>
                            <td colspan='8' style='padding-left:50px; border-bottom:1px solid black;'>
                                <b>Transaction Date:</b> " + DateTime.Parse(fromDate).ToString("dd MMM yyyy") + " To " + DateTime.Parse(toDate).ToString("dd MMM yyyy") + @"
                            </td>
                        </tr>";
        }
        if (WorkStationID != 0)
        {
            htmlTable += @"<tr>
                            <td colspan='5' style='padding-left:50px;border-top:1px solid black;'>
                                <b>WorkStation name:</b> " + ds.Tables[1].Rows[0]["ChartOfAccountLabel4Text"].ToString() + @"
                            </td>
                            <td colspan='2' style=' border-top:1px solid black;'>
                                <b>ID:</b> " + ds.Tables[1].Rows[0]["ACC_ChartOfAccountLabel4ID"].ToString() + @"
                            </td>
                        </tr>
                        <tr>
                            <td colspan='8' style='padding-left:50px;'>
                                <b>Address:</b> " + ds.Tables[1].Rows[0]["ExtraField2"].ToString() + @"
                            </td>
                        </tr>
                        <tr>
                            <td colspan='8' style='padding-left:50px; border-bottom:1px solid black;'>
                                <b>Transaction Date:</b> " + DateTime.Parse(fromDate).ToString("dd MMM yyyy") + " To " + DateTime.Parse(toDate).ToString("dd MMM yyyy") + @"
                            </td>
                        </tr>";
        }
        else
        {
            htmlTable += @"<tr>
                            <td colspan='8' style='padding-left:50px; border-top:1px solid black;border-bottom:1px solid black;'>
                                All
                            </td>
                        </tr>";
        }

        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            if (ProductID != "0" && ProductID != dr["ProductID"].ToString())
            {
                htmlTable += @"<tr class='subtotalRow'>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>Sub Total</td>
                            <td>" + Subtotal.ToString("0,0.00") + @"</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>" + SubtotalAmount.ToString("0,0.00") + @"</td>
                        </tr>";

                Subtotal       = 0;
                SubtotalAmount = 0;
            }

            if (ProductID != dr["ProductID"].ToString())
            {
                ProductID  = dr["ProductID"].ToString();
                htmlTable += @"<tr>
                            <td colspan='7' style='padding-left:50px; border-top:1px solid black;border-bottom:1px solid black;'>
                                <b>Item:</b> " + dr["ChartOfAccountLabel4Text"].ToString() + @"
                            </td>
                        </tr>
                        <tr id='tableHeader'>
                            <td  style='border-left:0px;'>S/L</td>
                            <td>Item Code</td>
                            <td>Item Name</td>
                            <td>Quantity</td>
                            <td>Unit Price</td>
                            <td>VAT</td>
                            <td>Amount</td>
                        </tr>";
            }

            htmlTable += @"<tr class='itemCss'>
                            <td  style='border-left:0px;'>" + (serialNo++).ToString() + @"</td>
                            <td>" + dr["BarCode"].ToString() + @"</td>
                            <td>" + dr["ChartOfAccountLabel4Text"].ToString() + @"</td>
                            <td style='text-align:right;'>" + decimal.Parse(dr["Quantity"].ToString()).ToString("0,0.00") + @"</td>
                            <td >" + decimal.Parse(dr["UnitPrice"].ToString()).ToString("0,0.00") + @"</td>
                            <td >" + decimal.Parse(dr["VatPercentage"].ToString()).ToString("0,0.00") + @"</td>
                            <td style='text-align:right;'>" + decimal.Parse(dr["TotalAmountWithVAT"].ToString()).ToString("0,0.00") + @"</td>
                        </tr>";

            Subtotal       += decimal.Parse(dr["Quantity"].ToString());
            SubtotalAmount += decimal.Parse(dr["TotalAmountWithVAT"].ToString());

            Total       += decimal.Parse(dr["Quantity"].ToString());
            TotalAmount += decimal.Parse(dr["TotalAmountWithVAT"].ToString());
        }

        htmlTable += @"<tr class='subtotalRow'>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>Sub Total</td>
                            <td>" + Subtotal.ToString("0,0.00") + @"</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>" + SubtotalAmount.ToString("0,0.00") + @"</td>
                        </tr>";

        htmlTable += @"<tr id='lastRow'>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>Grand Total</td>
                        <td>" + Total.ToString("0,0.00") + @"</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>" + TotalAmount.ToString("0,0.00") + @"</td>
                    </tr></table>";



        lblItemList.Text = htmlTable;
    }
示例#12
0
    private void BarcodeWise(string Top, string TopNo, string MaxPrice, string MinPrice, string FromDate, string ToDate, string Quantity)
    {
        string price = "";

        if (Quantity == "1")
        {
            price = " * Pos_Product.SalePrice";
        }

        string sql = @"

        Select SUM(Quantity" + price + @") as SaleQty,Pos_Product.BarCode,
        Pos_Product.ProductName
        into #tblSale
         from Pos_Transaction
        inner join Pos_Product on Pos_Product.Pos_ProductID = Pos_Transaction.Pos_ProductID
        inner join Pos_TransactionMaster 
	        on Pos_Transaction.Pos_ProductTransactionMasterID = Pos_TransactionMaster.Pos_TransactionMasterID
        where Pos_ProductTrasactionTypeID =13 and Pos_Transaction.RowStatusID=1
        and Pos_TransactionMaster.RowStatusID=1 and TransactionDate>='" + FromDate + @"' and  TransactionDate<='" + ToDate + @"'
        group by Pos_Product.BarCode,
        Pos_Product.ProductName

        Select SUM(Quantity" + price + @") as SaleReturnQty,Pos_Product.BarCode,
        Pos_Product.ProductName
        into #tblSaleReturn
         from Pos_Transaction
        inner join Pos_Product on Pos_Product.Pos_ProductID = Pos_Transaction.Pos_ProductID
        inner join ACC_ChartOfAccountLabel4 on ACC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID = Pos_Product.ProductID
        inner join Pos_TransactionMaster 
	        on Pos_Transaction.Pos_ProductTransactionMasterID = Pos_TransactionMaster.Pos_TransactionMasterID
        where Pos_ProductTrasactionTypeID =14 and Pos_Transaction.RowStatusID=1
        and Pos_TransactionMaster.RowStatusID=1 and TransactionDate>='" + FromDate + @"' and  TransactionDate<='" + ToDate + @"'
        group by Pos_Product.BarCode,
        Pos_Product.ProductName


        select #tblSale.BarCode
        ,#tblSale.ProductName,#tblSale.SaleQty,#tblSaleReturn.SaleReturnQty
        into #total
         from #tblSale left outer join #tblSaleReturn on #tblSale.BarCode
        = #tblSaleReturn.ProductName
        Drop table #tblSale;
        Drop table #tblSaleReturn;
        select BarCode,ProductName ,SaleQty,
        (case  when SaleReturnQty <> 0 then SaleReturnQty else 0 end) as SalesReturn_Qty
        into #last
         from #total
        drop table #total

        Select top " + (TopNo) + @" BarCode,ProductName ,(SaleQty-SalesReturn_Qty) as netSale
        from #last
        where 1=1 " + (MaxPrice == "0" ? "" : " and (SaleQty-SalesReturn_Qty) <=" + MaxPrice) + (MinPrice == "0" ? "" : " and (SaleQty-SalesReturn_Qty) >=" + MinPrice) + @"
        order by (SaleQty-SalesReturn_Qty) " + (Top == "1" ? "Desc" : "Asc") + @"
        drop table #last
        ";

        DataSet ds = CommonManager.SQLExec(sql);

        GridView1.DataSource = ds.Tables[0];
        GridView1.DataBind();
    }
示例#13
0
        public ActionResult Crear(ComponenteElectricoViewModel model, FormCollection collection)
        {
            var Url    = "";
            var pdfUrl = "";

            ViewBag.obra = _obrasManager.Find(Convert.ToInt32(TempData["obra"]));



            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            try
            {/*
              * HttpPostedFileBase pdf = Request.Files["Pdf"];
              *
              * if (pdf != null && pdf.ContentLength > 0)
              * {
              *     pdfUrl = CargarPdf(pdf);
              * }
              * else { pdfUrl = ""; }
              */
                obras   obra   = _obrasManager.Find(Convert.ToInt32(TempData["obra"]));
                equipos equipo = _equiposManager.Find(Convert.ToInt32(TempData["equipo"]));

                componenteselectricos ce = _componentesElectricos_Manager.Crear(Convert.ToInt32(TempData["equipo"]),
                                                                                model.Tipo,
                                                                                model.Caracteristicas,
                                                                                model.Descripcion,
                                                                                model.Marca,
                                                                                model.Modelo,
                                                                                model.Serial,
                                                                                model.FechaFabricado,
                                                                                model.Duracion,
                                                                                model.Sustitucion,
                                                                                pdfUrl.Trim(), model.FechaSustitucion, model.FechaAlerta, obra.Nombre, equipo.Nombre);

                HttpPostedFileBase file;

                for (int i = 0; i < Request.Files.Count; i++)
                {
                    file = Request.Files[i];
                    var d = Request.Files.AllKeys[i].ToString();

                    if (d == "Pdf" && file.FileName != "")
                    {
                        Url = CargarPdf(file);
                        _obrasManager.AgregarArchivos(ce.Id, Url, "componenteselectricos", "fotografia");
                    }
                }
                //TempData["FlashSuccess"] = MensajesResource.INFO_MensajesInstitucionales_CreadoCorrectamente;
                return(RedirectToAction("ComponentesElectronicos", "AdministrarComponentesElectronicos", new { @id = TempData["equipo"] }));
            }
            catch (BusinessException businessEx)
            {
                ModelState.AddModelError(string.Empty, businessEx.Message);

                return(View(model));
            }
            catch (Exception e)
            {
                var log = CommonManager.BuildMessageLog(
                    TipoMensaje.Error,
                    ControllerContext.Controller.ValueProvider.GetValue("controller").RawValue.ToString(),
                    ControllerContext.Controller.ValueProvider.GetValue("action").RawValue.ToString(),
                    e.ToString(), Request);

                CommonManager.WriteAppLog(log, TipoMensaje.Error);

                ModelState.AddModelError(string.Empty, e.Message);
                return(View(model));
            }
        }
示例#14
0
        public ActionResult Editar(int id, ComponenteElectricoViewModel model)
        {
            var Url    = "";
            var pdfUrl = "";

            var componenteelectrico = _componentesElectricos_Manager.Find(id);

            ViewBag.obra = _obrasManager.Find(Convert.ToInt32(TempData["obra_id"]));

            ViewBag.Sustitucion2 =
                new SelectList(new[] { new { ID = "SI", Name = "SI" }, new { ID = "NO", Name = "NO" }, }, "ID", "Name", componenteelectrico.Sustitucion);

            if (componenteelectrico == null)
            {
                //TempData["FlashError"] = MensajesResource.ERROR_MensajesInstitucionales_IdIncorrecto;
                return(RedirectToAction("Index"));
            }

            try
            {/*
              * HttpPostedFileBase pdf = Request.Files["Pdf"];
              *
              * if (pdf != null && pdf.ContentLength > 0)
              * {
              *     pdfUrl = CargarPdf(pdf);
              * }
              * else { pdfUrl = componenteelectrico.Fotografia; }
              */
                _componentesElectricos_Manager.Actualizar(
                    id,
                    model.Tipo,
                    model.Caracteristicas,
                    model.Descripcion,
                    model.Marca,
                    model.Modelo,
                    model.Serial,
                    model.FechaFabricado,
                    model.Duracion,
                    model.Sustitucion,
                    pdfUrl.Trim(), model.FechaSustitucion, model.FechaAlerta);

                HttpPostedFileBase file;

                for (int i = 0; i < Request.Files.Count; i++)
                {
                    file = Request.Files[i];
                    var d = Request.Files.AllKeys[i].ToString();

                    if (d == "Pdf" && file.FileName != "")
                    {
                        Url = CargarPdf(file);
                        _obrasManager.AgregarArchivos(id, Url, "componenteselectricos", "fotografia");
                    }
                }
                // TempData["FlashSuccess"] = MensajesResource.INFO_UsuarioNazan_ActualizadoCorrectamente;
                // return RedirectToAction("Editar", "AdministrarComponentesElectronicos", new { @id = id });
                if (TempData["equipo_id"] != null)
                {
                    return(RedirectToAction("ComponentesElectronicos", "AdministrarComponentesElectronicos", new { @id = TempData["equipo_id"] }));
                }
                else
                {
                    return(RedirectToAction("Sustituciones", "AdministrarComponentesElectronicos"));
                }

                // return RedirectToAction("ComponentesElectronicos", "AdministrarComponentesElectronicos", new { @id = TempData["equipo_id"] });
            }
            catch (BusinessException businessEx)
            {
                ModelState.AddModelError(string.Empty, businessEx.Message);

                return(View(model));
            }
            catch (Exception e)
            {
                var log = CommonManager.BuildMessageLog(
                    TipoMensaje.Error,
                    ControllerContext.Controller.ValueProvider.GetValue("controller").RawValue.ToString(),
                    ControllerContext.Controller.ValueProvider.GetValue("action").RawValue.ToString(),
                    e.ToString(), Request);

                CommonManager.WriteAppLog(log, TipoMensaje.Error);

                return(View(model));
            }
        }
示例#15
0
        public string GetToken(string UserName, string PassWrod)
        {
            var request = HttpContext.Current.Request;

            return(SecurityManager.GenerateToken(UserName, PassWrod, CommonManager.GetIP(request), request.UserAgent, 1));
        }
示例#16
0
        public ActionResult Crear(EquipoViewModel model, FormCollection collection)
        {
            var fotografia = "";
            var plano      = "";
            var Url        = "";

            ViewBag.Obras =
                new SelectList(_fallasManager.FindObras(), "id", "nombre");



            try
            {
                /*HttpPostedFileBase filefotografia = Request.Files["Pdf-Fotografia"];
                 *
                 * if (filefotografia != null && filefotografia.ContentLength > 0)
                 * {
                 *  fotografia = CargarPdf(filefotografia);
                 * }
                 * else { fotografia = ""; }
                 *
                 * HttpPostedFileBase fileplano = Request.Files["Pdf-Plano"];
                 *
                 * if (fileplano != null && fileplano.ContentLength > 0)
                 * {
                 *  plano = CargarPdf(fileplano);
                 * }
                 * else { plano = ""; }*/
                equipos  equipo           = new equipos();
                DateTime?fechagarantia    = null;
                DateTime?fechavencimiento = null;
                if (model.FechaGarantia != null && model.FechaVencimiento == null)
                {
                    equipo = _equiposManager.Crear(
                        Convert.ToInt32(TempData["obra_equipo_id"]),
                        model.Nombre,
                        model.Marca,
                        model.Modelo,
                        model.Referencia,
                        model.DimensionesCabina,
                        model.DimensionesHueco,
                        model.CargaNominal,
                        model.Velocidad,
                        model.Recorrido,
                        model.Paradas,
                        model.Accesos,
                        model.VoltajeDeRed,
                        model.PotenciaDeMaquina,
                        model.TipoDeManiobra,
                        model.NumeroDeGuayas,
                        model.CantidadPersonas,
                        fotografia.Trim(),
                        plano.Trim(), DateTime.Parse(model.FechaGarantia), fechavencimiento);
                }
                TempData.Keep();
                if (model.FechaGarantia == null && model.FechaVencimiento != null)
                {
                    equipo = _equiposManager.Crear(
                        Convert.ToInt32(TempData["obra_equipo_id"]),
                        model.Nombre,
                        model.Marca,
                        model.Modelo,
                        model.Referencia,
                        model.DimensionesCabina,
                        model.DimensionesHueco,
                        model.CargaNominal,
                        model.Velocidad,
                        model.Recorrido,
                        model.Paradas,
                        model.Accesos,
                        model.VoltajeDeRed,
                        model.PotenciaDeMaquina,
                        model.TipoDeManiobra,
                        model.NumeroDeGuayas,
                        model.CantidadPersonas,
                        fotografia.Trim(),
                        plano.Trim(), fechagarantia, DateTime.Parse(model.FechaVencimiento));
                }
                TempData.Keep();
                if (model.FechaGarantia == null && model.FechaVencimiento == null)
                {
                    equipo = _equiposManager.Crear(
                        Convert.ToInt32(TempData["obra_equipo_id"]),
                        model.Nombre,
                        model.Marca,
                        model.Modelo,
                        model.Referencia,
                        model.DimensionesCabina,
                        model.DimensionesHueco,
                        model.CargaNominal,
                        model.Velocidad,
                        model.Recorrido,
                        model.Paradas,
                        model.Accesos,
                        model.VoltajeDeRed,
                        model.PotenciaDeMaquina,
                        model.TipoDeManiobra,
                        model.NumeroDeGuayas,
                        model.CantidadPersonas,
                        fotografia.Trim(),
                        plano.Trim(), fechagarantia, fechavencimiento);
                }
                TempData.Keep();
                if (model.FechaGarantia != null && model.FechaVencimiento != null)
                {
                    equipo = _equiposManager.Crear(
                        Convert.ToInt32(TempData["obra_equipo_id"]),
                        model.Nombre,
                        model.Marca,
                        model.Modelo,
                        model.Referencia,
                        model.DimensionesCabina,
                        model.DimensionesHueco,
                        model.CargaNominal,
                        model.Velocidad,
                        model.Recorrido,
                        model.Paradas,
                        model.Accesos,
                        model.VoltajeDeRed,
                        model.PotenciaDeMaquina,
                        model.TipoDeManiobra,
                        model.NumeroDeGuayas,
                        model.CantidadPersonas,
                        fotografia.Trim(),
                        plano.Trim(), DateTime.Parse(model.FechaGarantia), DateTime.Parse(model.FechaVencimiento));
                }
                TempData.Keep();
                HttpPostedFileBase file;

                for (int i = 0; i < Request.Files.Count; i++)
                {
                    file = Request.Files[i];
                    var d = Request.Files.AllKeys[i].ToString();

                    if (d == "Pdf-Fotografia" && file.FileName != "")
                    {
                        Url = CargarPdf(file);
                        _obrasManager.AgregarArchivos(equipo.Id, Url, "equipos", "fotografia");
                    }
                    if (d == "Pdf-Plano" && file.FileName != "")
                    {
                        Url = CargarPdf(file);
                        _obrasManager.AgregarArchivos(equipo.Id, Url, "equipos", "plano");
                    }
                }

                TempData["FlashSuccess"] = MensajesResource.INFO_Equipos_CreadoCorrectamente;
                return(RedirectToAction("Equipos", "AdministrarEquipos", new { @id = TempData["obra_equipo_id"] }));
            }
            catch (BusinessException businessEx)
            {
                ModelState.AddModelError(string.Empty, businessEx.Message);

                return(View(model));
            }
            catch (Exception e)
            {
                var log = CommonManager.BuildMessageLog(
                    TipoMensaje.Error,
                    ControllerContext.Controller.ValueProvider.GetValue("controller").RawValue.ToString(),
                    ControllerContext.Controller.ValueProvider.GetValue("action").RawValue.ToString(),
                    e.ToString(), Request);

                CommonManager.WriteAppLog(log, TipoMensaje.Error);

                ModelState.AddModelError(string.Empty, e.Message);
                return(View(model));
            }
        }
示例#17
0
    private void loadData()
    {
        try
        {
            ACC_JournalMaster journalMaster = ACC_JournalMasterManager.GetACC_JournalMasterByID(int.Parse(Request.QueryString["JournalMasterID"]));


            List <ACC_JournalDetail> journalDetails = ACC_JournalDetailManager.GetAllACC_JournalDetailByJournalMasterID(int.Parse(Request.QueryString["JournalMasterID"]));

            string journalDetailsHTML = @"<table id='tblJournalDetails' class='tdBorder' border='0' cellspacing='0' cellpadding='0' style='margin:20px 0;'>
                    <tr style='font-weight:bold;font-size:15px;'>
                        <td width='100px'>
                            Account Code
                        </td>
                        <td width='487px'>
                            Account Title
                        </td>
                        <td width='80px'>
                            Debit
                        </td>
                        <td width='80px'>
                            Credit
                        </td>
                    </tr>";

            decimal totalDebit  = 0;
            decimal totalCredit = 0;
            trAddress.Visible = false;
            trCheck.Visible   = false;
            bool defaultJournal = false;

            switch (journalMaster.JournalMasterName)
            {
            case "1":    //Receipt Voucher
                lblVoucherName.Text         = "RECEIPT";
                lblVoucherType.Text         = "RV";
                lblReceivedfromOrPayto.Text = "Received from";
                trAddress.Visible           = true;
                trCheck.Visible             = true;
                //generate table

                foreach (ACC_JournalDetail journalDetail in journalDetails)
                {
                    try
                    {
                        if (journalDetail.Credit == 0)
                        {
                            journalDetailsHTML += @"<tr>
                                    <td>
                                        " + journalDetail.ACC_ChartOfAccountLabel3Code + @"
                                    </td>
                                    <td>
                                        " + journalDetail.ACC_ChartOfAccountLabel3Text + " - " + journalDetail.ACC_ChartOfAccountLabel4Text + " (" + journalDetail.WorkStationName + @")
                                    </td>
                                    <td style='text-align:right;'>
                                        " + journalDetail.Debit.ToString("0,0.00") + @"
                                    </td>
                                    <td style='text-align:right;'>
                                       " + journalDetail.Credit.ToString("0,0.00") + @"
                                    </td>
                                </tr>";
                            totalCredit        += journalDetail.Credit;
                            totalDebit         += journalDetail.Debit;
                        }
                    }
                    catch (Exception ex) { }
                }

                foreach (ACC_JournalDetail journalDetail in journalDetails)
                {
                    try
                    {
                        if (journalDetail.Credit != 0)
                        {
                            journalDetailsHTML += @"<tr>
                                    <td>
                                        " + journalDetail.ACC_ChartOfAccountLabel3Code + @"
                                    </td>
                                    <td>
                                        " + journalDetail.ACC_ChartOfAccountLabel3Text + " - " + journalDetail.ACC_ChartOfAccountLabel4Text + " (" + journalDetail.WorkStationName + @")
                                    </td>
                                    <td style='text-align:right;'>
                                        " + journalDetail.Debit.ToString("0,0.00") + @"
                                    </td>
                                    <td style='text-align:right;'>
                                       " + journalDetail.Credit.ToString("0,0.00") + @"
                                    </td>
                                </tr>";
                            totalCredit        += journalDetail.Credit;
                            totalDebit         += journalDetail.Debit;
                        }
                    }
                    catch (Exception ex) { }
                }

                foreach (ACC_JournalDetail journalDetail in journalDetails)
                {
                    if (journalDetail.Credit == 0)
                    {
                        lblChequeDate.Text = journalDetail.ExtraField1;
                        lblChequeNo.Text   = journalDetail.ExtraField3;
                        try
                        {
                            lblChequeBank.Text = journalDetail.ExtraField2.Split(',')[1];
                        }
                        catch (Exception ex) { }
                        try
                        {
                            lblChequeBranch.Text = journalDetail.ExtraField2.Split(',')[0];
                        }
                        catch (Exception ex) { }
                        break;
                    }
                }

                lblJournalDetials.Text = journalDetailsHTML + "<tr><td></td><td><b>Total:</b></td><td style='text-align:right;'>" + totalDebit.ToString("0,0.00") + "</td><td style='text-align:right;'>" + totalCredit.ToString("0,0.00") + "</td></tr><tr><td  colspan='4'><b>Taka in words:</b> " + NumberToWords(int.Parse(totalCredit.ToString("0"))) + " taka only.</td></tr></table>";

                break;

            case "2":    //Payment Voucher
                lblVoucherName.Text         = "PAYMENT";
                lblVoucherType.Text         = "PV";
                lblReceivedfromOrPayto.Text = "Pay To";
                trAddress.Visible           = true;
                trCheck.Visible             = true;
                //generate table


                foreach (ACC_JournalDetail journalDetail in journalDetails)
                {
                    try
                    {
                        if (journalDetail.Credit == 0)
                        {
                            journalDetailsHTML += @"<tr>
                                    <td>
                                        " + journalDetail.ACC_ChartOfAccountLabel3Code + @"
                                    </td>
                                    <td>
                                        " + journalDetail.ACC_ChartOfAccountLabel3Text + " - " + journalDetail.ACC_ChartOfAccountLabel4Text + " (" + journalDetail.WorkStationName + @")
                                    </td>
                                    <td style='text-align:right;'>
                                        " + journalDetail.Debit.ToString("0,0.00") + @"
                                    </td>
                                    <td style='text-align:right;'>
                                       " + journalDetail.Credit.ToString("0,0.00") + @"
                                    </td>
                                </tr>";
                            totalCredit        += journalDetail.Credit;
                            totalDebit         += journalDetail.Debit;
                        }
                    }
                    catch (Exception ex) { }
                }

                foreach (ACC_JournalDetail journalDetail in journalDetails)
                {
                    try
                    {
                        if (journalDetail.Credit != 0)
                        {
                            journalDetailsHTML += @"<tr>
                                    <td>
                                        " + journalDetail.ACC_ChartOfAccountLabel3Code + @"
                                    </td>
                                    <td>
                                        " + journalDetail.ACC_ChartOfAccountLabel3Text + " - " + journalDetail.ACC_ChartOfAccountLabel4Text + " (" + journalDetail.WorkStationName + @")
                                    </td>
                                    <td style='text-align:right;'>
                                        " + journalDetail.Debit.ToString("0,0.00") + @"
                                    </td>
                                    <td style='text-align:right;'>
                                       " + journalDetail.Credit.ToString("0,0.00") + @"
                                    </td>
                                </tr>";
                            totalCredit        += journalDetail.Credit;
                            totalDebit         += journalDetail.Debit;
                        }
                    }
                    catch (Exception ex) { }
                }

                foreach (ACC_JournalDetail journalDetail in journalDetails)
                {
                    if (journalDetail.Debit == 0)
                    {
                        lblChequeDate.Text = journalDetail.ExtraField1;
                        lblChequeNo.Text   = journalDetail.ExtraField3;
                        try
                        {
                            lblChequeBank.Text = journalDetail.ExtraField2.Split(',')[1];
                        }
                        catch (Exception ex) { }
                        try
                        {
                            lblChequeBranch.Text = journalDetail.ExtraField2.Split(',')[0];
                        }
                        catch (Exception ex) { }
                        break;
                    }
                }

                lblJournalDetials.Text = journalDetailsHTML + "<tr><td></td><td><b>Total:</b></td><td style='text-align:right;'>" + totalDebit.ToString("0,0.00") + "</td><td style='text-align:right;'>" + totalCredit.ToString("0,0.00") + "</td></tr><tr><td  colspan='4'><b>Taka in words:</b> " + NumberToWords(int.Parse(totalDebit.ToString("0"))) + " taka only.</td></tr></table>";

                break;

            case "3":    //Journal Voucher
                lblVoucherName.Text = "JOURNAL";
                lblVoucherType.Text = "JV";
                defaultJournal      = true;

                break;

            case "4":    //Contra Voucher
                lblVoucherName.Text = "CONTRA";
                lblVoucherType.Text = "CV";
                trCheck.Visible     = true;
                defaultJournal      = true;
                foreach (ACC_JournalDetail journalDetail in journalDetails)
                {
                    if (journalDetail.ExtraField3 != "")
                    {
                        lblChequeDate.Text = journalDetail.ExtraField1;
                        lblChequeNo.Text   = journalDetail.ExtraField3;
                        try
                        {
                            lblChequeBank.Text = journalDetail.ExtraField2.Split(',')[1];
                        }
                        catch (Exception ex) { }
                        try
                        {
                            lblChequeBranch.Text = journalDetail.ExtraField2.Split(',')[0];
                        }
                        catch (Exception ex) { }
                        break;
                    }
                }
                break;

            default:
                break;
            }

            if (defaultJournal)
            {
                foreach (ACC_JournalDetail journalDetail in journalDetails)
                {
                    try
                    {
                        journalDetailsHTML += @"<tr>
                                <td>
                                    " + journalDetail.ACC_ChartOfAccountLabel3Code + @"
                                </td>
                                <td>
                                    " + journalDetail.ACC_ChartOfAccountLabel3Text + " - " + journalDetail.ACC_ChartOfAccountLabel4Text + " (" + journalDetail.WorkStationName + @")
                                </td>
                                <td style='text-align:right;'>
                                    " + journalDetail.Debit.ToString("0,0.00") + @"
                                </td>
                                <td style='text-align:right;'>
                                    " + journalDetail.Credit.ToString("0,0.00") + @"
                                </td>
                            </tr>";
                        totalCredit        += journalDetail.Credit;
                        totalDebit         += journalDetail.Debit;
                    }
                    catch (Exception ex) { }
                }


                lblJournalDetials.Text = journalDetailsHTML + "<tr><td></td><td><b>Total:</b></td><td style='text-align:right;'>" + totalDebit.ToString("0,0.00") + "</td><td style='text-align:right;'>" + totalCredit.ToString("0,0.00") + "</td></tr><tr><td  colspan='4'><b>Taka in words:</b> " + NumberToWords(int.Parse(totalCredit.ToString("0"))) + " taka only.</td></tr></table>";
            }

            lblOfficeName.Text      = journalDetails[0].WorkStationName;
            lblJournalMasterID.Text = Request.QueryString["JournalMasterID"];

            if (journalMaster.RowStatusID != 1)
            {
                lblJournalMasterID.BackColor = System.Drawing.Color.Red;
            }

            lblDate.Text         = journalMaster.JournalDate.ToString("dd MMM yyyy");
            lblCustomerName.Text = journalMaster.ExtraField1;
            lblAddress.Text      = journalMaster.ExtraField2;
            if (journalMaster.Note.Contains("Inventory Purchase-"))
            {
                lblExplanation.Text = "<a href='../Inventory/PurchasePrint.aspx?PurchaseID=" + journalMaster.Note.Replace("Inventory Purchase-", "") + "' target='_blank'>" + journalMaster.Note + "</a>";
            }
            else
            {
                lblExplanation.Text = journalMaster.Note;
            }

            gvJournal.DataSource = journalDetails;
            gvJournal.DataBind();

            List <ACC_ChartOfAccountLabel4> aCC_ChartOfAccountLabel4s = new List <ACC_ChartOfAccountLabel4>();
            aCC_ChartOfAccountLabel4s = ACC_ChartOfAccountLabel4Manager.GetAllACC_ChartOfAccountLabel4sForJournalEntry();

            DataSet ds = CommonManager.SQLExec(
                @"
SELECT
ACC_ChartOfAccountLabel3.ChartOfAccountLabel3Text +'('+ ACC_ChartOfAccountLabel2.ChartOfAccountLabel2Text +')('+ 
                       ACC_ChartOfAccountLabel1.ChartOfAccountLabel1Text+')' as Head,
ACC_ChartOfAccountLabel3.ACC_ChartOfAccountLabel3ID
FROM         ACC_ChartOfAccountLabel1 INNER JOIN
                      ACC_ChartOfAccountLabel2 ON 
                      ACC_ChartOfAccountLabel1.ACC_ChartOfAccountLabel1ID = ACC_ChartOfAccountLabel2.ACC_ChartOfAccountLabel1ID INNER JOIN
                      ACC_ChartOfAccountLabel3 ON ACC_ChartOfAccountLabel2.ACC_ChartOfAccountLabel2ID = ACC_ChartOfAccountLabel3.ACC_ChartOfAccountLabel2ID
where ACC_ChartOfAccountLabel3.RowStatusID=1
order by ACC_ChartOfAccountLabel1.ChartOfAccountLabel1Text,ACC_ChartOfAccountLabel2.ChartOfAccountLabel2Text,ACC_ChartOfAccountLabel3.ChartOfAccountLabel3Text
"
                );
            ddlL4.Items.Clear();
            ddlL3.Items.Clear();
            ddlWorkStation.Items.Clear();
            ddlL4.Items.Add(new ListItem("N/A", "0"));
            ddlL3.Items.Add(new ListItem("N/A", "0"));
            ddlWorkStation.Items.Add(new ListItem("N/A", "0"));
            foreach (ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4 in aCC_ChartOfAccountLabel4s)
            {
                ddlL4.Items.Add(new ListItem(
                                    (
                                        aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 9
                ? "Access(Prod)" :
                                        (
                                            aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 10
                ? "Access (Non-Prod)" :
                                            (
                                                aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 2
                ? "Fabrics" :
                                                (
                                                    aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 3
                ? "Product" : aCC_ChartOfAccountLabel4.ACC_HeadTypeID.ToString()
                                                )

                                            )
                                        )
                                    )
                                    + "-" + aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text.ToString(), aCC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID.ToString()));
                if (aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 1)
                {
                    ListItem item = new ListItem(aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text.ToString(), aCC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID.ToString());
                    ddlWorkStation.Items.Add(item);
                }
            }
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                ddlL3.Items.Add(new ListItem(dr["Head"].ToString(), dr["ACC_ChartOfAccountLabel3ID"].ToString()));
            }

            /*
             * //List<ACC_ChartOfAccountLabel3> aCC_ChartOfAccountLabel3s = new List<ACC_ChartOfAccountLabel3>();
             * //aCC_ChartOfAccountLabel3s = ACC_ChartOfAccountLabel3Manager.GetAllACC_ChartOfAccountLabel3sForJournalEntryForDropDownList();
             *
             * foreach (GridViewRow gvr in gvJournal.Rows)
             * {
             *  HiddenField hfWorkStationID = (HiddenField)gvr.FindControl("hfWorkStationID");
             *  HiddenField hfACC_ChartOfAccountLabel4ID = (HiddenField)gvr.FindControl("hfACC_ChartOfAccountLabel4ID");
             *  HiddenField hfACC_ChartOfAccountLabel3ID = (HiddenField)gvr.FindControl("hfACC_ChartOfAccountLabel3ID");
             *  DropDownList ddlWorkStation = (DropDownList)gvr.FindControl("ddlWorkStation");
             *  DropDownList ddlL3 = (DropDownList)gvr.FindControl("ddlL3");
             *  DropDownList ddlL4 = (DropDownList)gvr.FindControl("ddlL4");
             *  foreach (ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4 in aCC_ChartOfAccountLabel4s)
             *  {
             *      ddlL4.Items.Add(new ListItem(
             *          (
             *          aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 9
             *      ? "Access(Prod)" :
             *      (
             *      aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 10
             *      ? "Access (Non-Prod)" :
             *      (
             *      aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 2
             *      ? "Fabrics" : aCC_ChartOfAccountLabel4.ACC_HeadTypeID.ToString()
             *      )
             *      )
             *          )
             + "-" + aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text.ToString(), aCC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID.ToString()));
             +      if (aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 1)
             +      {
             +          ListItem item = new ListItem(aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text.ToString(), aCC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID.ToString());
             +          ddlWorkStation.Items.Add(item);
             +      }
             +  }
             +  foreach (DataRow dr in ds.Tables[0].Rows)
             +  {
             +      ddlL3.Items.Add(new ListItem(dr["Head"].ToString(), dr["ACC_ChartOfAccountLabel3ID"].ToString()));
             +  }
             +
             +  ddlL4.SelectedValue = hfACC_ChartOfAccountLabel4ID.Value;
             +  ddlL3.SelectedValue = hfACC_ChartOfAccountLabel3ID.Value;
             +  ddlWorkStation.SelectedValue = hfWorkStationID.Value;
             + }
             */
        }
        catch (Exception ex)
        { }
    }
示例#18
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string dirURL = "~/files/file/Stock/";


        string conn = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" + MapPath(dirURL) + uplaodFile() + "';Extended Properties='Excel 12.0;HDR=Yes';";
//        string conn = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source='G:/Anam/Projects/Mavrick/gentlepark/Offline Version/Code/HO/V5/POS/Stock" + uplaodFile() + "';Extended Properties='Excel 12.0;HDR=Yes';";
        OleDbConnection objConn = new OleDbConnection(conn);

        objConn.Open();
        OleDbCommand     objCmdSelect = new OleDbCommand("SELECT * FROM [Sheet1$]", objConn);
        OleDbDataAdapter objAdapter   = new OleDbDataAdapter();

        objAdapter.SelectCommand = objCmdSelect;
        DataSet objDataset = new DataSet();

        objAdapter.Fill(objDataset);
        objConn.Close();

        GridView1.DataSource = objDataset.Tables[0];
        GridView1.DataBind();

        string  sql   = @"
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Table_1]') AND type in (N'U'))
DROP TABLE [dbo].[Table_1]
CREATE TABLE [dbo].[Table_1](
	[ProductName] [nvarchar](256) NULL,
	[Barcode] [nvarchar](50) NULL,
	[Style] [nvarchar](50) NULL,
	[Size] [nvarchar](50) NULL,
	[Qty] [decimal](18, 2) NULL,
	[Price] [decimal](18, 2) NULL
)
delete Table_1;
        ";
        string  ex    = "";
        decimal total = 0;

        CommonManager.SQLExec(sql);
        foreach (GridViewRow gvr in GridView1.Rows)
        {
            try
            {
                if (int.Parse(gvr.Cells[4].Text) > 0)
                {
                    sql    = @"
                            INSERT INTO [GentlePark].[dbo].[Table_1]
                                   ([ProductName]
                                   ,[Barcode]
                                   ,[Style]
                                   ,[Size]
                                   ,[Qty]
                                   ,[Price])
                             VALUES
                                   ('" + gvr.Cells[1].Text + @"'--<ProductName, nvarchar(256),>
                                   ,'" + gvr.Cells[0].Text + @"'--<Barcode, nvarchar(50),>
                                   ,'" + gvr.Cells[2].Text + @"'--<Style, nvarchar(50),>
                                   ,'" + gvr.Cells[3].Text + @"'--<Size, nvarchar(50),>
                                   ," + gvr.Cells[4].Text + @"--<Qry, decimal(18,2),>
                                   ," + decimal.Parse(gvr.Cells[5].Text).ToString("0.00") + @"--<price, decimal(18,2),>
                        ); ";
                    total += (decimal.Parse(gvr.Cells[4].Text) * decimal.Parse(gvr.Cells[5].Text));

                    CommonManager.SQLExec(sql);
                }
            }
            catch (Exception exep)
            {
                ex += gvr.Cells[0].Text + ",";
            }
        }
        #region Brnach
        try
        {
            sql = "/*" + ex + total + @"*/
USE GentlePark

Declare @ProductName nvarchar(256)
Declare @ProductID int
Declare @Pos_ProductID int
Declare @BarCode nvarchar(256)
Declare @Style nvarchar(256)
Declare @Size nvarchar(256)
Declare @Pos_SizeID int
Declare @ExtraField1 nvarchar(256)
declare @Price decimal(10,2)
Declare @WorkStationID int
set @WorkStationID=" + ddlShowRoom.SelectedValue + @"
Declare @Pos_TransactionMasterID int
Set @Pos_TransactionMasterID=" + int.Parse(ddlShowRoom.SelectedItem.Text.Split('-')[1]).ToString() + @"

DECLARE product_cursor CURSOR FOR 
    SELECT ProductName,Barcode,Qty,Price,Style,Size
    FROM Table_1
    --where cast(Qty as int) >0

    OPEN product_cursor
    FETCH NEXT FROM product_cursor INTO @ProductName,@BarCode,@ExtraField1,@Price,@Style,@Size
    
    WHILE @@FETCH_STATUS = 0
    BEGIN
    
		Set @ProductID = (Select Count(*) from ACC_ChartOfAccountLabel4 where ChartOfAccountLabel4Text=@ProductName and ACC_HeadTypeID=3)
        if @ProductID = 0
        BEGIN
            --Create Product Name
			INSERT INTO [ACC_ChartOfAccountLabel4]
           ([Code]
           ,[ACC_HeadTypeID]
           ,[ChartOfAccountLabel4Text]
           ,[ExtraField1]
           ,[ExtraField2]
           ,[ExtraField3]
           ,[AddedBy]
           ,[AddedDate]
           ,[UpdatedBy]
           ,[UpdatedDate]
           ,[RowStatusID])
     VALUES
           (''
           ,3
           ,@ProductName
           ,SUBSTRING(@BarCode,1,5)
           ,''
           ,'@'
           ,1
           ,GETDATE()
           ,1
           ,GETDATE()
           ,1)
        END
        Set @ProductID = (select top 1 ACC_ChartOfAccountLabel4ID from ACC_ChartOfAccountLabel4 where ChartOfAccountLabel4Text=@ProductName and ACC_HeadTypeID=3)
		
		--add Product
		Set @Pos_ProductID = (Select Count(*) from Pos_Product where BarCode=@BarCode)
        if @Pos_ProductID = 0
        BEGIN
			if(select Count(Pos_SizeID) from Pos_Size where SizeName =@Size) =0
			BEGIN
				set @Pos_SizeID= 46
			END
			ELSE
			BEGIN
				set @Pos_SizeID =(select top 1 Pos_SizeID from Pos_Size where SizeName =@Size)
			END
			
        
			INSERT INTO [Pos_Product]
           ([ProductID]
           ,[ReferenceID]
           ,[Pos_ProductTypeID]
           ,[Inv_UtilizationDetailsIDs]
           ,[ProductStatusID]
           ,[ProductName]
           ,[DesignCode]
           ,[Pos_SizeID]
           ,[Pos_BrandID]
           ,[Inv_QuantityUnitID]
           ,[FabricsCost]
           ,[AccesoriesCost]
           ,[Overhead]
           ,[OthersCost]
           ,[PurchasePrice]
           ,[SalePrice]
           ,[OldSalePrice]
           ,[Note]
           ,[BarCode]
           ,[Pos_ColorID]
           ,[Pos_FabricsTypeID]
           ,[StyleCode]
           ,[Pic1]
           ,[Pic2]
           ,[Pic3]
           ,[VatPercentage]
           ,[IsVatExclusive]
           ,[DiscountPercentage]
           ,[DiscountAmount]
           ,[FabricsNo]
           ,[ExtraField1]
           ,[ExtraField2]
           ,[ExtraField3]
           ,[ExtraField4]
           ,[ExtraField5]
           ,[ExtraField6]
           ,[ExtraField7]
           ,[ExtraField8]
           ,[ExtraField9]
           ,[ExtraField10]
           ,[AddedBy]
           ,[AddedDate]
           ,[UpdatedBy]
           ,[UpdatedDate]
           ,[RowStatusID])
     VALUES
           (@ProductID
           ,1
           ,1
           ,''
           ,1
           ,@ProductName
           ,''
           ,@Pos_SizeID
           ,1
           ,3
           ,0
           ,0
           ,0
           ,0
           ,0
           ,@Price
           ,0
           ,'Stock entry-BR'
           ,@BarCode
           ,1
           ,1
           ,@Style
           ,''
           ,''
           ,''
           ,0
           ,1
           ,0
           ,0
           ,''
           ,'0'
           ,''
           ,''
           ,''
           ,''
           ,''
           ,''
           ,''
           ,''
           ,''
           ,1
           ,GETDATE()
           ,1
           ,GETDATE()
           ,1);
           
		Set @Pos_ProductID = (Select top 1 Pos_ProductID from Pos_Product where BarCode=@BarCode)
		

           
			
			
		END
		Set @Pos_ProductID = (Select top 1 Pos_ProductID from Pos_Product where BarCode=@BarCode)
		
 --Production Transaction
			INSERT INTO [Pos_Transaction]
           ([Pos_ProductID]
           ,[Quantity]
           ,[Pos_ProductTrasactionTypeID]
           ,[Pos_ProductTransactionMasterID]
           ,[WorkStationID]
           ,[ExtraField1]
           ,[ExtraField2]
           ,[ExtraField3]
           ,[ExtraField4]
           ,[ExtraField5]
           ,[AddedBy]
           ,[AddedDate]
           ,[UpdatedBy]
           ,[UpdatedDate]
           ,[RowStatusID])
     VALUES
           (@Pos_ProductID
           ,Cast(@ExtraField1 as decimal(10,2))
           ,1
           ,21
           ,1
           ,''
           ,''
           ,''
           ,''
           ,''
           ,1
           ,GETDATE()
           ,1
           ,GETDATE()
           ,1)
			--accounts need to update

		--Issue Transaction
			INSERT INTO [Pos_Transaction]
           ([Pos_ProductID]
           ,[Quantity]
           ,[Pos_ProductTrasactionTypeID]
           ,[Pos_ProductTransactionMasterID]
           ,[WorkStationID]
           ,[ExtraField1]
           ,[ExtraField2]
           ,[ExtraField3]
           ,[ExtraField4]
           ,[ExtraField5]
           ,[AddedBy]
           ,[AddedDate]
           ,[UpdatedBy]
           ,[UpdatedDate]
           ,[RowStatusID])
     VALUES
           (@Pos_ProductID
           ,Cast(@ExtraField1 as decimal(10,2))
           ,9
           ,@Pos_TransactionMasterID
           ,@WorkStationID
           ,''
           ,''
           ,''
           ,''
           ,''
           ,1
           ,GETDATE()
           ,1
           ,GETDATE()
           ,1)
		Declare @Count int
		set @Count=
            (
            select COUNT(*) from Pos_WorkStationStock
            where ProductID=@Pos_ProductID and WorkStationID=@WorkStationID
            )

            if @Count = 0
            BEGIN
                INSERT INTO [Pos_WorkStationStock]
                       ([WorkStationID]
                       ,[ProductID]
                       ,[Stock])
                       VALUES(@WorkStationID,@Pos_ProductID ,CAST(@ExtraField1 as Decimal(10,2)));
            END
            ELSE
            BEGIN
                Update Pos_WorkStationStock set Stock += CAST(@ExtraField1 as Decimal(10,2)) where ProductID=@Pos_ProductID and WorkStationID=@WorkStationID;
            END
    
        
        FETCH NEXT FROM product_cursor INTO @ProductName,@BarCode,@ExtraField1,@Price,@Style,@Size
    END
    CLOSE product_cursor
    DEALLOCATE product_cursor
";
        }
        catch (Exception ex3)
        { }
        #endregion

        #region Centeral
        string sql_HeadOffice;
        sql_HeadOffice = "/*" + ex + total + @"*/
USE GentlePark

Declare @ProductName nvarchar(256)
Declare @ProductID int
Declare @Pos_ProductID int
Declare @BarCode nvarchar(256)
Declare @Style nvarchar(256)
Declare @Size nvarchar(256)
Declare @Pos_SizeID int
Declare @ExtraField1 nvarchar(256)
declare @Price decimal(10,2)
Declare @WorkStationID int
set @WorkStationID=1
Declare @Pos_TransactionMasterID int
Set @Pos_TransactionMasterID=20

DECLARE product_cursor CURSOR FOR 
    SELECT ProductName,Barcode,Qty,Price,Style,Size
    FROM Table_1
    --where cast(Qty as int) >0

    OPEN product_cursor
    FETCH NEXT FROM product_cursor INTO @ProductName,@BarCode,@ExtraField1,@Price,@Style,@Size
    
    WHILE @@FETCH_STATUS = 0
    BEGIN
    
		Set @ProductID = (Select Count(*) from ACC_ChartOfAccountLabel4 where ChartOfAccountLabel4Text=@ProductName and ACC_HeadTypeID=3)
        if @ProductID = 0
        BEGIN
            --Create Product Name
			INSERT INTO [ACC_ChartOfAccountLabel4]
           ([Code]
           ,[ACC_HeadTypeID]
           ,[ChartOfAccountLabel4Text]
           ,[ExtraField1]
           ,[ExtraField2]
           ,[ExtraField3]
           ,[AddedBy]
           ,[AddedDate]
           ,[UpdatedBy]
           ,[UpdatedDate]
           ,[RowStatusID])
     VALUES
           (''
           ,3
           ,@ProductName
           ,SUBSTRING(@BarCode,1,5)
           ,''
           ,'@'
           ,1
           ,GETDATE()
           ,1
           ,GETDATE()
           ,1)
        END
        Set @ProductID = (select top 1 ACC_ChartOfAccountLabel4ID from ACC_ChartOfAccountLabel4 where ChartOfAccountLabel4Text=@ProductName and ACC_HeadTypeID=3)
		
		--add Product
		Set @Pos_ProductID = (Select Count(*) from Pos_Product where BarCode=@BarCode)
        if @Pos_ProductID = 0
        BEGIN
			if(select Count(Pos_SizeID) from Pos_Size where SizeName =@Size) =0
			BEGIN
				set @Pos_SizeID= 46
			END
			ELSE
			BEGIN
				set @Pos_SizeID =(select top 1 Pos_SizeID from Pos_Size where SizeName =@Size)
			END
			
        
			INSERT INTO [Pos_Product]
           ([ProductID]
           ,[ReferenceID]
           ,[Pos_ProductTypeID]
           ,[Inv_UtilizationDetailsIDs]
           ,[ProductStatusID]
           ,[ProductName]
           ,[DesignCode]
           ,[Pos_SizeID]
           ,[Pos_BrandID]
           ,[Inv_QuantityUnitID]
           ,[FabricsCost]
           ,[AccesoriesCost]
           ,[Overhead]
           ,[OthersCost]
           ,[PurchasePrice]
           ,[SalePrice]
           ,[OldSalePrice]
           ,[Note]
           ,[BarCode]
           ,[Pos_ColorID]
           ,[Pos_FabricsTypeID]
           ,[StyleCode]
           ,[Pic1]
           ,[Pic2]
           ,[Pic3]
           ,[VatPercentage]
           ,[IsVatExclusive]
           ,[DiscountPercentage]
           ,[DiscountAmount]
           ,[FabricsNo]
           ,[ExtraField1]
           ,[ExtraField2]
           ,[ExtraField3]
           ,[ExtraField4]
           ,[ExtraField5]
           ,[ExtraField6]
           ,[ExtraField7]
           ,[ExtraField8]
           ,[ExtraField9]
           ,[ExtraField10]
           ,[AddedBy]
           ,[AddedDate]
           ,[UpdatedBy]
           ,[UpdatedDate]
           ,[RowStatusID])
     VALUES
           (@ProductID
           ,1
           ,1
           ,''
           ,1
           ,@ProductName
           ,''
           ,@Pos_SizeID
           ,1
           ,3
           ,0
           ,0
           ,0
           ,0
           ,0
           ,@Price
           ,0
           ,'Stock entry-BR'
           ,@BarCode
           ,1
           ,1
           ,@Style
           ,''
           ,''
           ,''
           ,0
           ,1
           ,0
           ,0
           ,''
           ,@ExtraField1
           ,''
           ,''
           ,''
           ,''
           ,''
           ,''
           ,''
           ,''
           ,''
           ,1
           ,GETDATE()
           ,1
           ,GETDATE()
           ,1);
           
		Set @Pos_ProductID = (Select top 1 Pos_ProductID from Pos_Product where BarCode=@BarCode)
		
            --Transaction
			INSERT INTO [Pos_Transaction]
           ([Pos_ProductID]
           ,[Quantity]
           ,[Pos_ProductTrasactionTypeID]
           ,[Pos_ProductTransactionMasterID]
           ,[WorkStationID]
           ,[ExtraField1]
           ,[ExtraField2]
           ,[ExtraField3]
           ,[ExtraField4]
           ,[ExtraField5]
           ,[AddedBy]
           ,[AddedDate]
           ,[UpdatedBy]
           ,[UpdatedDate]
           ,[RowStatusID])
     VALUES
           (@Pos_ProductID
           ,Cast(@ExtraField1 as decimal(10,2))
           ,1
           ,@Pos_TransactionMasterID
           ,1
           ,''
           ,''
           ,''
           ,''
           ,''
           ,1
           ,GETDATE()
           ,1
           ,GETDATE()
           ,1)
			--accounts need to update
			
			
		END
		Set @Pos_ProductID = (Select top 1 Pos_ProductID from Pos_Product where BarCode=@BarCode)
		
        update Pos_Product set ExtraField1=@ExtraField1 where Pos_ProductID=@Pos_ProductID

        FETCH NEXT FROM product_cursor INTO @ProductName,@BarCode,@ExtraField1,@Price,@Style,@Size
    END
    CLOSE product_cursor
    DEALLOCATE product_cursor
";
        #endregion

        txtCursor.Text = sql;
        CommonManager.SQLExec(sql_HeadOffice);
        //CommonManager.SQLExec(sql);



        //DataSet ds = MSSQL.SQLExec(sql + "; select Count(*) from Mem_Fees where Comn_PaymentByID=2");
        //Label1.Text = ds.Tables[0].Rows.Count + " Record(s) Added Successfully";
        //btnSave.Visible = false;
    }
示例#19
0
 protected void btnJournalMasterSave_Click(object sender, EventArgs e)
 {
     CommonManager.SQLExec("update ACC_JournalMaster set JournalMasterName='" + ddlJournalType.SelectedValue + @"' where ACC_JournalMasterID=" + Request.QueryString["JournalMasterID"]);
     Response.Redirect("JournalModification.aspx?JournalMasterID=" + txtJournalID.Text);
 }
示例#20
0
        public SetAppView()
        {
            InitializeComponent();

            if (CommonManager.Instance.NWMode == true)
            {
                tabItem1.Foreground      = SystemColors.GrayTextBrush;
                grid_AppRecEnd.IsEnabled = false;
                grid_AppRec.IsEnabled    = false;
                ViewUtil.SetIsEnabledChildren(grid_AppCancelMain, false);
                ViewUtil.SetIsEnabledChildren(grid_AppCancelMainInput, false);
                textBox_process.SetReadOnlyWithEffect(true);

                ViewUtil.SetIsEnabledChildren(grid_AppReserve1, false);
                ViewUtil.SetIsEnabledChildren(grid_AppReserve2, false);
                ViewUtil.SetIsEnabledChildren(grid_AppReserveIgnore, false);
                text_RecInfo2RegExp.SetReadOnlyWithEffect(true);
                checkBox_autoDel.IsEnabled = false;
                ViewUtil.SetIsEnabledChildren(grid_App2DelMain, false);
                listBox_ext.IsEnabled = true;
                textBox_ext.SetReadOnlyWithEffect(true);
                grid_App2DelChkFolderText.IsEnabled = true;
                listBox_chk_folder.IsEnabled        = true;
                textBox_chk_folder.SetReadOnlyWithEffect(true);
                button_chk_open.IsEnabled = true;

                grid_recname.IsEnabled      = false;
                checkBox_noChkYen.IsEnabled = false;
                grid_delReserve.IsEnabled   = false;

                checkBox_wakeReconnect.IsEnabled    = true;
                stackPanel_WoLWait.IsEnabled        = true;
                checkBox_suspendClose.IsEnabled     = true;
                checkBox_ngAutoEpgLoad.IsEnabled    = true;
                checkBox_keepTCPConnect.IsEnabled   = true;
                grid_srvResident.IsEnabled          = false;
                button_srvSetting.IsEnabled         = false;
                label_shortCutSrv.IsEnabled         = false;
                button_shortCutSrv.IsEnabled        = false;
                checkBox_srvSaveNotifyLog.IsEnabled = false;
                checkBox_srvSaveDebugLog.IsEnabled  = false;
                grid_tsExt.IsEnabled = false;
            }
            else
            {
                checkBox_srvShowTray.Click            += SetIsEnabledBlinkPreRec;
                checkBox_srvShowTray.IsEnabledChanged += (sender, e) => SetIsEnabledBlinkPreRec(null, null);
            }

            //0 全般
            button_srvSetting.Click += (sender, e) => CommonManager.OpenSrvSetting();

            var SetScButton = new Action <Button, string, string>((btn, baseName, scLinkPath) =>
            {
                string scPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), baseName + ".lnk");
                btn.Content   = File.Exists(scPath) ? "削除" : "作成";
                btn.Click    += (sender, e) =>
                {
                    try
                    {
                        if (File.Exists(scPath))
                        {
                            File.Delete(scPath);
                        }
                        else
                        {
                            CommonUtil.CreateShortCut(scPath, scLinkPath, "");
                        }
                        btn.Content = File.Exists(scPath) ? "削除" : "作成";
                    }
                    catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); }
                };
            });

            SetScButton(button_shortCut, SettingPath.ModuleName, Assembly.GetEntryAssembly().Location);
            SetScButton(button_shortCutSrv, "EpgTimerSrv", Path.Combine(SettingPath.ModulePath, "EpgTimerSrv.exe"));

            //1 録画動作
            button_process_open.Click += ViewUtil.OpenFileNameDialog(textBox_process, true, "", ".exe");
            comboBox_process.Items.AddItems(new[] { "リアルタイム", "高", "通常以上", "通常", "通常以下", "低" });

            var bx = new BoxExchangeEditor(null, listBox_process, true);

            listBox_process.SelectionChanged += ViewUtil.ListBox_TextBoxSyncSelectionChanged(listBox_process, textBox_process);
            if (CommonManager.Instance.NWMode == false)
            {
                bx.AllowKeyAction();
                bx.AllowDragDrop();
                button_process_del.Click += bx.button_Delete_Click;
                button_process_add.Click += ViewUtil.ListBox_TextCheckAdd(listBox_process, textBox_process);
                textBox_process.KeyDown  += ViewUtil.KeyDown_Enter(button_process_add);
            }

            //2 予約管理情報
            button_chk_open.Click += ViewUtil.OpenFolderNameDialog(textBox_chk_folder, "自動削除対象フォルダの選択", true);

            var bxe = new BoxExchangeEditor(null, listBox_ext, true);
            var bxc = new BoxExchangeEditor(null, listBox_chk_folder, true);

            listBox_ext.SelectionChanged   += ViewUtil.ListBox_TextBoxSyncSelectionChanged(listBox_ext, textBox_ext);
            bxc.TargetBox.SelectionChanged += ViewUtil.ListBox_TextBoxSyncSelectionChanged(bxc.TargetBox, textBox_chk_folder);
            bxc.TargetBox.KeyDown          += ViewUtil.KeyDown_Enter(button_chk_open);
            bxc.targetBoxAllowDoubleClick(bxc.TargetBox, (sender, e) => button_chk_open.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            if (CommonManager.Instance.NWMode == false)
            {
                bxe.AllowKeyAction();
                bxe.AllowDragDrop();
                button_ext_del.Click += bxe.button_Delete_Click;
                button_ext_add.Click += ViewUtil.ListBox_TextCheckAdd(listBox_ext, textBox_ext);
                bxc.AllowKeyAction();
                bxc.AllowDragDrop();
                button_chk_del.Click += bxc.button_Delete_Click;
                button_chk_add.Click += (sender, e) => textBox_chk_folder.Text = SettingPath.CheckFolder(textBox_chk_folder.Text);
                button_chk_add.Click += ViewUtil.ListBox_TextCheckAdd(listBox_chk_folder, textBox_chk_folder);

                textBox_ext.KeyDown        += ViewUtil.KeyDown_Enter(button_ext_add);
                textBox_chk_folder.KeyDown += ViewUtil.KeyDown_Enter(button_chk_add);

                checkBox_autoDel_Click(null, null);
            }

            //3 ボタン表示 ボタン表示画面の上下ボタンのみ他と同じものを使用する。
            bxb = new BoxExchangeEditor(this.listBox_itemBtn, this.listBox_viewBtn, true);
            bxt = new BoxExchangeEditor(this.listBox_itemTask, this.listBox_viewTask, true);
            textblockTimer.Text = CommonManager.Instance.NWMode == true ?
                                  "EpgTimerNW側の設定です。" :
                                  "録画終了時にスタンバイ、休止する場合は必ず表示されます(ただし、サービス未使用時はこの設定は使用されず15秒固定)。";

            //上部表示ボタン関係
            bxb.AllowDuplication(StringItem.Items(Settings.ViewButtonSpacer), StringItem.Cloner, StringItem.Comparator);
            button_btnUp.Click   += bxb.button_Up_Click;
            button_btnDown.Click += bxb.button_Down_Click;
            button_btnAdd.Click  += (sender, e) => button_Add(bxb, buttonItem);
            button_btnIns.Click  += (sender, e) => button_Add(bxb, buttonItem, true);
            button_btnDel.Click  += (sender, e) => button_Dell(bxb, bxt, buttonItem);
            bxb.sourceBoxAllowKeyAction(listBox_itemBtn, (sender, e) => button_btnAdd.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            bxb.targetBoxAllowKeyAction(listBox_viewBtn, (sender, e) => button_btnDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            bxb.sourceBoxAllowDoubleClick(listBox_itemBtn, (sender, e) => button_btnAdd.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            bxb.targetBoxAllowDoubleClick(listBox_viewBtn, (sender, e) => button_btnDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            bxb.sourceBoxAllowDragDrop(listBox_itemBtn, (sender, e) => button_btnDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            bxb.targetBoxAllowDragDrop(listBox_viewBtn, (sender, e) => drag_drop(sender, e, button_btnAdd, button_btnIns));

            //タスクアイコン関係
            bxt.AllowDuplication(StringItem.Items(Settings.TaskMenuSeparator), StringItem.Cloner, StringItem.Comparator);
            button_taskUp.Click   += bxt.button_Up_Click;
            button_taskDown.Click += bxt.button_Down_Click;
            button_taskAdd.Click  += (sender, e) => button_Add(bxt, taskItem);
            button_taskIns.Click  += (sender, e) => button_Add(bxt, taskItem, true);
            button_taskDel.Click  += (sender, e) => button_Dell(bxt, bxb, taskItem);
            bxt.sourceBoxAllowKeyAction(listBox_itemTask, (sender, e) => button_taskAdd.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            bxt.targetBoxAllowKeyAction(listBox_viewTask, (sender, e) => button_taskDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            bxt.sourceBoxAllowDoubleClick(listBox_itemTask, (sender, e) => button_taskAdd.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            bxt.targetBoxAllowDoubleClick(listBox_viewTask, (sender, e) => button_taskDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            bxt.sourceBoxAllowDragDrop(listBox_itemTask, (sender, e) => button_taskDel.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            bxt.targetBoxAllowDragDrop(listBox_viewTask, (sender, e) => drag_drop(sender, e, button_taskAdd, button_taskIns));

            //4 カスタムボタン
            button_exe1.Click += ViewUtil.OpenFileNameDialog(textBox_exe1, false, "", ".exe");
            button_exe2.Click += ViewUtil.OpenFileNameDialog(textBox_exe2, false, "", ".exe");
            button_exe3.Click += ViewUtil.OpenFileNameDialog(textBox_exe3, false, "", ".exe");

            //5 iEpg キャンセルアクションだけは付けておく
            new BoxExchangeEditor(null, this.listBox_service, true);
            var bxi = new BoxExchangeEditor(null, this.listBox_iEPG, true);

            bxi.targetBoxAllowKeyAction(this.listBox_iEPG, (sender, e) => button_del.RaiseEvent(new RoutedEventArgs(Button.ClickEvent)));
            bxi.TargetBox.SelectionChanged += ViewUtil.ListBox_TextBoxSyncSelectionChanged(bxi.TargetBox, textBox_station);
            textBox_station.KeyDown        += ViewUtil.KeyDown_Enter(button_add);
        }
示例#21
0
        public void Initialize(List <ProgramViewItem> items, double borderLeftSize, double borderTopSize,
                               bool drawHour, bool isTitleIndent, bool extInfoMode,
                               Dictionary <char, List <KeyValuePair <string, string> > > replaceDictionaryTitle,
                               Dictionary <char, List <KeyValuePair <string, string> > > replaceDictionaryNormal,
                               ItemFont itemFontTitle, ItemFont itemFontNormal, double sizeTitle, double sizeNormal, Brush brushTitle, Brush brushNormal,
                               byte filteredAlpha, List <Brush> contentBrushList)
        {
            LastItemRenderTextHeight = 0;
            textDrawLists            = null;
            Items            = items;
            FilteredAlpha    = filteredAlpha;
            ContentBrushList = contentBrushList;
            var ps = PresentationSource.FromVisual(Application.Current.MainWindow);

            if (ps != null && itemFontTitle.GlyphType != null && itemFontNormal.GlyphType != null)
            {
                Matrix m = ps.CompositionTarget.TransformToDevice;
                textDrawLists   = new List <List <Tuple <Brush, GlyphRun> > >(Items.Count);
                _borderLeftSize = borderLeftSize;
                _borderTopSize  = borderTopSize;
                itemFontTitle.PrepareCache();
                itemFontNormal.PrepareCache();

                //ProgramViewItemの座標系は番組表基準なので、この時点でCanvas.SetLeft()によりEpgViewPanel自身の座標を添付済みでなければならない
                double selfLeft = Canvas.GetLeft(this);
                sizeTitle  = Math.Max(sizeTitle, 1);
                sizeNormal = Math.Max(sizeNormal, 1);
                double indentTitle  = sizeTitle * 1.7;
                double indentNormal = isTitleIndent ? indentTitle : 2;

                foreach (ProgramViewItem info in Items)
                {
                    var textDrawList = new List <Tuple <Brush, GlyphRun> >();
                    textDrawLists.Add(textDrawList);

                    double innerLeft = info.LeftPos + borderLeftSize / 2;
                    //0.26は細枠線での微調整
                    double innerTop    = info.TopPos + borderTopSize / 2 - 0.26;
                    double innerWidth  = info.Width - borderLeftSize;
                    double innerHeight = info.Height - borderTopSize;
                    double useHeight   = 0;

                    if (drawHour && isTitleIndent)
                    {
                        //時
                        string hour = (info.EventInfo.StartTimeFlag == 0 ? "?" : info.EventInfo.start_time.Hour.ToString()) + ":";
                        RenderText(hour, textDrawList, itemFontTitle, sizeTitle * 0.8, innerWidth - 1, innerHeight,
                                   innerLeft + 1, innerTop, out useHeight, brushTitle, m, selfLeft);
                    }
                    //分
                    string min = (info.EventInfo.StartTimeFlag == 0 ? "?" : info.EventInfo.start_time.Minute.ToString("d02"));
                    RenderText(min, textDrawList, itemFontTitle, sizeTitle * 0.95, innerWidth - 1, innerHeight,
                               innerLeft + 1, innerTop + useHeight, out useHeight, brushTitle, m, selfLeft);

                    //タイトル
                    string title = info.EventInfo.ShortInfo == null ? "" : info.EventInfo.ShortInfo.event_name;
                    if (replaceDictionaryTitle != null)
                    {
                        title = CommonManager.ReplaceText(title, replaceDictionaryTitle);
                    }
                    if (RenderText(title.Length > 0 ? title : " ", textDrawList, itemFontTitle, sizeTitle,
                                   innerWidth - sizeTitle * 0.5 - indentTitle, innerHeight,
                                   innerLeft + indentTitle, innerTop, out useHeight, brushTitle, m, selfLeft) == false)
                    {
                        info.TitleDrawErr        = true;
                        LastItemRenderTextHeight = info.Height;
                        continue;
                    }
                    if (info.Height < sizeTitle)
                    {
                        //高さ足りない
                        info.TitleDrawErr = true;
                    }
                    LastItemRenderTextHeight = useHeight + sizeNormal * 0.5;

                    if (info.EventInfo.ShortInfo != null)
                    {
                        //説明
                        string detail = info.EventInfo.ShortInfo.text_char;
                        //詳細
                        detail += extInfoMode == false || info.EventInfo.ExtInfo == null ? "" :
                                  "\r\n\r\n" + CommonManager.TrimHyphenSpace(info.EventInfo.ExtInfo.text_char);
                        if (replaceDictionaryNormal != null)
                        {
                            detail = CommonManager.ReplaceText(detail, replaceDictionaryNormal);
                        }
                        RenderText(detail, textDrawList, itemFontNormal, sizeNormal,
                                   innerWidth - sizeTitle * 0.5 - indentNormal, innerHeight - LastItemRenderTextHeight,
                                   innerLeft + indentNormal, innerTop + LastItemRenderTextHeight, out useHeight, brushNormal, m, selfLeft);
                        LastItemRenderTextHeight += useHeight + sizeNormal * 0.25;
                    }
                    LastItemRenderTextHeight = Math.Floor(LastItemRenderTextHeight + borderTopSize + sizeNormal * 0.5);
                    LastItemRenderTextHeight = Math.Min(LastItemRenderTextHeight, info.Height);
                }
            }
        }
示例#22
0
 private void button_recname_Click(object sender, RoutedEventArgs e)
 {
     CommonManager.ShowPlugInSetting(comboBox_recname.SelectedItem as string, "RecName", this);
 }
示例#23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            searchCriteria = CommonManager.GetSearchByDictionary();
            GetSlideshowDetails();

            #region Sort By
            var _count = Request.QueryString["count"];
            if (_count != null)
            {
                currentViewPerPage = Convert.ToInt32(_count);
            }

            var _sortBy = Request.QueryString["sortby"];
            if (_sortBy != null)
            {
                sortBy = _sortBy;
            }

            var _asc = Request.QueryString["asc"];
            if (_asc != null)
            {
                ascending = Convert.ToBoolean(_asc);
            }
            #endregion

            #region Search By
            var _priceRange = Request.QueryString["priceRange"];
            if (_priceRange != null)
            {
                searchCriteria[CommonManager.GetPriceRangeCriterionName()] = _priceRange;
            }

            var _year = Request.QueryString["year"];
            if (_year != null)
            {
                searchCriteria[CommonManager.GetYearCriterionName()] = _year;
            }

            var _genre = Request.QueryString["genre"];
            if (_genre != null)
            {
                searchCriteria[CommonManager.GetGenreCriterionName()] = _genre;
            }

            var _bestSeller = Request.QueryString["bestSeller"];
            if (_bestSeller != null)
            {
                searchCriteria[CommonManager.GetBestSellerCriterionName()] = _bestSeller;
            }

            var _onSale = Request.QueryString["onSale"];
            if (_onSale != null)
            {
                searchCriteria[CommonManager.GetOnSaleCriterionName()] = _onSale;
            }
            #endregion

            var _page = Request.QueryString["page"];
            if (_page != null)
            {
                currentPage = Convert.ToInt32(_page);
            }

            if (ascending)
            {
                anchorAsc.Attributes["style"]  = "color:#33cc99;font-size:11px;";
                anchorDesc.Attributes["style"] = "color:#999;font-size:11px;";
            }
            else
            {
                anchorAsc.Attributes["style"]  = "color:#999;font-size:11px;";
                anchorDesc.Attributes["style"] = "color:#33cc99;font-size:11px;";
            }

            AddSortByOptions();
            AddSearchByOptions();

            GetListDetails();
        }
示例#24
0
 public string Index()
 {
     return(CommonManager.GetIP(Request));
 }
示例#25
0
    private void DeleteSingleTransactionMaster()
    {
        int Pos_TransactionMasterID = int.Parse(Request.QueryString["Pos_TransactionMasterID"]);

        Pos_TransactionMaster pos_TransactionMaster = Pos_TransactionMasterManager.GetPos_TransactionMasterByID(Pos_TransactionMasterID);
        //Item Info
        List <Pos_Product> items = new List <Pos_Product>();

        items = Pos_ProductManager.GetAllPos_ProductsByTrasactionMasterID(Pos_TransactionMasterID);

        string sql = "";

        sql  = "Update Pos_TransactionMaster set  UpdatedDate=GetDate(),UpdatedBy=" + getLogin().LoginID.ToString() + @" where Pos_TransactionMasterID=" + Request.QueryString["Pos_TransactionMasterID"] + ";";
        sql += "Update Pos_Transaction set  UpdatedDate=GetDate(),UpdatedBy=" + getLogin().LoginID.ToString() + @",RowStatusID=3 where Pos_ProductTransactionMasterID=" + Request.QueryString["Pos_TransactionMasterID"] + " and  Pos_TransactionID=" + Request.QueryString["Pos_TransactionID"] + ";";
        bool executionProgramed = false;

        switch (pos_TransactionMaster.Pos_TransactionTypeID)
        {
        case 1:
            break;

        case 2:
            break;

        case 3:
            break;

        case 4:
            break;

        case 5:
            break;

        case 6:
            break;

        case 7:
            break;

        case 8:
            break;

        case 9:     //issue to show room
            executionProgramed = true;
            if (pos_TransactionMaster.ExtraField5 != "Pending")
            {
                foreach (Pos_Product item in items)
                {
                    sql += "Update Pos_WorkStationStock set   Stock -= " + item.ExtraField1 + @" where ProductID=" + item.Pos_ProductID.ToString() + @" and WorkStationID=" + pos_TransactionMaster.WorkSatationID.ToString() + ";";
                    sql += "Update Pos_Product set ExtraField1 =(cast(ExtraField1 as decimal(10,2)) + ((" + "+1" + ")*" + item.ExtraField1 + ")) where Pos_ProductID=" + item.Pos_ProductID.ToString() + ";";

                    sql += "Update ACC_JournalMaster set RowStatusID=3 where ExtraField2='POS ISSUE' and ExtraField3='" + Request.QueryString["Pos_TransactionMasterID"] + @"';";
                    sql += "Update ACC_JournalDetail set RowStatusID=3 where JournalMasterID=(select ACC_JournalMasterID from ACC_JournalMaster where ExtraField2='POS ISSUE' and ExtraField3='" + Request.QueryString["Pos_TransactionMasterID"] + @"');";
                }
            }
            else
            {
                foreach (Pos_Product item in items)
                {
                    sql += "Update Pos_Product set ExtraField1 =(cast(ExtraField1 as decimal(10,2)) + ((" + "+1" + ")*" + item.ExtraField1 + ")) where Pos_ProductID=" + item.Pos_ProductID.ToString() + ";";
                }
            }

            break;

        case 10:    //issue return to show room
            executionProgramed = true;
            if (pos_TransactionMaster.ExtraField5 != "Pending")
            {
                foreach (Pos_Product item in items)
                {
                    sql += "Update Pos_WorkStationStock set   Stock += " + item.ExtraField1 + @" where ProductID=" + item.Pos_ProductID.ToString() + @" and WorkStationID=" + pos_TransactionMaster.WorkSatationID.ToString() + ";";
                    sql += "Update Pos_Product set ExtraField1 =(cast(ExtraField1 as decimal(10,2)) + ((" + "-1" + ")*" + item.ExtraField1 + ")) where Pos_ProductID=" + item.Pos_ProductID.ToString() + ";";
                }
            }
            else
            {
                foreach (Pos_Product item in items)
                {
                    sql += "Update Pos_WorkStationStock set   Stock += " + item.ExtraField1 + @" where ProductID=" + item.Pos_ProductID.ToString() + @" and WorkStationID=" + pos_TransactionMaster.WorkSatationID.ToString() + ";";
                }
            }
            break;

        case 11:     //Send to another Branch
        {
            executionProgramed = true;
            //Sender Delete
            foreach (Pos_Product item in items)
            {
                sql += "Update Pos_WorkStationStock set   Stock += " + item.ExtraField1 + @" where ProductID=" + item.Pos_ProductID.ToString() + @" and WorkStationID=" + pos_TransactionMaster.WorkSatationID.ToString() + ";";
            }

            //Receiver Delete
            Pos_TransactionMasterID++;
            pos_TransactionMaster = Pos_TransactionMasterManager.GetPos_TransactionMasterByID(Pos_TransactionMasterID);
            sql  = "Update Pos_TransactionMaster set  UpdatedDate=GetDate(),UpdatedBy=" + getLogin().LoginID.ToString() + @",RowStatusID=3 where Pos_TransactionMasterID=" + Pos_TransactionMasterID.ToString() + ";";
            sql += "Update Pos_Transaction set  UpdatedDate=GetDate(),UpdatedBy=" + getLogin().LoginID.ToString() + @",RowStatusID=3 where Pos_ProductTransactionMasterID=" + Pos_TransactionMasterID.ToString() + ";";

            //Item Info
            if (pos_TransactionMaster.ExtraField5 != "Pending")
            {
                items = new List <Pos_Product>();
                items = Pos_ProductManager.GetAllPos_ProductsByTrasactionMasterID(Pos_TransactionMasterID);

                foreach (Pos_Product item in items)
                {
                    sql += "Update Pos_WorkStationStock set   Stock -= " + item.ExtraField1 + @" where ProductID=" + item.Pos_ProductID.ToString() + @" and WorkStationID=" + pos_TransactionMaster.WorkSatationID.ToString() + ";";
                }
            }
            break;
        }

        case 12:     //Received from another branch
            showAlartMessage("Please ask the sender branch to delete.");
            break;

        case 13:     //Sales
        {
            executionProgramed = true;

            if (pos_TransactionMaster.UpdatedBy < 0)        //when sales return
            {
                //cencel the sales return
                sql += "Update Pos_TransactionMaster set  UpdatedDate=GetDate(),UpdatedBy=" + getLogin().LoginID.ToString() + @",RowStatusID=3 where Pos_TransactionMasterID=" + (-1 * pos_TransactionMaster.UpdatedBy) + ";";
                sql += "Update Pos_Transaction set  UpdatedDate=GetDate(),UpdatedBy=" + getLogin().LoginID.ToString() + @",RowStatusID=3 where Pos_ProductTransactionMasterID=" + (-1 * pos_TransactionMaster.UpdatedBy) + ";";

                string  returnSales      = "select * from Pos_Transaction where Pos_ProductTransactionMasterID=" + (-1 * pos_TransactionMaster.UpdatedBy) + ";";
                DataSet dsReturnSales    = CommonManager.SQLExec(returnSales);
                bool    masterNotUpdated = true;
                foreach (DataRow dr in dsReturnSales.Tables[0].Rows)
                {
                    if (masterNotUpdated)
                    {
                        //update the sales of which the sales was returned
                        sql += "Update Pos_TransactionMaster set UpdatedDate=GetDate(), Particulars= cast(Particulars as nvarchar(max))+'<hr/>Sales Return Cancelled' where Pos_TransactionMasterID=(Select Pos_ProductTransactionMasterID from Pos_Transaction where  Pos_TransactionID=" + dr["ExtraField4"] + ");";

                        masterNotUpdated = false;
                    }

                    //revercing the sales return
                    sql += "Update Pos_Transaction set  UpdatedDate=GetDate(),UpdatedBy=" + getLogin().LoginID.ToString() + @",ExtraField4= (cast(ExtraField4 as int)-" + decimal.Parse(dr["Quantity"].ToString()).ToString("0") + ") where Pos_TransactionID=" + dr["ExtraField4"] + ";";
                    sql += "update Pos_WorkStationStock set Stock-=" + decimal.Parse(dr["Quantity"].ToString()).ToString("0") + " where WorkStationID=" + pos_TransactionMaster.WorkSatationID.ToString() + " and ProductID=" + dr["Pos_ProductID"] + ";";
                }
            }

            foreach (Pos_Product item in items)
            {
                sql += "Update Pos_WorkStationStock set   Stock += " + item.ExtraField1 + @" where ProductID=" + item.Pos_ProductID.ToString() + @" and WorkStationID=" + pos_TransactionMaster.WorkSatationID.ToString() + ";";
            }

            sql += "Update ACC_JournalMaster set RowStatusID=3 where ExtraField2='POS SALE' and ExtraField3='" + Request.QueryString["Pos_TransactionMasterID"] + @"';";
            sql += "Update ACC_JournalDetail set RowStatusID=3 where JournalMasterID=(select ACC_JournalMasterID from ACC_JournalMaster where ExtraField2='POS SALE' and ExtraField3='" + Request.QueryString["Pos_TransactionMasterID"] + @"');";
        }
        break;

        case 25:    //Purchase
        {
            executionProgramed = true;
            string sql_tmp = @"Select * from Pos_Transaction where Pos_TransactionID=" + Request.QueryString["Pos_TransactionID"]
                             + "; Select * from ACC_JournalMaster where Note='" + "Product Purchase-'+(Select cast(TransactionID as nvarchar) from Pos_TransactionMaster where Pos_TransactionMasterID=" + Request.QueryString["Pos_TransactionMasterID"] + ")";

            DataSet ds = CommonManager.SQLExec(sql_tmp);
            if (pos_TransactionMaster.ExtraField5 != "Pending")
            {
                foreach (Pos_Product item in items)
                {
                    if (ds.Tables[0].Rows[0]["Pos_ProductID"].ToString() == item.Pos_ProductID.ToString())
                    {
                        sql += "; update Pos_Product set pos_Product.RowStatusID = 3 where Pos_ProductID=" + item.Pos_ProductID;
                        sql += "; Update [Pos_Transaction] set [RowStatusID]=3 where Pos_TransactionID=" + Request.QueryString["Pos_TransactionID"];
                        sql += "; Update [ACC_JournalDetail] set [RowStatusID]=3 where [JournalMasterID]=" + ds.Tables[1].Rows[0]["ACC_JournalMasterID"].ToString() + " and ExtraField1='" + item.Pos_ProductID.ToString() + "'";
                        break;
                    }
                }
            }
            else
            {
                foreach (Pos_Product item in items)
                {
                    if (ds.Tables[0].Rows[0]["Pos_ProductID"].ToString() == item.Pos_ProductID.ToString())
                    {
                        sql += "; update Pos_Product set pos_Product.RowStatusID = 3 where Pos_ProductID=" + item.Pos_ProductID;
                        sql += "; Update [Pos_Transaction] set [RowStatusID]=3 where Pos_TransactionID=" + Request.QueryString["Pos_TransactionID"];
                        sql += "; Update [ACC_JournalDetail] set [RowStatusID]=3 where [JournalMasterID]=" + ds.Tables[1].Rows[0]["ACC_JournalMasterID"].ToString() + " and ExtraField1='" + item.Pos_ProductID.ToString() + "'";
                        break;
                    }
                }
            }
        }
        break;

        default:
            break;
        }

        if (executionProgramed)
        {
            try
            {
                CommonManager.SQLExec(sql);
                showAlartMessage("Delete Successfully");
            }
            catch (Exception ex)
            {
                showAlartMessage("Delete Error");
            }
        }
    }
示例#26
0
    private void loadACC_ChartOfAccountLabel4()
    {
        string sql = @"
SELECT ACC_ChartOfAccountLabel4.[ACC_ChartOfAccountLabel4ID]
      ,ACC_ChartOfAccountLabel4.[Code]
      ,ACC_ChartOfAccountLabel4.[ACC_HeadTypeID]
      ,ACC_HeadType.HeadTypeName +' -> '+ACC_ChartOfAccountLabel4.[ChartOfAccountLabel4Text] as ChartOfAccountLabel4Text
      ,ACC_ChartOfAccountLabel4.[ExtraField1]
      ,ACC_ChartOfAccountLabel4.[ExtraField2]
      ,ACC_ChartOfAccountLabel4.[ExtraField3]
      ,ACC_ChartOfAccountLabel4.[AddedBy]
      ,ACC_ChartOfAccountLabel4.[AddedDate]
      ,ACC_ChartOfAccountLabel4.[UpdatedBy]
      ,ACC_ChartOfAccountLabel4.[UpdatedDate]
      ,ACC_ChartOfAccountLabel4.[RowStatusID] 
        ,ACC_ChartOfAccountLabel4Visibility.IsVisible
FROM ACC_ChartOfAccountLabel4
    inner join ACC_HeadType on ACC_HeadType.ACC_HeadTypeID=ACC_ChartOfAccountLabel4.ACC_HeadTypeID
left outer join ACC_ChartOfAccountLabel4Visibility on ACC_ChartOfAccountLabel4Visibility.ACC_ChartOfAccountLabel4ID
=ACC_ChartOfAccountLabel4.[ACC_ChartOfAccountLabel4ID]
where ACC_ChartOfAccountLabel4.[RowStatusID] =1	
order by ACC_HeadType.ACC_HeadTypeID,ACC_ChartOfAccountLabel4.[ChartOfAccountLabel4Text]
";


        DataSet ds = CommonManager.SQLExec(sql);

        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            try
            {
                dr["IsVisible"] = bool.Parse(dr["IsVisible"].ToString());
            }
            catch (Exception ex)
            {
                dr["IsVisible"] = false;
            }
        }


        //List<ACC_ChartOfAccountLabel4> aCC_ChartOfAccountLabel4s = new List<ACC_ChartOfAccountLabel4>();
        //aCC_ChartOfAccountLabel4s = ACC_ChartOfAccountLabel4Manager.GetAllACC_ChartOfAccountLabel4sForJournalEntry();

        ddlWorkSatation.Items.Add(new ListItem("Select WorkStation", "0"));
        ddlShowRoom.Items.Add(new ListItem("All Show Room", "0"));
        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            if (!bool.Parse(dr["IsVisible"].ToString()))
            {
                ListItem item = new ListItem(dr["ChartOfAccountLabel4Text"].ToString(), dr["ACC_HeadTypeID"].ToString() + "@" + dr["ACC_ChartOfAccountLabel4ID"].ToString());
                ddlAllACC_ChartOfAccountLabel4.Items.Add(item);

                if (dr["ACC_HeadTypeID"].ToString() == "1")
                {
                    item = new ListItem(dr["ChartOfAccountLabel4Text"].ToString(), dr["ACC_ChartOfAccountLabel4ID"].ToString());
                    ddlWorkSatation.Items.Add(item);
                }

                if ((dr["ACC_ChartOfAccountLabel4ID"].ToString() == "1" || dr["ChartOfAccountLabel4Text"].ToString().ToLower().Contains("show room")) &&
                    dr["ACC_HeadTypeID"].ToString() == "1")
                {
                    item = new ListItem(dr["ChartOfAccountLabel4Text"].ToString(), dr["ACC_ChartOfAccountLabel4ID"].ToString());
                    ddlShowRoom.Items.Add(item);
                }
            }
        }
        //foreach (ACC_ChartOfAccountLabel4 aCC_ChartOfAccountLabel4 in aCC_ChartOfAccountLabel4s)
        //{
        //    ListItem item = new ListItem(aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text.ToString(), aCC_ChartOfAccountLabel4.ACC_HeadTypeID.ToString() + "@" + aCC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID.ToString());
        //    ddlAllACC_ChartOfAccountLabel4.Items.Add(item);

        //    if (aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 1)
        //    {
        //        item = new ListItem(aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text.ToString(), aCC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID.ToString());
        //        ddlWorkSatation.Items.Add(item);
        //    }

        //    if ((aCC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID==1 || aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text.ToLower().Contains("show room")) &&
        //        aCC_ChartOfAccountLabel4.ACC_HeadTypeID == 1)
        //    {
        //        item = new ListItem(aCC_ChartOfAccountLabel4.ChartOfAccountLabel4Text.ToString(), aCC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID.ToString());
        //        ddlShowRoom.Items.Add(item);
        //    }
        //}
    }
示例#27
0
        protected override void OnRender(DrawingContext dc)
        {
            dc.DrawRectangle(Background, null, new Rect(RenderSize));

            var ps = PresentationSource.FromVisual(this);

            if (ps == null || Items == null)
            {
                return;
            }
            Matrix m = ps.CompositionTarget.TransformToDevice;

            var itemFontTitle  = new EpgView.EpgViewPanel.ItemFont(Settings.Instance.FontNameTitle, Settings.Instance.FontBoldTitle, true);
            var itemFontNormal = new EpgView.EpgViewPanel.ItemFont(Settings.Instance.FontName, false, true);

            if (itemFontTitle.GlyphType == null || itemFontNormal.GlyphType == null)
            {
                return;
            }

            {
                double          sizeTitle    = Math.Max(Settings.Instance.FontSizeTitle, 1);
                double          sizeNormal   = Math.Max(Settings.Instance.FontSize, 1);
                double          indentTitle  = sizeTitle * 1.7;
                double          indentNormal = 2;
                SolidColorBrush colorTitle   = CommonManager.Instance.CustTitle1Color;
                SolidColorBrush colorNormal  = CommonManager.Instance.CustTitle2Color;

                foreach (ReserveViewItem info in Items)
                {
                    var textDrawList = new List <Tuple <Brush, GlyphRun> >();

                    double innerLeft   = info.LeftPos + 1;
                    double innerTop    = info.TopPos + 1;
                    double innerWidth  = info.Width - 2;
                    double innerHeight = info.Height - 2;
                    double useHeight;

                    info.TitleDrawErr = true;

                    //分
                    string min = info.ReserveInfo.StartTime.Minute.ToString("d02");
                    //設計的にやや微妙だがやる事が同じなのでEpgViewPanelのメソッドを流用する
                    if (EpgView.EpgViewPanel.RenderText(min, textDrawList, itemFontTitle, sizeTitle * 0.95,
                                                        innerWidth - 1, innerHeight,
                                                        innerLeft + 1, innerTop, out useHeight, colorTitle, m, 0))
                    {
                        //サービス名
                        string serviceName = info.ReserveInfo.StationName;
                        serviceName += " (" + CommonManager.ConvertNetworkNameText(info.ReserveInfo.OriginalNetworkID) + ")";
                        if (EpgView.EpgViewPanel.RenderText(serviceName, textDrawList, itemFontTitle, sizeTitle,
                                                            innerWidth - sizeTitle * 0.5 - indentTitle, innerHeight,
                                                            innerLeft + indentTitle, innerTop, out useHeight, colorTitle, m, 0))
                        {
                            double renderTextHeight = useHeight + sizeNormal * 0.5;
                            //番組名
                            if (EpgView.EpgViewPanel.RenderText(info.ReserveInfo.Title, textDrawList, itemFontNormal, sizeNormal,
                                                                innerWidth - sizeTitle * 0.5 - indentNormal, innerHeight - renderTextHeight,
                                                                innerLeft + indentNormal, innerTop + renderTextHeight, out useHeight, colorNormal, m, 0))
                            {
                                info.TitleDrawErr = innerHeight < renderTextHeight + useHeight;
                            }
                        }
                    }

                    if (info.Width > 0 && info.Height > 0)
                    {
                        dc.DrawRectangle(Brushes.LightGray, null, new Rect(info.LeftPos, info.TopPos, info.Width, info.Height));
                    }
                    if (innerWidth > 0 && innerHeight > 0)
                    {
                        var textArea = new Rect(innerLeft, innerTop, innerWidth, innerHeight);
                        dc.DrawRectangle(info.ReserveInfo.OverlapMode == 1 ? Brushes.Yellow : Brushes.White, null, textArea);
                        dc.PushClip(new RectangleGeometry(textArea));
                        foreach (Tuple <Brush, GlyphRun> txtinfo in textDrawList)
                        {
                            dc.DrawGlyphRun(txtinfo.Item1, txtinfo.Item2);
                        }
                        dc.Pop();
                    }
                }
            }
        }
示例#28
0
    protected void btnDeleteTransaction_Click(object sender, EventArgs e)
    {
        if ((rbtnTransactionType.SelectedValue == "13" || rbtnTransactionType.SelectedValue == "14") && ddlWorkStationForTransactionReport.SelectedValue == "0")
        {
            showAlartMessage("Please select the Branch for any Sales voucher");
            return;
        }

        makeAllTheLinkInvisible();
        hlnkLinkForDeleteTransaction.Visible = true;

        string sql = "Select Pos_TransactionMasterID from Pos_TransactionMaster where TransactionID=" + txtID.Text + " and Pos_TransactionTypeID=" + rbtnTransactionType.SelectedValue;

        if (rbtnTransactionType.SelectedValue == "13"
            ||
            rbtnTransactionType.SelectedValue == "14"
            )
        {
            sql += " and WorkSatationID=" + ddlWorkStationForTransactionReport.SelectedValue;
        }
        hlnkLinkForDeleteTransaction.NavigateUrl = "TransactionPrint.aspx?Delete=1&Pos_TransactionMasterID=" + CommonManager.SQLExec(sql).Tables[0].Rows[0][0].ToString();
    }
    private void loadData()
    {
        int suppliyerID = 0;

        try
        {
            suppliyerID = Int32.Parse(Request.QueryString["SuppliyerID"]);
        }
        catch (Exception ex)
        {
            suppliyerID = 0;
        }
        int RawmaterialsTypeID = 0;

        try
        {
            RawmaterialsTypeID = Int32.Parse(Request.QueryString["RawmaterialsTypeID"]);
        }
        catch (Exception ex)
        {
            RawmaterialsTypeID = 0;
        }

        string fromDate = (Request.QueryString["FromDate"] != null ? Request.QueryString["FromDate"].ToString() : "");
        string toDate   = (Request.QueryString["ToDate"] != null ? Request.QueryString["ToDate"].ToString() : "");

        //purchase info
        string sql = @"select SUM(Inv_ItemTransaction.Quantity) as Quantity,Inv_QuantityUnit.QuantityUnitName
,ACC_ChartOfAccountLabel4.ChartOfAccountLabel4Text
,ACC_ChartOfAccountLabel4.ExtraField1
,SUM(Inv_ItemTransaction.Quantity * Inv_Item.PricePerUnit) as TotalAmount 
,Inv_Item.ItemCode,Inv_Item.RawMaterialID
from
Inv_Item inner join Inv_Purchase on Inv_Purchase.Inv_PurchaseID = Inv_Item.PurchaseID
inner join ACC_ChartOfAccountLabel4 on ACC_ChartOfAccountLabel4.ACC_ChartOfAccountLabel4ID= Inv_Item.RawMaterialID
inner join ACC_ChartOfAccountLabel4 as Supplier on Supplier.ACC_ChartOfAccountLabel4ID= Inv_Purchase.SuppierID
inner join Inv_QuantityUnit on Inv_QuantityUnit.Inv_QuantityUnitID=Inv_Item.QuantityUnitID
inner join Inv_ItemTransaction on Inv_ItemTransaction.ItemID =Inv_Item.Inv_ItemID
inner join Inv_PurchaseReturn on Inv_PurchaseReturn.Inv_PurchaseReturenID = Inv_ItemTransaction.ReferenceID
where   Inv_ItemTransaction.ItemTrasactionTypeID =7 and  (Inv_ItemTransaction.AddedDate between '" + fromDate + "' and '" + toDate + "')";

        if (suppliyerID != 0)
        {
            sql += " and Inv_Purchase.SuppierID =" + suppliyerID;
        }

        if (RawmaterialsTypeID != 0)
        {
            sql += " and ACC_ChartOfAccountLabel4.ACC_HeadTypeID =" + RawmaterialsTypeID;
        }

        sql += @"
group by Inv_QuantityUnit.QuantityUnitName
,ACC_ChartOfAccountLabel4.ChartOfAccountLabel4Text
,ACC_ChartOfAccountLabel4.ExtraField1
,Inv_Item.ItemCode,Inv_Item.RawMaterialID
order by Inv_Item.RawMaterialID,ItemCode;";

        if (suppliyerID != 0)
        {
            sql += "select ChartOfAccountLabel4Text,ACC_ChartOfAccountLabel4ID,ExtraField2 from ACC_ChartOfAccountLabel4 where ACC_ChartOfAccountLabel4ID =" + suppliyerID;
        }


        DataSet ds = CommonManager.SQLExec(sql);


        string  RawMaterialID  = "0";
        decimal Total          = 0;
        decimal Subtotal       = 0;
        decimal TotalAmount    = 0;
        decimal SubtotalAmount = 0;
        int     serialNo       = 1;

        string htmlTable = @" <table id='itemList_tbl' style='border:1px solid black;width:100%;' cellpadding='0' cellspacing='0'>
                        ";



        if (suppliyerID != 0)
        {
            htmlTable += @"<tr>
                            <td colspan='4' style='padding-left:50px;border-top:1px solid black;'>
                                <b>Supplier name:</b> " + ds.Tables[1].Rows[0]["ChartOfAccountLabel4Text"].ToString() + @"
                            </td>
                            <td colspan='2' style=' border-top:1px solid black;'>
                                <b>Supplier ID:</b> " + ds.Tables[1].Rows[0]["ACC_ChartOfAccountLabel4ID"].ToString() + @"
                            </td>
                        </tr>
                        <tr>
                            <td colspan='7' style='padding-left:50px;'>
                                <b>Supplier Address:</b> " + ds.Tables[1].Rows[0]["ExtraField2"].ToString() + @"
                            </td>
                        </tr>
                        <tr>
                            <td colspan='7' style='padding-left:50px; border-bottom:1px solid black;'>
                                <b>Transaction Date:</b> " + DateTime.Parse(fromDate).ToString("dd MMM yyyy") + " To " + DateTime.Parse(toDate).ToString("dd MMM yyyy") + @"
                            </td>
                        </tr>";
        }
        else
        {
            htmlTable += @"<tr>
                            <td colspan='6' style='padding-left:50px; border-top:1px solid black;border-bottom:1px solid black;'>
                                All Supplier
                            </td>
                        </tr>";
        }

        foreach (DataRow dr in ds.Tables[0].Rows)
        {
            if (RawMaterialID != "0" && RawMaterialID != dr["RawMaterialID"].ToString())
            {
                htmlTable += @"<tr class='subtotalRow'>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>Sub Total</td>
                            <td>" + Subtotal.ToString("0,0.00") + @"</td>
                            <td>&nbsp;</td>
                            <td>" + SubtotalAmount.ToString("0,0.00") + @"</td>
                        </tr>";

                Subtotal       = 0;
                SubtotalAmount = 0;
            }

            if (RawMaterialID != dr["RawMaterialID"].ToString())
            {
                RawMaterialID = dr["RawMaterialID"].ToString();
                htmlTable    += @"<tr>
                            <td colspan='6' style='padding-left:50px; border-top:1px solid black;border-bottom:1px solid black;'>
                                <b>Item:</b> " + dr["ChartOfAccountLabel4Text"].ToString() + @"
                            </td>
                        </tr>
                        <tr id='tableHeader'>
                            <td  style='border-left:0px;'>S/L</td>
                            <td>Item Code</td>
                            <td>Item Name</td>
                            <td>Quantity</td>
                            <td>Unit</td>
                            <td>Amount</td>
                        </tr>";
            }

            htmlTable += @"<tr class='itemCss'>
                            <td  style='border-left:0px;'>" + (serialNo++).ToString() + @"</td>
                            <td>" + dr["ItemCode"].ToString() + @"</td>
                            <td>" + dr["ChartOfAccountLabel4Text"].ToString() + @"</td>
                            <td style='text-align:right;'>" + decimal.Parse(dr["Quantity"].ToString()).ToString("0,0.00") + @"</td>
                            <td >" + dr["QuantityUnitName"].ToString() + @"</td>
                            <td style='text-align:right;'>" + decimal.Parse(dr["TotalAmount"].ToString()).ToString("0,0.00") + @"</td>
                        </tr>";

            Subtotal       += decimal.Parse(dr["Quantity"].ToString());
            SubtotalAmount += decimal.Parse(dr["TotalAmount"].ToString());

            Total       += decimal.Parse(dr["Quantity"].ToString());
            TotalAmount += decimal.Parse(dr["TotalAmount"].ToString());
        }

        htmlTable += @"<tr class='subtotalRow'>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>Sub Total</td>
                            <td>" + Subtotal.ToString("0,0.00") + @"</td>
                            <td>&nbsp;</td>
                            <td>" + SubtotalAmount.ToString("0,0.00") + @"</td>
                        </tr>";

        htmlTable += @"<tr id='lastRow'>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>Grand Total</td>
                        <td>" + Total.ToString("0,0.00") + @"</td>
                        <td>&nbsp;</td>
                        <td>" + TotalAmount.ToString("0,0.00") + @"</td>
                    </tr></table>";



        lblItemList.Text = htmlTable;
    }
示例#30
0
        public ActionResult Crear(ComponenteElectricoTipoViewModel model, FormCollection collection)
        {
            var equipo = _equiposManager.Find(Convert.ToInt32(TempData["equipo_id"]));

            if (equipo == null)
            {
                equipo = _equiposManager.Find(Convert.ToInt32(TempData["equipoid"]));
            }

            TempData.Keep();
            ViewBag.Equipo = equipo;
            if (equipo != null)
            {
                ViewBag.obra        = _obrasManager.Find(equipo.obra_id);
                TempData["obra_id"] = equipo.obra_id;
                TempData.Keep();
                ViewBag.ComponentesElectronicos = _componenteselectronicosManager.GetComponentesElectricos(equipo.Id);
            }

            /*
             *
             * ViewBag.obra = _obrasManager.Find(equipo.obra_id);
             *
             * TempData["obra_id"] = equipo.obra_id;
             * TempData.Keep();
             * ViewBag.ComponentesElectronicos = _componenteselectronicosManager.GetComponentesElectricos(Convert.ToInt32(TempData["equipo_id"]));
             */
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            try
            {
                _componenteselectricostiposManager.Crear(
                    model.Descripcion);
                if (TempData["componente"] != null)
                {
                    //TempData["FlashSuccess"] = MensajesResource.INFO_MensajesInstitucionales_CreadoCorrectamente;
                    return(RedirectToAction("Editar", "AdministrarComponentesElectronicos", new { @id = TempData["componente"] }));
                }
                else
                {
                    if (TempData["fallaid"] != null)
                    {
                        return(RedirectToAction("Editar", "AdministrarFallas", new { @id = TempData["fallaid"] }));
                    }
                    else
                    {
                        return(RedirectToAction("CrearPorDefecto", "AdministrarFallas"));
                    }
                }
            }
            catch (BusinessException businessEx)
            {
                ModelState.AddModelError(string.Empty, businessEx.Message);

                return(View(model));
            }
            catch (Exception e)
            {
                var log = CommonManager.BuildMessageLog(
                    TipoMensaje.Error,
                    ControllerContext.Controller.ValueProvider.GetValue("controller").RawValue.ToString(),
                    ControllerContext.Controller.ValueProvider.GetValue("action").RawValue.ToString(),
                    e.ToString(), Request);

                CommonManager.WriteAppLog(log, TipoMensaje.Error);

                ModelState.AddModelError(string.Empty, e.Message);
                return(View(model));
            }
        }
示例#31
0
    private void loadData()
    {
        int Pos_TransactionMasterID = int.Parse(Request.QueryString["Pos_TransactionMasterID"]);

        string sql = @"select   Pos_TransactionMaster.TransactionDate,
                                Pos_TransactionMaster.TransactionID,
                                Pos_TransactionMaster.ToOrFromID as CustomerID,
                                SR.ChartOfAccountLabel4Text as WorkStationName,
                                SR.ExtraField1 as ShowRoomAddress,
                                Pos_TransactionMaster.ExtraField1 as CashAmount, 
                                Pos_TransactionMaster.ExtraField2 as CardAmount, 
                                Pos_TransactionMaster.ExtraField3 as CustomerName, 
                                Pos_TransactionMaster.ExtraField4 as ContactNo,
                                Pos_TransactionMaster.ExtraField5 as CardNo,
                                SP.ChartOfAccountLabel4Text as SalesPerson
                            From
                            Pos_TransactionMaster
                            left outer join ACC_ChartOfAccountLabel4 as SR on SR.ACC_ChartOfAccountLabel4ID = Pos_TransactionMaster.WorkSatationID
                            left outer join ACC_ChartOfAccountLabel4 as SP on SP.ACC_ChartOfAccountLabel4ID = cast(Pos_TransactionMaster.Record as int)
                            where Pos_TransactionMaster.Pos_TransactionMasterID=" + Pos_TransactionMasterID.ToString() + @";

                            select Pos_Product.SalePrice,
                            Pos_Transaction.Quantity,
                            Pos_Product.ProductName,
                            Pos_Product.BarCode,
                            Pos_Transaction.ExtraField1 as Discount,
                            Pos_Transaction.ExtraField2 as Vat
                            from Pos_Product
                            inner join Pos_Transaction on Pos_Transaction.Pos_ProductID = Pos_Product.Pos_ProductID
                            where Pos_Transaction.Pos_ProductTransactionMasterID=" + Pos_TransactionMasterID.ToString() + @"
                            order by Pos_Product.ProductName;";

        DataSet ds = CommonManager.SQLExec(sql);

        string htmlTable = "";

        htmlTable     += @"
                        <table>
                        <tr>
                        <td>SP</td>
                        <td>:</td>
                        <td>" + ds.Tables[0].Rows[0]["SalesPerson"].ToString() + @"</td>
                        </tr>
                        <tr>
                        <td>Date</td>
                        <td>:</td>
                        <td>" + DateTime.Parse(ds.Tables[0].Rows[0]["TransactionDate"].ToString()).ToString("dd-MMM-yyyy hh:mm tt") + @"</td>
                        </tr>
                        <tr>
                        <td>Return Invoice#</td>
                        <td>:</td>
                        <td>" + Request.QueryString["rtnInv"] + @"</td>
                        </tr>
                        <tr>
                        <td>Invoice#</td>
                        <td>:</td>
                        <td>" + ds.Tables[0].Rows[0]["TransactionID"].ToString() + @"</td>
                        </tr>
                        <tr>
                        <td>Card #</td>
                        <td>:</td>
                        <td>" + ds.Tables[0].Rows[0]["CardNo"].ToString() + @"</td>
                        </tr>
                        <tr>
                        <td>Cus Name</td>
                        <td>:</td>
                        <td>" + ds.Tables[0].Rows[0]["CustomerName"].ToString() + @"</td>
                        </tr>
                        <tr>
                        <td>BR Name</td>
                        <td>:</td>
                        <td>" + ds.Tables[0].Rows[0]["WorkStationName"].ToString() + ", " + ds.Tables[0].Rows[0]["ShowRoomAddress"].ToString() + @"</td>
                        </tr>
                        </table>
                        ";
        lblMaster.Text = htmlTable;

        htmlTable = @"<hr/>Sales<hr/><table id='dataTable' cellspacing='0' border='0' cellpadding='0'><tr class='bordered'><td>SI</td><td style='text-align:center;'>Item</td><td>Qty</td><td>U. Price</td><td>Total Price</td></tr>";
        int     count         = 1;
        decimal totalPrie     = 0;
        decimal totalQty      = 0;
        decimal totalDiscount = 0;
        decimal totalVat      = 0;

        foreach (DataRow dr in ds.Tables[1].Rows)
        {
            totalPrie     += decimal.Parse(dr["SalePrice"].ToString()) * decimal.Parse(dr["Quantity"].ToString());
            totalQty      += decimal.Parse(dr["Quantity"].ToString());
            totalDiscount += decimal.Parse(dr["Discount"].ToString());
            totalVat      += decimal.Parse(dr["Vat"].ToString());
            htmlTable     += @"<tr class='bordered'><td>" + (count++).ToString() + "</td><td>" + dr["BarCode"].ToString() + "<br/>" + dr["ProductName"].ToString() + "</td><td>" + decimal.Parse(dr["Quantity"].ToString()).ToString("0,0") + "</td><td>" + decimal.Parse(dr["SalePrice"].ToString()).ToString("0,0.00") + "</td><td>" + (decimal.Parse(dr["SalePrice"].ToString()) * decimal.Parse(dr["Quantity"].ToString())).ToString("0,0.00") + "</td></tr>";
        }

        htmlTable += @"<tr><td colspan='5'>....................................................................</td></tr>";
        htmlTable += @"<tr><td></td><td>Sub Total:</td><td>" + totalQty.ToString("0,0") + "</td><td></td><td>" + totalPrie.ToString("0,0.00") + "</td></tr>";
        htmlTable += @"<tr><td></td><td>Discount:</td><td></td><td></td><td>" + totalDiscount.ToString("0,0.00") + "</td></tr>";
        htmlTable += @"<tr><td></td><td>VAT:</td><td></td><td></td><td>" + totalVat.ToString("0,0.00") + "</td></tr>";
        htmlTable += @"<tr><td colspan='5'>....................................................................</td></tr>";

        htmlTable += @"<tr><td></td><td>Due Amount:</td><td></td><td></td><td>" + (totalPrie - totalDiscount + totalVat).ToString("0,0.00") + "</td></tr>";
        htmlTable += @"<tr><td></td><td>Paid:</td><td></td><td></td><td>" + (totalPrie - totalDiscount + totalVat).ToString("0,0.00") + "</td></tr>";
        htmlTable += @"<tr><td></td><td>Change:</td><td></td><td></td><td>0.00</td></tr>";
        htmlTable += @"<tr><td colspan='5'>....................................................................</td></tr>";
        htmlTable += @"<tr><td colspan='5' style='text-align:Center;font-size: 14px;color:Red; font-weight: bold;'>Mode Of Payment</td></tr>";
        if (decimal.Parse(ds.Tables[0].Rows[0]["CashAmount"].ToString()) != 0)
        {
            htmlTable += @"<tr><td></td><td>Cash:</td><td></td><td></td><td>" + decimal.Parse(ds.Tables[0].Rows[0]["CashAmount"].ToString()).ToString("0,0.00") + "</td></tr>";
        }

        if (decimal.Parse(ds.Tables[0].Rows[0]["CardAmount"].ToString()) != 0)
        {
            htmlTable += @"<tr><td></td><td>Credit:</td><td></td><td></td><td>" + decimal.Parse(ds.Tables[0].Rows[0]["CardAmount"].ToString()).ToString("0,0.00") + "</td></tr>";
        }
        htmlTable += @"<tr><td colspan='5'>....................................................................</td></tr>";

        htmlTable += "</table>";

        lblDetails.Text = htmlTable;
    }